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
// Note: this will only rotate it 180 degrees, once | |
UIView.animateWithDuration(1.0, | |
animations: {self.arrowImageView.transform = CGAffineTransformMakeRotation(CGFloat(M_PI))} | |
) | |
// Note: this will rotate it 180 degrees, each time it's called | |
UIView.animateWithDuration(1.0, | |
animations: {self.arrowImageView.transform = CGAffineTransformRotate(self.arrowImageView.transform, CGFloat(M_PI))} | |
) |
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
ProjRoot/ | |
- folderA/sourceA.h | |
- folderA/sourceA.cpp | |
- folderB/sourceB.h | |
- folderB/sourceB.cpp | |
//in sourceB.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
// compare Time - Hour Minute Second - between two dates, ignoring the date part | |
- (BOOL)isTime:(NSDate *)d1 equalTo:(NSDate *)d2 { | |
unsigned int flags = NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond; | |
NSCalendar* calendar = [NSCalendar currentCalendar]; | |
NSDateComponents* components1 = [calendar components:flags fromDate:d1]; | |
NSDateComponents* components2 = [calendar components:flags fromDate:d2]; | |
NSDate* timeOnly1 = [calendar dateFromComponents:components1]; |
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
/////// | |
let time = "2015-10-29T05:22:15.000000Z" | |
let dateFormatter = NSDateFormatter() | |
dateFormatter.dateFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.SSS'Z'" | |
//dateFormatter.dateStyle = .ShortStyle | |
//dateFormatter.timeStyle = .ShortStyle | |
// if either Style line is uncommented, | |
// the next line shows an error |
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 strA "Hello" | |
#define strB "World" | |
#define strC strA " " strB | |
// strC is now defined as "Hello World" (without the quotes) | |
// then, later in code... | |
NSLog(@"Value of strC = [%s]", strC); |
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
== Device Types == | |
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s) | |
iPhone 5 (com.apple.CoreSimulator.SimDeviceType.iPhone-5) | |
iPhone 5s (com.apple.CoreSimulator.SimDeviceType.iPhone-5s) | |
iPhone 6 (com.apple.CoreSimulator.SimDeviceType.iPhone-6) | |
iPhone 6 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus) | |
iPhone 6s (com.apple.CoreSimulator.SimDeviceType.iPhone-6s) | |
iPhone 6s Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-6s-Plus) | |
iPad 2 (com.apple.CoreSimulator.SimDeviceType.iPad-2) | |
iPad Retina (com.apple.CoreSimulator.SimDeviceType.iPad-Retina) |
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
UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:view.bounds]; | |
view.layer.masksToBounds = NO; | |
view.layer.shadowColor = [UIColor blackColor].CGColor; | |
view.layer.shadowOffset = CGSizeMake(5.0f, 5.0f); | |
view.layer.shadowOpacity = 1.0f; | |
view.layer.shadowPath = shadowPath.CGPath; |
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
let dateFormatter = NSDateFormatter() | |
dateFormatter.dateFormat = "HH:mm a" | |
let date = dateFormatter.dateFromString("11:42 am") |
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
Interesting behavior (bug?) in Xcode / IB.... | |
1) Create new Single View project... | |
2) Add a couple objects to the default ViewController in Main.storyboard... | |
3) Add a new Storyboard via File -> New -> File -> Storyboard... | |
4) Back in Main.storyboard, select either View Controller or View Controller Scene... | |
5) Select Edit -> Copy (or just cmd+C) | |
6) In the new Storyboard, try to Paste -- can't do it... | |
7) Drag a ViewController to the new Storyboard... | |
8) Now try to Paste -- it works! |
OlderNewer