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
extension PHAsset { | |
// MARK: - Public methods | |
func getAssetThumbnail(size: CGSize) -> UIImage { | |
let manager = PHImageManager.default() | |
let option = PHImageRequestOptions() | |
var thumbnail = UIImage() | |
option.isSynchronous = true | |
manager.requestImage(for: self, targetSize: size, contentMode: .aspectFill, options: option, resultHandler: {(result, info)->Void in |
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
func printDate(string: String) { | |
let date = Date() | |
let formatter = DateFormatter() | |
formatter.dateFormat = "HH:mm:ss.SSSS" | |
print(string + formatter.string(from: date)) | |
} |