Created
March 17, 2020 16:02
-
-
Save vialyx/bb64a62428d9f5f9465d9ca9fa63c464 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
// Module | |
class FeedViewController: UIViewController { | |
let model = FeedModel() | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
model.load { | |
[weak self] (err) in | |
if err != nil { | |
// Handle Error | |
} else { | |
self?.reload() | |
} | |
} | |
} | |
private func reload() { | |
// ..... | |
} | |
} | |
class FeedModel { | |
var items: [Any] = [] | |
func load(_ compl: (Error?) -> Void) { | |
} | |
func save_ compl: (Error?) -> Void) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment