I hereby claim:
- I am seanooi on github.
- I am seanooi (https://keybase.io/seanooi) on keybase.
- I have a public key ASDmpZDZO5BwBkyAUDztmlBVqyqzjmQMmAKfz6UabxUKsQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
const char *data = [deviceToken bytes]; | |
NSMutableString *deviceTokenString = [NSMutableString string]; | |
for (NSUInteger i = 0; i < [deviceToken length]; i++) { | |
[deviceTokenString appendFormat:@"%02.2hhx", data[i]]; | |
} | |
NSLog(@"Push Notification Token %@", deviceTokenString); |
class TextField: UITextField { | |
let padding = UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5); | |
override func textRectForBounds(bounds: CGRect) -> CGRect { | |
return self.newBounds(bounds) | |
} | |
override func placeholderRectForBounds(bounds: CGRect) -> CGRect { | |
return self.newBounds(bounds) |
enum TimeIntervalUnit { | |
case Seconds, Minutes, Hours, Days, Months, Years | |
func dateComponents(interval: Int) -> NSDateComponents { | |
var components:NSDateComponents = NSDateComponents() | |
switch (self) { | |
case .Seconds: | |
components.second = interval | |
class Timer { | |
var timer: NSTimer? | |
var competionBlock: () -> () | |
init(_ timeInterval: NSTimeInterval, completionBlock: () -> Void) { | |
self.competionBlock = completionBlock | |
self.timer = NSTimer(timeInterval: timeInterval, target: self, selector: "execute", userInfo: nil, repeats: false) | |
NSRunLoop.currentRunLoop().addTimer(timer!, forMode: NSRunLoopCommonModes) | |
} | |
- (void)viewDidLoad | |
{ | |
[self doSomethingAsync:[UIImage imageNamed:@"myImage.jpg"] completionBlock:^(UIImage *result) { | |
NSLog(@"Image returned with no errors"); | |
} failureBlock:^(NSError *error) { | |
NSLog(@"Error: %@", error.localizedDescription); | |
}]; | |
} | |
- (void)doSomethingAsync:(UIImage *)image |