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
extension Notifications { | |
struct openUserProfile:NotificationType { | |
var userId:String | |
static var name: Notification.Name { | |
return Notification.Name(“LP_openUserProfile”) | |
} | |
var name:Notification.Name { | |
return openUserProfile.name |
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 | |
} |
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
// Article Name: Introducing Protocol-Oriented Programming in Swift 2 | |
// Article URL: https://www.raywenderlich.com/109156/introducing-protocol-oriented-programming-in-swift-2 | |
protocol Flyable { | |
var speed: Double { get } | |
} | |
protocol Bird { | |
var name: String { get } | |
var canFly: Bool { get } | |
} |
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
#!/bin/sh | |
## | |
# Consolidated script that compiles and installs Mono smoothly on Mac OS X. | |
# This script installs the dependencies (autoconf, automake, libtool), downloads Mono source and compiles it | |
# This script is originally from http://www.mono-project.com/Compiling_Mono_on_OSX | |
# | |
PREFIX=/usr/local | |