Skip to content

Instantly share code, notes, and snippets.

View schevgeny's full-sized avatar

schevgeny schevgeny

View GitHub Profile
@schevgeny
schevgeny / .swift
Created January 26, 2023 14:42 — forked from pakisha/.swift
PHAsset
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
@schevgeny
schevgeny / printTime.swift
Created January 25, 2021 12:27 — forked from anvarazizov/printTime.swift
print time in swift with milliseconds
func printDate(string: String) {
let date = Date()
let formatter = DateFormatter()
formatter.dateFormat = "HH:mm:ss.SSSS"
print(string + formatter.string(from: date))
}