Created
September 27, 2017 09:37
-
-
Save GlobakMaxim/d852bd14dc2dac0213f7dc68eb819d9d to your computer and use it in GitHub Desktop.
This file contains 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
//: Playground - noun: a place where people can play | |
import UIKit | |
protocol DisplaySection { | |
var typeId: AnyHashable {get set} | |
var title: String {get set} | |
var items: [DisplayItem] {get set} | |
} | |
protocol DisplayItem { | |
var typeId: AnyHashable {get set} | |
var title: String {get set} | |
} | |
/////////// | |
enum SectionType { | |
case main | |
case detail | |
} | |
enum ItemType { | |
case one | |
case two | |
} | |
class TestDisplayItem: DisplayItem { | |
var typeId: ItemType | |
var title: String | |
init(typeId: ItemType, title: String) { | |
self.typeId = typeId | |
self.title = title | |
} | |
} | |
class TestDisplaySection: DisplaySection { | |
var typeId: SectionType | |
var title: String | |
var items: [TestDisplayItem] | |
init(typeId: SectionType, title: String, items: [TestDisplayItem]) { | |
self.typeId = typeId | |
self.title = title | |
self.items = items | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment