Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.59 KB | None | 0 0
  1.  
  2. import UIKit
  3.  
  4. class CBModel {}
  5.  
  6. class MyModel: CBModel {}
  7.  
  8. class BaseDao<Model: CBModel> {
  9.     var items: [Model] = []
  10.     required init() {
  11.     }
  12. }
  13.  
  14. class NewsDao: BaseDao<MyModel> {
  15.     required init() {
  16.         super.init()
  17.     }
  18. }
  19.  
  20. class TableDataSource: NSObject {}
  21.  
  22. class TableDataSourceWithRealmDao<Model: CBModel, Dao: BaseDao<Model>>: TableDataSource {
  23.     private var dao: Dao
  24.    
  25.     init(koko: String) {
  26.         self.dao = Dao.init()
  27.         super.init()
  28.     }
  29. }
  30.  
  31. let datasource = TableDataSourceWithRealmDao<MyModel, NewsDao>(koko: "")
  32.  
  33. print(datasource)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement