This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>The HTML5 Herald</title> | |
<meta name="description" content="The HTML5 Herald"> | |
<meta name="author" content="SitePoint"> |
This file contains 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
// Get documents directory | |
let paths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) | |
let documentsDirectory = paths[0] | |
// Create enumerator | |
let fileManager = NSFileManager.defaultManager() | |
let enumerator:NSDirectoryEnumerator = fileManager.enumeratorAtPath(documentsDirectory as String)! | |
// Iterate files | |
while let element = enumerator.nextObject() as? String { |
This file contains 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
// Special thanks to thatthinginswift.com (https://thatthinginswift.com/background-threads/) | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), { | |
// do some task | |
dispatch_async(dispatch_get_main_queue(), { | |
// update some UI | |
}); | |
}); |
This file contains 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
aView.layer.shadowColor = [UIColor blackColor].CGColor; | |
aView.layer.shadowOpacity = 0.7f; | |
aView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f); | |
aView.layer.shadowRadius = 5.0f; | |
aView.layer.masksToBounds = NO; | |
UIBezierPath *path = [UIBezierPath bezierPathWithRect:aView.bounds]; | |
aView.layer.shadowPath = path.CGPath; |