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 MobileCoreServices; | |
@import AVFoundation; | |
@import AssetsLibrary; | |
// ... | |
- (void)cropVideoAtURL:(NSURL *)videoURL toSquareWithSide:(CGFloat)sideLength completion:(void(^)(NSURL *resultURL, NSError *error))completionHander { | |
/* asset */ |
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 doesn't include overrides for standard comparison operators in Swift. | |
// This extension adds <, >, <=, >=, and ==, using NSDate's built-in `compare` method. | |
// MIT licensed. | |
func <=(lhs: NSDate, rhs: NSDate) -> Bool { | |
return lhs.compare(rhs) != .OrderedDescending | |
} | |
func >=(lhs: NSDate, rhs: NSDate) -> Bool { | |
return lhs.compare(rhs) != .OrderedAscending | |
} |
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
var resultText; | |
function run(){ | |
var layerSets = app.activeDocument.layerSets; | |
dumpLayerSets(layerSets); | |
dumpLayers(app.activeDocument.layers); | |
} | |
function dumpLayerSets(layerSets){ | |
var len = layerSets.length; |