View Presenter Model ,Presenter作為橋梁,持有view 和 model的接口引用,將數(shù)據(jù)從model層傳輸?shù)絍iew層。
收錄了4篇文章 · 7人關(guān)注
View Presenter Model ,Presenter作為橋梁,持有view 和 model的接口引用,將數(shù)據(jù)從model層傳輸?shù)絍iew層。
1:簡(jiǎn)單的將Ui更新相關(guān)的操作封裝到 ViewController中,在MainActivity中只需要調(diào)用相應(yīng)的方法。 2:自定義接口的回調(diào),...
餓漢模式: 私有 、 靜態(tài)實(shí)例化 對(duì)象,通過public 方法返回實(shí)例對(duì)象。 懶漢模式:私有、靜態(tài)變量,引用NULL,在public方法中判斷為...
1 案例 1:通過自定義接口,將接口Iinterface在A類中實(shí)例話,再將接口的context傳到B類,在B類中將data通過回調(diào)傳送到A類,...