- www.haiku-os.org / www.mobileinteraction.se
- @konrad1977
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
//header file | |
typedef void (^ColorThemeBuilder)(id<ColorThemeProtocol> colorTheme); | |
@interface ThemeBuilder : NSObject <ColorThemeProtocol> | |
- (instancetype)initColorTheme:(ColorThemeBuilder)builder; | |
@end | |
//Implementation |
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
class Person { | |
var firstname: String | |
var lastname: String | |
init(firstname: String, lastname: String) { | |
self.firstname = firstname | |
self.lastname = lastname | |
} | |
} |
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
class Person { | |
var firstname: String | |
var lastname: String | |
func fullname() -> String { | |
return firstname + " " + lastname | |
} | |
init(firstname: String, lastname: String) { | |
self.firstname = firstname |
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
class Person { | |
var firstname: String | |
var lastname: String | |
init(firstname: String, lastname: String) { | |
self.firstname = firstname | |
self.lastname = lastname | |
} | |
} |
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
protocol AgeClasificationProtocol { | |
var age: Int { get } | |
func agetype() -> String | |
} | |
class Person { | |
let firstname: String | |
let lastname: String | |
var age: Int | |
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
protocol FileSaver { | |
class func savePath() -> String | |
func saveFile() | |
var isSaved: Bool { set get } | |
} | |
class VideoDocumentStorage : FileSave { | |
class func savePath() { "Videopath" } | |
func saveFile() { |
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
class Factory { | |
} | |
extension Factory { | |
class var SharedInstance: Factory { | |
struct Static { | |
static let instance: Factory = Factory() |
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
class TableViewContorllerThatWorks: UITableViewController { | |
override init(style: UITableViewStyle) { | |
super.init(style: style) | |
} | |
required init(coder aDecoder: NSCoder) { | |
fatalError("init(coder:) has not been implemented") | |
} | |
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
void UpdatePersonWithId(int personId) { | |
Person personToFind = null; | |
foreach(person in personList) { | |
if (person.id == personId) { | |
personToFind = person; | |
break; | |
} | |
} | |
SavePerson(personToFind); | |
} |
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
void UpdatePersonWithId(int personId) { | |
Person personToFind = FindPersonWithId(personId); | |
if (personToFind != null) | |
SavePerson(personToFind); | |
} | |
void FindPersonWithId(int personId) { | |
Person personToFind = null; | |
foreach(person in personList) { | |
if (person.id == personId) { |
OlderNewer