This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| // | |
| // UIDeviceHardware.h | |
| // | |
| // Used to determine EXACT version of device software is running on. | |
| #import <Foundation/Foundation.h> | |
| @interface UIDeviceHardware : NSObject | |
| - (NSString *) platform; |
| // | |
| // NBResponderChainUtilities.h | |
| // | |
| // Created by Nicolas @ bou.io on 19/04/13. | |
| // | |
| #import <UIKit/UIKit.h> | |
| @interface UIView (NBResponderChainUtilities) | |
| - (UIView*) nb_firstResponder; // Recurse into subviews to find one that responds YES to -isFirstResponder |
| + (UIImage *)snapshotView:(UIView *)view { | |
| UIGraphicsBeginImageContextWithOptions(view.frame.size, NO, [[UIScreen mainScreen] scale]); //0 | |
| [view drawViewHierarchyInRect:view.frame afterScreenUpdates:YES]; | |
| UIImage *snapshot = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); | |
| return snapshot; | |
| } | |
| + (UIImage *)snapshot { | |
| CGSize imageSize = CGSizeZero; |
Greetings, NSHipsters!
As we prepare to increment our NSDateComponents -year by 1, it's time once again for NSHipster end-of-the-year Reader Submissions! Last year, we got some mind-blowing tips and tricks. With the release of iOS 7 & Mavericks, and a year's worth of new developments in the Objective-C ecosystem, there should be a ton of new stuff to write up for this year.
Submit your favorite piece of Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!
Here are a few examples of the kind of things I'd like to see:
NSStringFromSelector(@selector()) as a safer way to do KVC / KVO / NSCoding.| /** | |
| Provides the ability to verify key paths at compile time. | |
| If "keyPath" does not exist, a compile-time error will be generated. | |
| Example: | |
| // Verifies "isFinished" exists on "operation". | |
| NSString *key = SQKeyPath(operation, isFinished); | |
| // Verifies "isFinished" exists on self. |
Find it here: https://github.com/bitemyapp/learnhaskell
| - (void)viewWillAppear:(BOOL)animated | |
| { | |
| [super viewWillAppear:animated]; | |
| NSIndexPath *selectedRowIndexPath = [self.tableView indexPathForSelectedRow]; | |
| if (selectedRowIndexPath) { | |
| [self.tableView deselectRowAtIndexPath:selectedRowIndexPath animated:YES]; | |
| [[self transitionCoordinator] notifyWhenInteractionEndsUsingBlock:^(id<UIViewControllerTransitionCoordinatorContext> context) { | |
| if ([context isCancelled]) { | |
| [self.tableView selectRowAtIndexPath:selectedRowIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; |
| protocol Monad { | |
| typealias F | |
| typealias U | |
| class func bind<M : Monad where M.U == U>(Self, F -> M) -> M | |
| class func `return`(F) -> Self | |
| } | |
| extension Array : Monad { | |
| typealias F = T |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.