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
print("Awesome swift, https://dev.swift") |
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
func locationManagerDidUpdate(notification: NSNotification) { | |
if let userInfo = notification.userInfo, locations = userInfo["locations"], newLocation = (locations as! NSArray).firstObject { | |
print("newLocation : \(newLocation)") | |
} | |
} |
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
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidReceiveMemoryWarningNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * __unused notification) { | |
[_af_defaultImageCache removeAllObjects]; | |
}]; |
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
//็ฌฌไธ็งๆนๆณ | |
NSDate *start = [NSDate date]; | |
//2.ๆ นๆฎurlๅฐๅไธ่ฝฝๅพ็ๆฐๆฎๅฐๆฌๅฐ๏ผไบ่ฟๅถๆฐๆฎ๏ผ | |
NSData *data = [NSData dataWithContentsOfURL:url]; | |
NSDate *end = [NSDate date]; | |
NSLog(@"็ฌฌไบๆญฅๆไฝ่ฑ่ดน็ๆถ้ดไธบ%f",[end timeIntervalSinceDate:start]); | |
//็ฌฌไบ็งๆนๆณ | |
CFTimeInterval start = CFAbsoluteTimeGetCurrent(); |
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
view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|[noWorkoutsView]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: views)) | |
view.addConstraint(NSLayoutConstraint(item:noWorkoutsView, | |
attribute: .Top, | |
relatedBy: .Equal, | |
toItem: view, | |
attribute: .Top, | |
multiplier: 1.0, | |
constant: 0)) | |