├── .swift-version ├── LICENSE ├── README.md ├── Source ├── UIImage+Alpha.swift ├── UIImage+Resize.swift └── UIImage+RoundedCorner.swift ├── UIImageSwiftExtensions.podspec ├── UIImageSwiftExtensions.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── jhack.xcuserdatad │ └── UserInterfaceState.xcuserstate └── UIImageSwiftExtensions ├── UIImageSwiftExtensions.xcodeproj ├── project.pbxproj ├── xcshareddata │ └── xcschemes │ │ └── UIImageSwiftExtensions.xcscheme └── xcuserdata │ └── jhack.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist └── UIImageSwiftExtensions ├── AppDelegate.swift ├── Assets.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist └── ViewController.swift /.swift-version: -------------------------------------------------------------------------------- 1 | 4.2 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Giacomo Boccardo 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # UIImageSwiftExtensions 2 | A Swift 4 port of Trevor Harmon UIImage's extensions (http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/). 3 | -------------------------------------------------------------------------------- /Source/UIImage+Alpha.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Alpha.swift 3 | // 4 | // Created by Trevor Harmon on 09/20/09. 5 | // Swift 3 port by Giacomo Boccardo on 09/15/2016. 6 | // 7 | // Free for personal or commercial use, with or without modification 8 | // No warranty is expressed or implied. 9 | // 10 | import UIKit 11 | 12 | public extension UIImage { 13 | 14 | public func hasAlpha() -> Bool { 15 | let alpha: CGImageAlphaInfo = (self.cgImage)!.alphaInfo 16 | return 17 | alpha == CGImageAlphaInfo.first || 18 | alpha == CGImageAlphaInfo.last || 19 | alpha == CGImageAlphaInfo.premultipliedFirst || 20 | alpha == CGImageAlphaInfo.premultipliedLast 21 | } 22 | 23 | public func imageWithAlpha() -> UIImage { 24 | if self.hasAlpha() { 25 | return self 26 | } 27 | 28 | let imageRef:CGImage = self.cgImage! 29 | let width = imageRef.width 30 | let height = imageRef.height 31 | 32 | // The bitsPerComponent and bitmapInfo values are hard-coded to prevent an "unsupported parameter combination" error 33 | let offscreenContext: CGContext = CGContext( 34 | data: nil, width: width, height: height, bitsPerComponent: 8, bytesPerRow: 0, 35 | space: imageRef.colorSpace!, 36 | bitmapInfo: 0 /*CGImageByteOrderInfo.orderMask.rawValue*/ | CGImageAlphaInfo.premultipliedFirst.rawValue 37 | )! 38 | 39 | // Draw the image into the context and retrieve the new image, which will now have an alpha layer 40 | offscreenContext.draw(imageRef, in: CGRect(x: 0, y: 0, width: CGFloat(width), height: CGFloat(height))) 41 | let imageRefWithAlpha:CGImage = offscreenContext.makeImage()! 42 | 43 | return UIImage(cgImage: imageRefWithAlpha) 44 | } 45 | 46 | public func transparentBorderImage(_ borderSize: Int) -> UIImage { 47 | let image = self.imageWithAlpha() 48 | 49 | let newRect = CGRect( 50 | x: 0, y: 0, 51 | width: image.size.width + CGFloat(borderSize) * 2, 52 | height: image.size.height + CGFloat(borderSize) * 2 53 | ) 54 | 55 | 56 | // Build a context that's the same dimensions as the new size 57 | let bitmap: CGContext = CGContext( 58 | data: nil, 59 | width: Int(newRect.size.width), height: Int(newRect.size.height), 60 | bitsPerComponent: (self.cgImage)!.bitsPerComponent, 61 | bytesPerRow: 0, 62 | space: (self.cgImage)!.colorSpace!, 63 | bitmapInfo: (self.cgImage)!.bitmapInfo.rawValue 64 | )! 65 | 66 | // Draw the image in the center of the context, leaving a gap around the edges 67 | let imageLocation = CGRect(x: CGFloat(borderSize), y: CGFloat(borderSize), width: image.size.width, height: image.size.height) 68 | bitmap.draw(self.cgImage!, in: imageLocation) 69 | let borderImageRef: CGImage = bitmap.makeImage()! 70 | 71 | // Create a mask to make the border transparent, and combine it with the image 72 | let maskImageRef: CGImage = self.newBorderMask(borderSize, size: newRect.size) 73 | let transparentBorderImageRef: CGImage = borderImageRef.masking(maskImageRef)! 74 | return UIImage(cgImage:transparentBorderImageRef) 75 | } 76 | 77 | fileprivate func newBorderMask(_ borderSize: Int, size: CGSize) -> CGImage { 78 | let colorSpace: CGColorSpace = CGColorSpaceCreateDeviceGray() 79 | 80 | // Build a context that's the same dimensions as the new size 81 | let maskContext: CGContext = CGContext( 82 | data: nil, 83 | width: Int(size.width), height: Int(size.height), 84 | bitsPerComponent: 8, // 8-bit grayscale 85 | bytesPerRow: 0, 86 | space: colorSpace, 87 | bitmapInfo: CGBitmapInfo().rawValue | CGImageAlphaInfo.none.rawValue 88 | )! 89 | 90 | // Start with a mask that's entirely transparent 91 | maskContext.setFillColor(UIColor.black.cgColor) 92 | maskContext.fill(CGRect(x: 0, y: 0, width: size.width, height: size.height)) 93 | 94 | // Make the inner part (within the border) opaque 95 | maskContext.setFillColor(UIColor.white.cgColor) 96 | maskContext.fill(CGRect( 97 | x: CGFloat(borderSize), 98 | y: CGFloat(borderSize), 99 | width: size.width - CGFloat(borderSize) * 2, 100 | height: size.height - CGFloat(borderSize) * 2) 101 | ) 102 | 103 | // Get an image of the context 104 | return maskContext.makeImage()! 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Source/UIImage+Resize.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Resize.swift 3 | // 4 | // Created by Trevor Harmon on 08/05/09. 5 | // Swift 3 port by Giacomo Boccardo on 09/15/2016. 6 | // 7 | // Free for personal or commercial use, with or without modification 8 | // No warranty is expressed or implied. 9 | // 10 | import UIKit 11 | 12 | public extension UIImage { 13 | 14 | // Returns a copy of this image that is cropped to the given bounds. 15 | // The bounds will be adjusted using CGRectIntegral. 16 | // This method ignores the image's imageOrientation setting. 17 | public func croppedImage(_ bounds: CGRect) -> UIImage { 18 | let imageRef: CGImage = (self.cgImage)!.cropping(to: bounds)! 19 | return UIImage(cgImage: imageRef) 20 | } 21 | 22 | public func thumbnailImage(_ thumbnailSize: Int, transparentBorder borderSize:Int, cornerRadius:Int, interpolationQuality quality:CGInterpolationQuality) -> UIImage { 23 | let resizedImage = self.resizedImageWithContentMode(.scaleAspectFill, bounds: CGSize(width: CGFloat(thumbnailSize), height: CGFloat(thumbnailSize)), interpolationQuality: quality) 24 | 25 | // Crop out any part of the image that's larger than the thumbnail size 26 | // The cropped rect must be centered on the resized image 27 | // Round the origin points so that the size isn't altered when CGRectIntegral is later invoked 28 | let cropRect = CGRect( 29 | x: round((resizedImage.size.width - CGFloat(thumbnailSize))/2), 30 | y: round((resizedImage.size.height - CGFloat(thumbnailSize))/2), 31 | width: CGFloat(thumbnailSize), 32 | height: CGFloat(thumbnailSize) 33 | ) 34 | 35 | let croppedImage = resizedImage.croppedImage(cropRect) 36 | let transparentBorderImage = borderSize != 0 ? croppedImage.transparentBorderImage(borderSize) : croppedImage 37 | 38 | return transparentBorderImage.roundedCornerImage(cornerSize: cornerRadius, borderSize: borderSize) 39 | } 40 | 41 | // Returns a rescaled copy of the image, taking into account its orientation 42 | // The image will be scaled disproportionately if necessary to fit the bounds specified by the parameter 43 | public func resizedImage(_ newSize: CGSize, interpolationQuality quality: CGInterpolationQuality) -> UIImage { 44 | var drawTransposed: Bool 45 | 46 | switch(self.imageOrientation) { 47 | case .left, .leftMirrored, .right, .rightMirrored: 48 | drawTransposed = true 49 | default: 50 | drawTransposed = false 51 | } 52 | 53 | return self.resizedImage( 54 | newSize, 55 | transform: self.transformForOrientation(newSize), 56 | drawTransposed: drawTransposed, 57 | interpolationQuality: quality 58 | ) 59 | } 60 | 61 | public func resizedImageWithContentMode(_ contentMode: UIView.ContentMode, bounds: CGSize, interpolationQuality quality: CGInterpolationQuality) -> UIImage { 62 | let horizontalRatio = bounds.width / self.size.width 63 | let verticalRatio = bounds.height / self.size.height 64 | var ratio: CGFloat = 1 65 | 66 | switch(contentMode) { 67 | case .scaleAspectFill: 68 | ratio = max(horizontalRatio, verticalRatio) 69 | case .scaleAspectFit: 70 | ratio = min(horizontalRatio, verticalRatio) 71 | default: 72 | fatalError("Unsupported content mode \(contentMode)") 73 | } 74 | 75 | let newSize: CGSize = CGSize(width: self.size.width * ratio, height: self.size.height * ratio) 76 | return self.resizedImage(newSize, interpolationQuality: quality) 77 | } 78 | 79 | fileprivate func normalizeBitmapInfo(_ bI: CGBitmapInfo) -> UInt32 { 80 | var alphaInfo: UInt32 = bI.rawValue & CGBitmapInfo.alphaInfoMask.rawValue 81 | 82 | if alphaInfo == CGImageAlphaInfo.last.rawValue { 83 | alphaInfo = CGImageAlphaInfo.premultipliedLast.rawValue 84 | } 85 | 86 | if alphaInfo == CGImageAlphaInfo.first.rawValue { 87 | alphaInfo = CGImageAlphaInfo.premultipliedFirst.rawValue 88 | } 89 | 90 | var newBI: UInt32 = bI.rawValue & ~CGBitmapInfo.alphaInfoMask.rawValue; 91 | 92 | newBI |= alphaInfo; 93 | 94 | return newBI 95 | } 96 | 97 | fileprivate func resizedImage(_ newSize: CGSize, transform: CGAffineTransform, drawTransposed transpose: Bool, interpolationQuality quality: CGInterpolationQuality) -> UIImage { 98 | let newRect = CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height).integral 99 | let transposedRect = CGRect(x: 0, y: 0, width: newRect.size.height, height: newRect.size.width) 100 | let imageRef: CGImage = self.cgImage! 101 | 102 | // Build a context that's the same dimensions as the new size 103 | let bitmap: CGContext = CGContext( 104 | data: nil, 105 | width: Int(newRect.size.width), 106 | height: Int(newRect.size.height), 107 | bitsPerComponent: imageRef.bitsPerComponent, 108 | bytesPerRow: 0, 109 | space: imageRef.colorSpace!, 110 | bitmapInfo: normalizeBitmapInfo(imageRef.bitmapInfo) 111 | )! 112 | 113 | // Rotate and/or flip the image if required by its orientation 114 | bitmap.concatenate(transform) 115 | 116 | // Set the quality level to use when rescaling 117 | bitmap.interpolationQuality = quality 118 | 119 | // Draw into the context; this scales the image 120 | bitmap.draw(imageRef, in: transpose ? transposedRect: newRect) 121 | 122 | // Get the resized image from the context and a UIImage 123 | let newImageRef: CGImage = bitmap.makeImage()! 124 | return UIImage(cgImage: newImageRef) 125 | } 126 | 127 | fileprivate func transformForOrientation(_ newSize: CGSize) -> CGAffineTransform { 128 | var transform: CGAffineTransform = CGAffineTransform.identity 129 | 130 | switch (self.imageOrientation) { 131 | case .down, .downMirrored: 132 | // EXIF = 3 / 4 133 | transform = transform.translatedBy(x: newSize.width, y: newSize.height) 134 | transform = transform.rotated(by: .pi) 135 | case .left, .leftMirrored: 136 | // EXIF = 6 / 5 137 | transform = transform.translatedBy(x: newSize.width, y: 0) 138 | transform = transform.rotated(by: .pi / 2) 139 | case .right, .rightMirrored: 140 | // EXIF = 8 / 7 141 | transform = transform.translatedBy(x: 0, y: newSize.height) 142 | transform = transform.rotated(by: -.pi / 2) 143 | default: 144 | break 145 | } 146 | 147 | switch(self.imageOrientation) { 148 | case .upMirrored, .downMirrored: 149 | // EXIF = 2 / 4 150 | transform = transform.translatedBy(x: newSize.width, y: 0) 151 | transform = transform.scaledBy(x: -1, y: 1) 152 | case .leftMirrored, .rightMirrored: 153 | // EXIF = 5 / 7 154 | transform = transform.translatedBy(x: newSize.height, y: 0) 155 | transform = transform.scaledBy(x: -1, y: 1) 156 | default: 157 | break 158 | } 159 | 160 | return transform 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /Source/UIImage+RoundedCorner.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+RoundedCorner.swift 3 | // 4 | // Created by Trevor Harmon on 09/20/09. 5 | // Swift 3 port by Giacomo Boccardo on 09/15/2016. 6 | // 7 | // Free for personal or commercial use, with or without modification 8 | // No warranty is expressed or implied. 9 | // 10 | import UIKit 11 | 12 | public extension UIImage { 13 | 14 | // Creates a copy of this image with rounded corners 15 | // If borderSize is non-zero, a transparent border of the given size will also be added 16 | // Original author: Björn Sållarp. Used with permission. See: http://blog.sallarp.com/iphone-uiimage-round-corners/ 17 | public func roundedCornerImage(cornerSize:Int, borderSize:Int) -> UIImage 18 | { 19 | // If the image does not have an alpha layer, add one 20 | let image = self.imageWithAlpha() 21 | 22 | // Build a context that's the same dimensions as the new size 23 | let context: CGContext = CGContext( 24 | data: nil, 25 | width: Int(image.size.width), 26 | height: Int(image.size.height), 27 | bitsPerComponent: (image.cgImage)!.bitsPerComponent, 28 | bytesPerRow: 0, 29 | space: (image.cgImage)!.colorSpace!, 30 | bitmapInfo: (image.cgImage)!.bitmapInfo.rawValue 31 | )! 32 | 33 | // Create a clipping path with rounded corners 34 | context.beginPath() 35 | self.addRoundedRectToPath( 36 | CGRect( 37 | x: CGFloat(borderSize), 38 | y: CGFloat(borderSize), 39 | width: image.size.width - CGFloat(borderSize) * 2, 40 | height: image.size.height - CGFloat(borderSize) * 2), 41 | context:context, 42 | ovalWidth:CGFloat(cornerSize), 43 | ovalHeight:CGFloat(cornerSize) 44 | ) 45 | context.closePath() 46 | context.clip() 47 | 48 | // Draw the image to the context; the clipping path will make anything outside the rounded rect transparent 49 | context.draw(image.cgImage!, in: CGRect(x: 0, y: 0, width: image.size.width, height: image.size.height)) 50 | 51 | // Create a CGImage from the context 52 | let clippedImage: CGImage = context.makeImage()! 53 | 54 | // Create a UIImage from the CGImage 55 | return UIImage(cgImage: clippedImage) 56 | } 57 | 58 | // Adds a rectangular path to the given context and rounds its corners by the given extents 59 | // Original author: Björn Sållarp. Used with permission. See: http://blog.sallarp.com/iphone-uiimage-round-corners/ 60 | fileprivate func addRoundedRectToPath(_ rect: CGRect, context: CGContext, ovalWidth: CGFloat, ovalHeight: CGFloat) 61 | { 62 | if (ovalWidth == 0 || ovalHeight == 0) { 63 | context.addRect(rect) 64 | return 65 | } 66 | 67 | context.saveGState() 68 | context.translateBy(x: rect.minX, y: rect.minY) 69 | context.scaleBy(x: ovalWidth, y: ovalHeight) 70 | let fw = rect.width / ovalWidth 71 | let fh = rect.height / ovalHeight 72 | context.move(to: CGPoint(x: fw, y: fh/2)) 73 | context.addArc(tangent1End: CGPoint(x: fw, y: fh), tangent2End: CGPoint(x: fw/2, y: fh), radius: 1) 74 | context.addArc(tangent1End: CGPoint(x: 0, y: fh), tangent2End: CGPoint(x: 0, y: fh/2), radius: 1) 75 | context.addArc(tangent1End: CGPoint(x: 0, y: 0), tangent2End: CGPoint(x: fw/2, y: 0), radius: 1) 76 | context.addArc(tangent1End: CGPoint(x: fw, y: 0), tangent2End: CGPoint(x: fw, y: fh/2), radius: 1) 77 | 78 | context.closePath(); 79 | context.restoreGState() 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions.podspec: -------------------------------------------------------------------------------- 1 | 2 | Pod::Spec.new do |s| 3 | s.name = "UIImageSwiftExtensions" 4 | s.version = "4.2" 5 | s.summary = "A Swift 4 port of Trevor Harmon UIImage's extensions (http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/)" 6 | s.description = <<-DESC 7 | A Swift 4 port of Trevor Harmon UIImage's extensions (see: http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/). 8 | DESC 9 | s.homepage = "https://github.com/giacgbj/UIImageSwiftExtensions" 10 | 11 | s.license = 'MIT' 12 | s.author = { "Giacomo Boccardo" => "gboccard@gmail.com" } 13 | s.source = { :git => "https://github.com/giacgbj/UIImageSwiftExtensions.git", :tag => s.version.to_s } 14 | s.social_media_url = 'https://twitter.com/jhack' 15 | 16 | s.platform = :ios, '8.0' 17 | 18 | s.requires_arc = true 19 | 20 | s.source_files = 'Source/*.swift' 21 | end 22 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions.xcworkspace/xcuserdata/jhack.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/giacgbj/UIImageSwiftExtensions/a9807c0cb58636b6b5ced244f0105a7986bb98ef/UIImageSwiftExtensions.xcworkspace/xcuserdata/jhack.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /UIImageSwiftExtensions/UIImageSwiftExtensions.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 487F6EDB1D8B23A800AAE162 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 487F6EDA1D8B23A800AAE162 /* AppDelegate.swift */; }; 11 | 487F6EDD1D8B23A800AAE162 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 487F6EDC1D8B23A800AAE162 /* ViewController.swift */; }; 12 | 487F6EE01D8B23A800AAE162 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 487F6EDE1D8B23A800AAE162 /* Main.storyboard */; }; 13 | 487F6EE21D8B23A800AAE162 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 487F6EE11D8B23A800AAE162 /* Assets.xcassets */; }; 14 | 487F6EE51D8B23A800AAE162 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 487F6EE31D8B23A800AAE162 /* LaunchScreen.storyboard */; }; 15 | 487F6F151D8B247100AAE162 /* UIImage+Alpha.swift in Sources */ = {isa = PBXBuildFile; fileRef = 487F6F121D8B247100AAE162 /* UIImage+Alpha.swift */; }; 16 | 487F6F161D8B247100AAE162 /* UIImage+Resize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 487F6F131D8B247100AAE162 /* UIImage+Resize.swift */; }; 17 | 487F6F171D8B247100AAE162 /* UIImage+RoundedCorner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 487F6F141D8B247100AAE162 /* UIImage+RoundedCorner.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 487F6ED71D8B23A800AAE162 /* UIImageSwiftExtensions.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIImageSwiftExtensions.app; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 487F6EDA1D8B23A800AAE162 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 23 | 487F6EDC1D8B23A800AAE162 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 24 | 487F6EDF1D8B23A800AAE162 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 25 | 487F6EE11D8B23A800AAE162 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 26 | 487F6EE41D8B23A800AAE162 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 27 | 487F6EE61D8B23A800AAE162 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 28 | 487F6F121D8B247100AAE162 /* UIImage+Alpha.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+Alpha.swift"; sourceTree = ""; }; 29 | 487F6F131D8B247100AAE162 /* UIImage+Resize.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+Resize.swift"; sourceTree = ""; }; 30 | 487F6F141D8B247100AAE162 /* UIImage+RoundedCorner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+RoundedCorner.swift"; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 487F6ED41D8B23A800AAE162 /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 487F6ECE1D8B23A800AAE162 = { 45 | isa = PBXGroup; 46 | children = ( 47 | 487F6F111D8B247100AAE162 /* Source */, 48 | 487F6ED91D8B23A800AAE162 /* UIImageSwiftExtensions */, 49 | 487F6ED81D8B23A800AAE162 /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | 487F6ED81D8B23A800AAE162 /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 487F6ED71D8B23A800AAE162 /* UIImageSwiftExtensions.app */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | 487F6ED91D8B23A800AAE162 /* UIImageSwiftExtensions */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | 487F6EDA1D8B23A800AAE162 /* AppDelegate.swift */, 65 | 487F6EDC1D8B23A800AAE162 /* ViewController.swift */, 66 | 487F6EDE1D8B23A800AAE162 /* Main.storyboard */, 67 | 487F6EE11D8B23A800AAE162 /* Assets.xcassets */, 68 | 487F6EE31D8B23A800AAE162 /* LaunchScreen.storyboard */, 69 | 487F6EE61D8B23A800AAE162 /* Info.plist */, 70 | ); 71 | path = UIImageSwiftExtensions; 72 | sourceTree = ""; 73 | }; 74 | 487F6F111D8B247100AAE162 /* Source */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 487F6F121D8B247100AAE162 /* UIImage+Alpha.swift */, 78 | 487F6F131D8B247100AAE162 /* UIImage+Resize.swift */, 79 | 487F6F141D8B247100AAE162 /* UIImage+RoundedCorner.swift */, 80 | ); 81 | name = Source; 82 | path = ../Source; 83 | sourceTree = ""; 84 | }; 85 | /* End PBXGroup section */ 86 | 87 | /* Begin PBXNativeTarget section */ 88 | 487F6ED61D8B23A800AAE162 /* UIImageSwiftExtensions */ = { 89 | isa = PBXNativeTarget; 90 | buildConfigurationList = 487F6EFF1D8B23A800AAE162 /* Build configuration list for PBXNativeTarget "UIImageSwiftExtensions" */; 91 | buildPhases = ( 92 | 487F6ED31D8B23A800AAE162 /* Sources */, 93 | 487F6ED41D8B23A800AAE162 /* Frameworks */, 94 | 487F6ED51D8B23A800AAE162 /* Resources */, 95 | ); 96 | buildRules = ( 97 | ); 98 | dependencies = ( 99 | ); 100 | name = UIImageSwiftExtensions; 101 | productName = UIImageSwiftExtensions; 102 | productReference = 487F6ED71D8B23A800AAE162 /* UIImageSwiftExtensions.app */; 103 | productType = "com.apple.product-type.application"; 104 | }; 105 | /* End PBXNativeTarget section */ 106 | 107 | /* Begin PBXProject section */ 108 | 487F6ECF1D8B23A800AAE162 /* Project object */ = { 109 | isa = PBXProject; 110 | attributes = { 111 | LastSwiftUpdateCheck = 0800; 112 | LastUpgradeCheck = 1010; 113 | ORGANIZATIONNAME = "Giacomo Boccardo"; 114 | TargetAttributes = { 115 | 487F6ED61D8B23A800AAE162 = { 116 | CreatedOnToolsVersion = 8.0; 117 | LastSwiftMigration = 0900; 118 | ProvisioningStyle = Automatic; 119 | }; 120 | }; 121 | }; 122 | buildConfigurationList = 487F6ED21D8B23A800AAE162 /* Build configuration list for PBXProject "UIImageSwiftExtensions" */; 123 | compatibilityVersion = "Xcode 8.0"; 124 | developmentRegion = English; 125 | hasScannedForEncodings = 0; 126 | knownRegions = ( 127 | en, 128 | Base, 129 | ); 130 | mainGroup = 487F6ECE1D8B23A800AAE162; 131 | productRefGroup = 487F6ED81D8B23A800AAE162 /* Products */; 132 | projectDirPath = ""; 133 | projectRoot = ""; 134 | targets = ( 135 | 487F6ED61D8B23A800AAE162 /* UIImageSwiftExtensions */, 136 | ); 137 | }; 138 | /* End PBXProject section */ 139 | 140 | /* Begin PBXResourcesBuildPhase section */ 141 | 487F6ED51D8B23A800AAE162 /* Resources */ = { 142 | isa = PBXResourcesBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | 487F6EE51D8B23A800AAE162 /* LaunchScreen.storyboard in Resources */, 146 | 487F6EE21D8B23A800AAE162 /* Assets.xcassets in Resources */, 147 | 487F6EE01D8B23A800AAE162 /* Main.storyboard in Resources */, 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | }; 151 | /* End PBXResourcesBuildPhase section */ 152 | 153 | /* Begin PBXSourcesBuildPhase section */ 154 | 487F6ED31D8B23A800AAE162 /* Sources */ = { 155 | isa = PBXSourcesBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | 487F6F171D8B247100AAE162 /* UIImage+RoundedCorner.swift in Sources */, 159 | 487F6EDD1D8B23A800AAE162 /* ViewController.swift in Sources */, 160 | 487F6F161D8B247100AAE162 /* UIImage+Resize.swift in Sources */, 161 | 487F6F151D8B247100AAE162 /* UIImage+Alpha.swift in Sources */, 162 | 487F6EDB1D8B23A800AAE162 /* AppDelegate.swift in Sources */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXSourcesBuildPhase section */ 167 | 168 | /* Begin PBXVariantGroup section */ 169 | 487F6EDE1D8B23A800AAE162 /* Main.storyboard */ = { 170 | isa = PBXVariantGroup; 171 | children = ( 172 | 487F6EDF1D8B23A800AAE162 /* Base */, 173 | ); 174 | name = Main.storyboard; 175 | sourceTree = ""; 176 | }; 177 | 487F6EE31D8B23A800AAE162 /* LaunchScreen.storyboard */ = { 178 | isa = PBXVariantGroup; 179 | children = ( 180 | 487F6EE41D8B23A800AAE162 /* Base */, 181 | ); 182 | name = LaunchScreen.storyboard; 183 | sourceTree = ""; 184 | }; 185 | /* End PBXVariantGroup section */ 186 | 187 | /* Begin XCBuildConfiguration section */ 188 | 487F6EFD1D8B23A800AAE162 /* Debug */ = { 189 | isa = XCBuildConfiguration; 190 | buildSettings = { 191 | ALWAYS_SEARCH_USER_PATHS = NO; 192 | CLANG_ANALYZER_NONNULL = YES; 193 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 194 | CLANG_CXX_LIBRARY = "libc++"; 195 | CLANG_ENABLE_MODULES = YES; 196 | CLANG_ENABLE_OBJC_ARC = YES; 197 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 198 | CLANG_WARN_BOOL_CONVERSION = YES; 199 | CLANG_WARN_COMMA = YES; 200 | CLANG_WARN_CONSTANT_CONVERSION = YES; 201 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 202 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 203 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 204 | CLANG_WARN_EMPTY_BODY = YES; 205 | CLANG_WARN_ENUM_CONVERSION = YES; 206 | CLANG_WARN_INFINITE_RECURSION = YES; 207 | CLANG_WARN_INT_CONVERSION = YES; 208 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 209 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 210 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 211 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 212 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 213 | CLANG_WARN_STRICT_PROTOTYPES = YES; 214 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 215 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 216 | CLANG_WARN_UNREACHABLE_CODE = YES; 217 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 218 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 219 | COPY_PHASE_STRIP = NO; 220 | DEBUG_INFORMATION_FORMAT = dwarf; 221 | ENABLE_STRICT_OBJC_MSGSEND = YES; 222 | ENABLE_TESTABILITY = YES; 223 | GCC_C_LANGUAGE_STANDARD = gnu99; 224 | GCC_DYNAMIC_NO_PIC = NO; 225 | GCC_NO_COMMON_BLOCKS = YES; 226 | GCC_OPTIMIZATION_LEVEL = 0; 227 | GCC_PREPROCESSOR_DEFINITIONS = ( 228 | "DEBUG=1", 229 | "$(inherited)", 230 | ); 231 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 232 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 233 | GCC_WARN_UNDECLARED_SELECTOR = YES; 234 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 235 | GCC_WARN_UNUSED_FUNCTION = YES; 236 | GCC_WARN_UNUSED_VARIABLE = YES; 237 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 238 | MTL_ENABLE_DEBUG_INFO = YES; 239 | ONLY_ACTIVE_ARCH = YES; 240 | SDKROOT = iphoneos; 241 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 242 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 243 | SWIFT_VERSION = 4.2; 244 | TARGETED_DEVICE_FAMILY = "1,2"; 245 | }; 246 | name = Debug; 247 | }; 248 | 487F6EFE1D8B23A800AAE162 /* Release */ = { 249 | isa = XCBuildConfiguration; 250 | buildSettings = { 251 | ALWAYS_SEARCH_USER_PATHS = NO; 252 | CLANG_ANALYZER_NONNULL = YES; 253 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 254 | CLANG_CXX_LIBRARY = "libc++"; 255 | CLANG_ENABLE_MODULES = YES; 256 | CLANG_ENABLE_OBJC_ARC = YES; 257 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 258 | CLANG_WARN_BOOL_CONVERSION = YES; 259 | CLANG_WARN_COMMA = YES; 260 | CLANG_WARN_CONSTANT_CONVERSION = YES; 261 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 262 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 263 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 264 | CLANG_WARN_EMPTY_BODY = YES; 265 | CLANG_WARN_ENUM_CONVERSION = YES; 266 | CLANG_WARN_INFINITE_RECURSION = YES; 267 | CLANG_WARN_INT_CONVERSION = YES; 268 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 269 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 270 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 271 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 272 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 273 | CLANG_WARN_STRICT_PROTOTYPES = YES; 274 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 275 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 276 | CLANG_WARN_UNREACHABLE_CODE = YES; 277 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 278 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 279 | COPY_PHASE_STRIP = NO; 280 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 281 | ENABLE_NS_ASSERTIONS = NO; 282 | ENABLE_STRICT_OBJC_MSGSEND = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_NO_COMMON_BLOCKS = YES; 285 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 286 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 287 | GCC_WARN_UNDECLARED_SELECTOR = YES; 288 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 289 | GCC_WARN_UNUSED_FUNCTION = YES; 290 | GCC_WARN_UNUSED_VARIABLE = YES; 291 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 292 | MTL_ENABLE_DEBUG_INFO = NO; 293 | SDKROOT = iphoneos; 294 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 295 | SWIFT_VERSION = 4.2; 296 | TARGETED_DEVICE_FAMILY = "1,2"; 297 | VALIDATE_PRODUCT = YES; 298 | }; 299 | name = Release; 300 | }; 301 | 487F6F001D8B23A800AAE162 /* Debug */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 305 | INFOPLIST_FILE = UIImageSwiftExtensions/Info.plist; 306 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 307 | PRODUCT_BUNDLE_IDENTIFIER = J.UIImageSwiftExtensions; 308 | PRODUCT_NAME = "$(TARGET_NAME)"; 309 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 310 | }; 311 | name = Debug; 312 | }; 313 | 487F6F011D8B23A800AAE162 /* Release */ = { 314 | isa = XCBuildConfiguration; 315 | buildSettings = { 316 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 317 | INFOPLIST_FILE = UIImageSwiftExtensions/Info.plist; 318 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 319 | PRODUCT_BUNDLE_IDENTIFIER = J.UIImageSwiftExtensions; 320 | PRODUCT_NAME = "$(TARGET_NAME)"; 321 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 322 | }; 323 | name = Release; 324 | }; 325 | /* End XCBuildConfiguration section */ 326 | 327 | /* Begin XCConfigurationList section */ 328 | 487F6ED21D8B23A800AAE162 /* Build configuration list for PBXProject "UIImageSwiftExtensions" */ = { 329 | isa = XCConfigurationList; 330 | buildConfigurations = ( 331 | 487F6EFD1D8B23A800AAE162 /* Debug */, 332 | 487F6EFE1D8B23A800AAE162 /* Release */, 333 | ); 334 | defaultConfigurationIsVisible = 0; 335 | defaultConfigurationName = Release; 336 | }; 337 | 487F6EFF1D8B23A800AAE162 /* Build configuration list for PBXNativeTarget "UIImageSwiftExtensions" */ = { 338 | isa = XCConfigurationList; 339 | buildConfigurations = ( 340 | 487F6F001D8B23A800AAE162 /* Debug */, 341 | 487F6F011D8B23A800AAE162 /* Release */, 342 | ); 343 | defaultConfigurationIsVisible = 0; 344 | defaultConfigurationName = Release; 345 | }; 346 | /* End XCConfigurationList section */ 347 | }; 348 | rootObject = 487F6ECF1D8B23A800AAE162 /* Project object */; 349 | } 350 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions/UIImageSwiftExtensions.xcodeproj/xcshareddata/xcschemes/UIImageSwiftExtensions.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions/UIImageSwiftExtensions.xcodeproj/xcuserdata/jhack.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | UIImageSwiftExtensions.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 487F6ED61D8B23A800AAE162 16 | 17 | primary 18 | 19 | 20 | 487F6EEA1D8B23A800AAE162 21 | 22 | primary 23 | 24 | 25 | 487F6EF51D8B23A800AAE162 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions/UIImageSwiftExtensions/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // UIImageSwiftExtensions 4 | // 5 | // Created by Giacomo Boccardo on 15/09/16. 6 | // Copyright © 2016 Giacomo Boccardo. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions/UIImageSwiftExtensions/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /UIImageSwiftExtensions/UIImageSwiftExtensions/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions/UIImageSwiftExtensions/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions/UIImageSwiftExtensions/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 3.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /UIImageSwiftExtensions/UIImageSwiftExtensions/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // UIImageSwiftExtensions 4 | // 5 | // Created by Giacomo Boccardo on 15/09/16. 6 | // Copyright © 2016 Giacomo Boccardo. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | --------------------------------------------------------------------------------