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
//: [Previous](@previous) | |
import XCTest | |
struct TodoItem { | |
let title: String | |
let dueBy: Date? | |
init(title: String) { | |
self.title = title |
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
// sample code for Rob Napier's video 'Swift Legacy Functional Programming' found in Realm News | |
// the article also explains how to use Swift to avoid bugs and write cleaner code | |
// URL: https://realm.io/news/tryswift-rob-napier-swift-legacy-functional-programming/ | |
// ============ Use Enum for OR relationship; use Struct for AND relationship ======================= | |
struct Credential { | |
let username: String | |
let password: String | |
} |