- 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
#!/usr/bin/env sh | |
# first check to see if mongo service is running. you can't delete any files until the service stops so perform a quick check. | |
launchctl list | grep mongo | |
# NOTE: the pipe | symbol means the commands on the right performs on the output from the left | |
# grep is a string search utility. `grep mongo` means search for the substring mongo | |
# use the unload command to end the mongo service. this is required to 'unlock' before removing the service. | |
# first look for the file to delete | |
MONGO_SERVICE_FILE=$(ls ~/Library/LaunchAgents/*mongodb*) |
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 CloudKit | |
/// async gets iCloud record ID object of logged-in iCloud user | |
func iCloudUserIDAsync(complete: (instance: CKRecordID?, error: NSError?) -> ()) { | |
let container = CKContainer.defaultContainer() | |
container.fetchUserRecordIDWithCompletionHandler() { | |
recordID, error in | |
if error != nil { | |
print(error!.localizedDescription) | |
complete(instance: nil, error: 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
import CloudKit | |
iCloudUserIDAsync() { | |
recordID, error in | |
if let userID = recordID?.recordName { | |
print("received iCloudID \(userID)") | |
} else { | |
print("Fetched iCloudID was nil") | |
} | |
} |
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
// MARK: - Adding a header to a single request | |
func doRequestWithHeaders1() { | |
let headers: HTTPHeaders = [ | |
"X-Mashape-Key": MY_API_KEY, | |
"Accept": "application/json" | |
] | |
Alamofire.request("https://mashape-community-urban-dictionary.p.mashape.com/define?term=smh", headers: headers) | |
.responseJSON { response in | |
debugPrint(response) |
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 | |
class MyView: UIView { | |
fileprivate var myPreviewInteraction: Any? = nil | |
init() { | |
super.init(frame: CGRect.zero) | |
if #available(iOS 10.0, *) { | |
myPreviewInteraction = UIPreviewInteraction(view: self) |
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
public protocol Cachable { | |
var fileName: String { get } | |
func transform() -> Data | |
} | |
final public class Cacher { | |
let destination: URL | |
private let queue = OperationQueue() | |
public enum CacheDestination { |
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 Foundation | |
import UIKit | |
// Usage Examples | |
let shadowColor = Color.shadow.value | |
let shadowColorWithAlpha = Color.shadow.withAlpha(0.5) | |
let customColorWithAlpha = Color.custom(hexString: "#123edd", alpha: 0.25).value | |
enum Color { | |
OlderNewer