- Introduction to Functional Programming Johannes Weiß - https://vimeo.com/100786088
- ReactiveCocoa at MobiDevDay Andrew Sardone - https://vimeo.com/65637501
- The Future Of ReactiveCocoa Justin Spahr-Summers - https://www.youtube.com/watch?v=ICNjRS2X8WM
- Enemy of the State Justin Spahr-Summers - https://www.youtube.com/watch?v=7AqXBuJOJkY
- WWDC 2014 Session 229 - Advanced iOS Application Architecture and Patterns Andy Matuschak - https://developer.apple.com/videos/play/wwdc2014/229/
- Functioning as a Functionalist Andy Matuschak - https://www.youtube.com/watch?v=rJosPrqBqrA
- Controlling Complexity in Swift Andy Matuschak - https://realm.io/news/andy-matuschak-controlling-complexity/
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 User: Object { | |
// MARK: - Init | |
convenience init(param first: String, second: String) { | |
self.init() | |
} | |
// MARK: - Instance / Persisted Properties | |
@objc dynamic var id = UUID().uuidString | |
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
//------------- e.g Realm Object | |
class User: Object { | |
// MARK: - Init | |
convenience init(param first: String, second: String) { | |
self.init() | |
} | |
// MARK: - Instance / Persisted Properties | |
@objc dynamic var id = UUID().uuidString |
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
import UIKit | |
// MARK: - ThirtPartyDelegate | |
protocol ThirtPartyDelegate { | |
//Delegate methods | |
} | |
// MARK: - NetworkClientType | |
protocol NetworkClientType { | |
//Protocoll variables + methods |
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
import UIKit | |
protocol NetworkClientType { | |
//Protocoll variables + methods | |
} | |
class NetworkClient: NetworkClientType { | |
// MARK: - Class Constructors | |
static let shared: NetworkClient = { | |
//customize instance |
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 | |
var str = "12,3,5,75,584,364,57,88,94,4,79,333,7465,867,56,6,748,546,573,466" | |
let numbers = str.components(separatedBy: ",") | |
extension Array { | |
func chunked(by chunkSize: Int) -> [[Element]] { | |
return stride(from: 0, to: self.count, by: chunkSize).map { | |
Array(self[$0..<Swift.min($0 + chunkSize, self.count)]) |
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 OrderBadType { | |
func printOrder() //could change text representation style | |
//methods below may change DB processing from Core Data to Realm | |
func load() | |
func save() | |
} |
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 OrderType { | |
var products: [ProductType] { get } | |
func calculateTotalSum() | |
func getItems() | |
func add(_ product: ProductType) | |
func remove(_ product: ProductType) | |
} |
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 OrderStorage { | |
func load() { | |
let moc = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType) | |
let ordersFetch = NSFetchRequest<NSFetchRequestResult>(entityName: "Order") | |
do { | |
let fetchedEmployees = try moc.fetch(orderFetch) as! [Order] | |
} catch { | |
fatalError("Failed to fetch orders: \(error)") | |
} |
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 OrderStorageType { | |
func load() | |
func save() | |
} | |
class ReamlOrderStorage: OrderStorageType { | |
var order: Order | |
func load() { | |
do { | |
let realm = try Realm() |
OlderNewer