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 Foundation | |
private let bgQueue = DispatchQueue(label: "MIUsecase") | |
/// Provide implementation for the execute method and then | |
/// call perform to get response in main thread | |
/// call execute to get response in background thread | |
public protocol MIUsecase: class { | |
associatedtype MIUsecaseRequest | |
associatedtype MIUsecaseResponse |
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 | |
import MINetworkKit | |
class AlbumsViewController: MITableViewController { | |
override func registerCells() { | |
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "albumCell") | |
updateAlbums() | |
} | |
} |
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 | |
class PostsViewController: MITableViewController { | |
init(posts: [Post]) { | |
super.init(style: .plain) | |
sections.append(SectionItem(id: "Post", header: nil, items: posts)) | |
} | |
required init?(coder: NSCoder) { |
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
class MITableViewController: UITableViewController { | |
var sections: [SectionItem] = [] | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
registerCells() | |
} | |
func registerCells() { |
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
extension ViewController: UITableViewDataSource { | |
func numberOfSections(in tableView: UITableView) -> Int { | |
// your implementation goes here | |
} | |
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { | |
// your implementation goes here | |
} | |