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 Foundation | |
extension RACSignal { | |
func subscribeNextAs<T>(nextClosure: (T?) -> Void) { | |
self.subscribeNext { | |
(next: AnyObject!) -> () in | |
let nextAsT = next as? T | |
nextClosure(nextAsT) | |
} |
I hereby claim:
- I am sebreh on github.
- I am sebreh (https://keybase.io/sebreh) on keybase.
- I have a public key whose fingerprint is 2B14 F778 D7BD 6DD3 8189 B22E 7402 37CD 9BDD 32A0
To claim this, I am signing this object:
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
extension PKTAsyncTask { | |
func onSuccess<ResultType>(successBlock: ResultType! -> Void) { | |
onSuccess { obj in | |
let typedObj = obj as? ResultType | |
successBlock(typedObj) | |
} | |
} | |
func onComplete<ResultType>(completeBlock: (ResultType?, NSError?) -> Void) { |
- Adopt size classes and be aware of the old derecated rotation APIs. Test your app on the resizable simulator.
- Push Notifications: The API to register for push notifications has changed on iOS 8 with new methods on UIApplication.
- If you use app icon badges, you need to ask for user permission in order to do so.
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
[ | |
[0, [0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0, 0,0]], | |
[20, [1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1]], | |
[6, [1,1, 1,1, 1,1]], # incomplete | |
[18, [1,1, 6,4, 3]], # incomplete w/ spare | |
[150, [5,5, 5,5, 5,5, 5,5, 5,5, 5,5, 5,5, 5,5, 5,5, 5,5, 5]], | |
[47, [1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 1,1, 10, 10 ,9]], | |
[173, [7,3, 7,3, 7,3, 7,3, 7,3, 7,3, 7,3, 7,3, 7,3, 7,3, 10]], | |
[300, [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10]], | |
[280, [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 5]], # incomplete |
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 <CoreData/CoreData.h> | |
@interface NSManagedObjectContext (SRFetchAsync) | |
- (void)sr_executeFetchRequest:(NSFetchRequest *)request completion:(void (^)(NSArray *objects, NSError *error))completion; | |
@end |
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
#define SR_WEAK(obj) __typeof__(obj) __weak | |
#define SR_WEAK_SELF SR_WEAK(self) | |
// Usage: | |
// SR_WEAK_SELF weakSelf = self; |
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
// | |
// UIApplication+SRFirstResponder.m | |
// | |
// Copyright (C) 2012 Sebastian Rehnby | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the "Software"), | |
// to deal in the Software without restriction, including without limitation | |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
// and/or sell copies of the Software, and to permit persons to whom the |