- Introduction to Functional Programming Johannes Weiß - http://kcy.me/1ngiv
- ReactiveCocoa at MobiDevDay Andrew Sardone - http://kcy.me/1nhl3
- The Future Of ReactiveCocoa Justin Spahr-Summers - http://kcy.me/1nhs7
- Enemy of the State Justin Spahr-Summers - http://kcy.me/1njzs
- WWDC 2014 Session 229 - Advanced iOS Application Architecture and Patterns Andy Matuschak - http://kcy.me/1pyva
- Functioning as a Functionalist Andy Matuschak - http://kcy.me/22o45
- Controlling Complexity in Swift Andy Matuschak - http://kcy.me/23sc9
- Functional and reactive programming with Swift Ash Furrow -
| public protocol Cachable { | |
| var fileName: String { get } | |
| func transform() -> Data | |
| } | |
| final public class Cacher { | |
| let destination: URL | |
| private let queue = OperationQueue() | |
| public enum CacheDestination { |
In this article, I'm going to explore a way that we can create views that implement custom Core Animation property animations in a natural way.
As we know, layers in iOS come in two flavours: Backing layers and hosted layers. The only difference between them is that the view acts as the layer delegate for its backing layer, but not for any hosted sublayers.
In order to implement the UIView transactional animation blocks, UIView disables all animations by default and then re-enables them individually as required. It does this using the actionForLayer:forKey: method.
Somewhat strangely, UIView doesn't enable animations for every property that CALayer does by default. A notable example is the layer.contents property, which is animatable by default for a hosted layer, but cannot be animated using a UIView animation block.
| extension Array { | |
| func first() -> Element? { | |
| if isEmpty { | |
| return nil | |
| } | |
| return self[0] | |
| } | |
| func last() -> Element? { |
| // Playground - noun: a place where people can play | |
| import Cocoa | |
| struct Regex { | |
| let pattern: String | |
| let expressionOptions: NSRegularExpressionOptions | |
| let matchingOptions: NSMatchingOptions | |
| init(pattern: String, expressionOptions: NSRegularExpressionOptions, matchingOptions: NSMatchingOptions) { |
Generate the list yourself:
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep -H UI_APPEARANCE_SELECTOR ./* | sed 's/ __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;//'
| // | |
| // iOS_API+Blocks.h | |
| // | |
| // Created by Bobby Schultz on 12/1/11. | |
| @interface UIAlertView (PBBlocks) | |
| + (id) alertWithTitle:(NSString*)title | |
| message:(NSString*)message | |
| clickedBlock:(void(^)(NSInteger))buttonIndexClickedBlock |
| %%CODE __ | |
| $response = file_get_contents("http://api.aerisapi.com/observations/closest?p=%%zipcode%%&client_id= CLIENT_ID &client_secret= CLIENT_SECRET "); __ | |
| $json = json_decode($response); __ | |
| if ($json->success == true) { __ | |
| $Country = $json->response[0]->place->country; __ | |
| $cond = $json->response[0]->ob; __ | |
| echo ("<tr><td width='100%' colspan='2' align='center'><img src='%%hwvImagesPath%%" . ($tIcon=(!empty($cond->icon)) ? $cond->icon : "na.gif") . "' alt='" . $cond->weather . "' width='%%hwvImgWidth%%' height='%%hwvImgHeight%%' /></td></tr>"); __ | |
| echo ("<tr><td width='100%' colspan='2' align='center'><span class='Wx'>" . ($tWxshort=(!empty($cond->weatherShort)) ? $cond->weatherShort : "N/A") . "</span></td></tr>"); __ | |
| echo ("<tr><td valign='top'><span class='Temp'>Temp:</span></td><td valign='top' align='right'><span class='Temp'>" . ($tTemp=(!empty($cond->tempF)) ? (($Country == 'us') ? $cond->tempF : $cond->tempC) . "°" : "N/A") . "</span></td></tr>"); __ | |
| echo ("</table></td><td valign='top' al |
| @implementation MKMapView (ZoomLevel) | |
| - (NSUInteger) zoomLevel { | |
| return (21 - round(log2(self.region.span.longitudeDelta * MERCATOR_RADIUS * M_PI / (180.0 * self.bounds.size.width)))); | |
| } | |
| @end |
| AD Andorra | |
| AE United Arab Emirates | |
| AF Afghanistan | |
| AG Antigua and Barbuda | |
| AI Anguilla | |
| AL Albania | |
| AM Armenia | |
| AN Netherlands Antilles | |
| AO Angola | |
| AQ Antarctica |