Author: Chris Lattner
This file contains hidden or 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
| /// Withable is a simple protocol to make constructing | |
| /// and modifying objects with multiple properties | |
| /// more pleasant (functional, chainable, point-free) | |
| public protocol Withable { | |
| init() | |
| } | |
| public extension Withable { | |
| /// Construct a new instance, setting an arbitrary subset of properties | |
| init(with config: (inout Self) -> Void) { |
This file contains hidden or 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
| // Configuration settings file format documentation can be found at: | |
| // https://help.apple.com/xcode/#/dev745c5c974 | |
| SUPPORTED_PLATFORMS = iphoneos macosx appletvos watchos iphonesimulator appletvsimulator watchsimulator | |
| SWIFT_VERSION = 4.2 | |
| IPHONEOS_DEPLOYMENT_TARGET = 9.0 | |
| MACOSX_DEPLOYMENT_TARGET = 10.11 |
This file contains hidden or 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
| // Created by Vasily Ulianov on 09.02.17, updated in 2019. | |
| // License: MIT | |
| import Foundation | |
| /// Subclass of `Operation` that adds support of asynchronous operations. | |
| /// 1. Call `super.main()` when override `main` method. | |
| /// 2. When operation is finished or cancelled set `state = .finished` or `finish()` | |
| open class AsynchronousOperation: Operation { | |
| public override var isAsynchronous: Bool { |
This file contains hidden or 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
| @IBDesignable | |
| class UIPaddedLabel:UILabel { | |
| @IBInspectable var topPadding:CGFloat = 0 { | |
| didSet { | |
| updatePadding() | |
| } | |
| } | |
| @IBInspectable var leftPadding:CGFloat = 0 { | |
| didSet { |
This file contains hidden or 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
| - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| VideoCell *videoCell = (VideoCell *)[self.tableView dequeueReusableCellWithIdentifier:@"VideoCell"]; | |
| NSString *urlString = @"streaming://download.wavetlan.com/SVV/Media/HTTP/MOV/ConvertedFiles/MediaCoder/MediaCoder_test11_36s_H263_VBR_590kbps_176x144_25fps_MPEG1Layer3_CBR_160kbps_Stereo_22050Hz.mov"; | |
| dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); | |
| // Configure Video Cell Here: | |
| NSURL *url = [NSURL URLWithString:urlString]; | |
| videoCell.contentView.backgroundColor = [UIColor clearColor]; | |
| videoCell.backgroundColor = [UIColor clearColor]; |
This file contains hidden or 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 | |
| // If you enjoyed this talk (video link will be up soon), then you might also enjoy our book Advanced Swift: http://www.objc.io/books/advanced-swift | |
| struct Person { | |
| let name: String | |
| let city: String | |
| } | |
| let people = [ |
This file contains hidden or 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
| /* | |
| UIColor class method that returns a random color. All parameters are optional. | |
| */ | |
| import UIKit | |
| extension UIColor{ | |
| class func randomColor(hue:CGFloat? = ( CGFloat( CGFloat(arc4random()) % 256 / 256.0 ) ), | |
| saturation:CGFloat? = ( CGFloat( CGFloat(arc4random()) % 128 / 256.0 ) + 0.5 ), | |
| brightness:CGFloat? = ( CGFloat( CGFloat(arc4random()) % 128 / 256.0 ) + 0.5 ), |
- 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/
NewerOlder