Skip to content

Instantly share code, notes, and snippets.

@vialyx
Last active February 19, 2018 14:41
Show Gist options
  • Save vialyx/4c8a7907a6e3631543c5198cc8a3ae7f to your computer and use it in GitHub Desktop.
Save vialyx/4c8a7907a6e3631543c5198cc8a3ae7f to your computer and use it in GitHub Desktop.
protocol AssestType {
var assets: [Any] { get }
func downloadAssest()
}
struct Event {
var priority: Float = 0 // This value used for positioning in EventsList. ASC sort type.
var assets: [Any] = []
}
extension Event: AssestType {
/*
This function should be called after event has been opened from list.
As a result Event has loaded assets array
*/
func downloadAssest() {
}
}
class ViewController: UIViewController {
// FIXME: - Rework to Array(repeating:count:)
let events = [Event(), Event()]
}
// MARK: - UITableViewDataSource
extension ViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// TODO: - Implement different sections by Event type
return events.count
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment