.isImage
๐ ๅ่๏ผSwift Playgrounds โฉ Image Gallery (Data Model: Gathering Image URLs)
import Foundation
extension URL {
var isImage: Bool {
["jpg", "jpeg", "png", "gif", "heic"]
.contains(self.pathExtension)
}
}
Last updated
Was this helpful?