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
| func transformedVideoURL(_ publicID: String?) -> URL? { | |
| let transformation = CLTransformation() | |
| transformation?.width = Float(960) | |
| transformation?.height = Float(540) | |
| transformation?.crop = "pad" | |
| guard let _transformation = transformation, let _publicID = publicID else { |
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
| enum CloudinaryMedia: String { | |
| case image | |
| case video | |
| } | |
| //MARK: Deleting multiple resources | |
| func deleteResources(of child: Child, | |
| completionBlock: @escaping (_ success: Bool, _ error: DescriptiveErrorType?) -> Void) { |
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
| private static func upload(_ anything: AnyObject, | |
| completion: @escaping (Result<CloudinaryResponse>) -> Void ) { | |
| let transformation = CLTransformation() | |
| transformation?.width = 720 | |
| transformation?.height = 1280 | |
| transformation?.audioCodec = .none | |
| guard let _transformation = transformation else { | |
| return |
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
| static func getCroppedImageUrl(imageUrl: String?, width: CGFloat, height: CGFloat) -> URL? { | |
| guard let _imageUrl = imageUrl else { | |
| return nil | |
| } | |
| do { | |
| let cloudinary = try CLCloudinary(url: Configuration.cloudinaryURL()) | |
| let transformation = CLTransformation() | |
| transformation?.width = width | |
| transformation?.height = height |