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
| actor User | |
| participant App | |
| collections Photos | |
| database CoreData | |
| User -> App: Open Photo Picker View | |
| App -> Photos: Fetch photos from the Photos app | |
| App <- Photos | |
| User <- App: Show fetched photos | |
| User -> App: Select photos and share to an album |
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
| lane :update_carthage_libraries do |options| | |
| outdateds = "" | |
| Dir.chdir ".." do | |
| outdateds += sh("carthage", "outdated") | |
| end | |
| current_branch = git_branch | |
| outdateds.each_line do |line| |
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 GeneralizedDataSource: StructuredTableCellDataSource { | |
| func load(_ tasks: [Task]) { | |
| let profileSection = TableCellSection(rows: [TableCellRow(reusableId: "ProfileTableViewCell", value: ())]) | |
| let personalTaskSection = TableCellSection( | |
| rows: tasks.filter { $0.category == .personal }.map { TableCellRow(reusableId: "TaskTableViewCell", value: $0) }, | |
| headerTitle: Category.personal.rawValue | |
| ) | |
| let shoppingTaskSection = TableCellSection( | |
| rows: tasks.filter { $0.category == .shopping }.map { TableCellRow(reusableId: "TaskTableViewCell", value: $0) }, |
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
| func configureCell(_ cell: UITableViewCell, withValue value: Any) {} | |
| . | |
| . | |
| . | |
| final func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | |
| let row = self.sections[indexPath.section].rows[indexPath.row] | |
| let cell = tableView.dequeueReusableCell(withIdentifier: row.reusableId, for: indexPath) | |
| self.configureCell(cell, withValue: row.value) // | |
| return cell | |
| } |
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
| final func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { | |
| return sections[section].headerTitle | |
| } |
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
| final func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
| return self.sections[section].rows.count | |
| } |
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
| final func numberOfSections(in tableView: UITableView) -> Int { | |
| return self.sections.count | |
| } |
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 StructuredTableCellDataSource: NSObject, UITableViewDataSource { | |
| private var sections: [TableCellSection] = [] | |
| . | |
| . | |
| . |
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
| struct TableCellRow { | |
| let reusableId: String | |
| let value: Any | |
| } |
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
| struct TableCellSection { | |
| var rows: [TableCellRow] | |
| let headerTitle: String? | |
| let footerTitle: String? | |
| init(rows: [TableCellRow], headerTitle: String? = nil, footerTitle: String? = nil) { | |
| self.rows = rows | |
| self.headerTitle = headerTitle | |
| self.footerTitle = footerTitle | |
| } |
NewerOlder