- 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 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
| @implementation UIClassSwapper | |
| - (instancetype) initWithCoder:(UINibDecoder *)decoder | |
| { | |
| NSString *className = [decoder decodeObjectForKey:@"UIClassName"]; | |
| NSString *originalClassName = [decoder decodeObjectForKey:@"UIOriginalClassName"]; | |
| Class class = NSClassFromString(className); | |
| Class originalClass = NSClassFromString(originalClassName); | |
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
| // Xcode 6.3 defines new language features to declare nullability | |
| #if __has_feature(nullability) | |
| #define PSPDF_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin") | |
| #define PSPDF_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end") | |
| #define ps_nullable nullable | |
| #define ps_nonnull nonnull | |
| #define ps_null_unspecified null_unspecified | |
| #define ps_null_resettable null_resettable | |
| #define __ps_nullable __nullable | |
| #define __ps_nonnull __nonnull |
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
| /// Performs `block` immediately and ignores subsequent calls during the same runloop. | |
| #define pspdf_ensureCalledOnlyOncePerRunloop(block) do { \ | |
| static const char __onceKey; _pspdf_ensureCalledOnlyOncePerRunloop(self, &__onceKey, block); } while(0) | |
| extern void _pspdf_ensureCalledOnlyOncePerRunloop(id self, const void *key, dispatch_block_t block); | |
| void _pspdf_ensureCalledOnlyOncePerRunloop(id self, const void *key, dispatch_block_t block) { | |
| NSCParameterAssert(block); | |
| NSCParameterAssert(self); | |
| PSPDFAssertOnMainThread(); // run loop needs the main thread. |
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
| #!/usr/sbin/dtrace -q -s | |
| /* | |
| Overly spammy, mostly covered by the other probes (every "read" or "write" is a "request") | |
| CFPreferencesServer$target:::request { | |
| printf("REQUEST from pid %d at %Y ( domain: %s, user: %s, host: %s, container: %s, managed: %d)\n", arg0, walltimestamp, copyinstr(arg1) != NULL ? copyinstr(arg1) : "(NULL)" ?: "(NULL)", copyinstr(arg2) != NULL ? copyinstr(arg2) : "(NULL)", copyinstr(arg3) != NULL ? copyinstr(arg3) : "(NULL)", copyinstr(arg4) != NULL ? copyinstr(arg4) : "(NULL)", arg5); | |
| } | |
| */ | |
| CFPreferencesServer$target:::write_rejected { | |
| printf("REJECTED WRITE OF KEY %s request from pid %d for reason %s at %Y ( domain: %s, user: %s, host: %s, container: %s)\n", copyinstr(arg1) != NULL ? copyinstr(arg1) : "(NULL)", arg0, copyinstr(arg6) != NULL ? copyinstr(arg6) : "(NULL)", walltimestamp, copyinstr(arg2) != NULL ? copyinstr(arg2) : "(NULL)", copyinstr(arg3) != NULL ? copyinstr(arg3) : "(NULL)", copyinstr(arg4) != NULL ? copyinstr(arg4) : "(NULL)", copyinstr(arg5) != NULL ? copyinstr(arg5) |
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
| /// Observes a run loop to detect any stalling or blocking that occurs. | |
| /// | |
| /// This class is thread-safe. | |
| @interface GHRunLoopWatchdog : NSObject | |
| /// Initializes the receiver to watch the specified run loop, using a default | |
| /// stalling threshold. | |
| - (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
| /// Initializes the receiver to detect when the specified run loop blocks for |
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
| This is the code path that changed the status bar orientation on iOS 7: | |
| * thread #1: tid = 0x698dbf, 0x00085830 WindowRotationIssue`-[AppDelegate application:willChangeStatusBarOrientation:duration:](self=0x7a041f90, _cmd=0x0137a18d, application=0x79e39cc0, newStatusBarOrientation=UIInterfaceOrientationPortraitUpsideDown, duration=0.80000000000000004) + 96 at AppDelegate.m:23, queue = 'com.apple.main-thread', stop reason = breakpoint 3.1 | |
| * frame #0: 0x00085830 WindowRotationIssue`-[AppDelegate application:willChangeStatusBarOrientation:duration:](self=0x7a041f90, _cmd=0x0137a18d, application=0x79e39cc0, newStatusBarOrientation=UIInterfaceOrientationPortraitUpsideDown, duration=0.80000000000000004) + 96 at AppDelegate.m:23 | |
| frame #1: 0x00bb6ab5 UIKit`-[UIApplication setStatusBarOrientation:animationParameters:notifySpringBoardAndFence:] + 242 | |
| frame #2: 0x00bfa8e4 UIKit`-[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 4761 | |
| frame #3: 0x00bf9646 UIKit`-[UIWi |
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
| // | |
| // NUIProtocolChecker.h | |
| // NUIKit | |
| // | |
| // Created by Robert Widmann on 1/14/15. | |
| // Copyright (c) 2015 CodaFi. All rights reserved. | |
| // Released under the MIT license. | |
| // | |
| #import <Foundation/Foundation.h> |
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
| // This accompanies http://chris.eidhof.nl/posts/repmin-in-swift.html | |
| import UIKit | |
| // Unfortunately, we need Box | |
| public class Box<T> { | |
| public let unbox: T | |
| public init(_ value: T) { self.unbox = value } | |
| } |
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
| @implementation UILabel (SwizzlingExamples) | |
| + (void)load | |
| { | |
| SwizzleSelectorWithBlock_Begin(self, @selector(initWithFrame:)) | |
| ^(UILabel *self, CGRect frame) { | |
| if ((self = ((id (*)(id, SEL, CGRect))_imp)(self, _cmd, frame))) { | |
| // ... | |
| } | |
| return self; |