diff --git a/.travis.yml b/.travis.yml index 04f3c1d..c754c36 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode11 +osx_image: xcode12 install: - bundle install diff --git a/CHANGELOG.md b/CHANGELOG.md index 33c459d..559d42d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,19 +8,22 @@ #### Fixed for any bug fixes. ``` -### 1.2.1 +### 1.2.4 +#### Added +- Xcode 12 support +### 1.2.1 #### Added - An ability to add borders - An ability to make the generated image circle ### 1.2.0 - -- Implemented builder pattern +#### Added +- Builder pattern #### Changed - `LAK` prefix renamed to `LK` ### 1.1.9 - -- Added Xcode 11 support \ No newline at end of file +#### Added +- Xcode 11 support \ No newline at end of file diff --git a/LetterAvatarKit.podspec b/LetterAvatarKit.podspec index c24f3a8..9d2f4f0 100644 --- a/LetterAvatarKit.podspec +++ b/LetterAvatarKit.podspec @@ -1,8 +1,8 @@ Pod::Spec.new do |spec| spec.name = 'LetterAvatarKit' - spec.ios.deployment_target = '8.0' + spec.ios.deployment_target = '9.0' spec.tvos.deployment_target = '9.0' - spec.version = '1.2.3' + spec.version = '1.2.4' spec.license = { :type => 'MIT' } spec.homepage = 'https://github.com/vpeschenkov/LetterAvatarKit' spec.authors = { 'Viktor Peschenkov' => 'v.peschenkov@gmail.com' } @@ -10,6 +10,6 @@ Pod::Spec.new do |spec| spec.source = { :git => 'https://github.com/vpeschenkov/LetterAvatarKit.git', :tag => spec.version.to_s } spec.source_files = 'LetterAvatarKit/*.{h,swift}', 'LetterAvatarKit/Extensions/*.{swift}' spec.requires_arc = true - spec.framework = 'Foundation', 'UIKit' + spec.framework = 'Foundation', 'UIKit', 'SwiftUI' spec.swift_version = '5.0' end diff --git a/LetterAvatarKit.xcodeproj/project.pbxproj b/LetterAvatarKit.xcodeproj/project.pbxproj index a481557..478ca75 100644 --- a/LetterAvatarKit.xcodeproj/project.pbxproj +++ b/LetterAvatarKit.xcodeproj/project.pbxproj @@ -497,9 +497,9 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = LetterAvatarKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 1.2.2; + MARKETING_VERSION = 1.2.4; PRODUCT_BUNDLE_IDENTIFIER = com.github.vpeschenkov.LetterAvatarKit; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; @@ -522,9 +522,9 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = LetterAvatarKit/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 1.2.2; + MARKETING_VERSION = 1.2.4; PRODUCT_BUNDLE_IDENTIFIER = com.github.vpeschenkov.LetterAvatarKit; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; diff --git a/LetterAvatarKitExample/LetterAvatarKitExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/LetterAvatarKitExample/LetterAvatarKitExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 0ee2c31..64fdc4e 100644 --- a/LetterAvatarKitExample/LetterAvatarKitExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/LetterAvatarKitExample/LetterAvatarKitExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/vpeschenkov/LetterAvatarKit", "state": { "branch": null, - "revision": "218b48b379ec40166b89a048faa62eaa8d206b70", - "version": "1.2.2" + "revision": "41f67ab75f428fee719b31a60cdc795d4b5caeb5", + "version": "1.2.3" } } ] diff --git a/LetterAvatarKitTests/Utilities/UIImage+Compare.swift b/LetterAvatarKitTests/Utilities/UIImage+Compare.swift index 8fd0bd8..e889add 100644 --- a/LetterAvatarKitTests/Utilities/UIImage+Compare.swift +++ b/LetterAvatarKitTests/Utilities/UIImage+Compare.swift @@ -45,9 +45,11 @@ extension UIImage { guard let image = object as? UIImage else { return false } - return compareImages(with: image, tolerance: 0.01) + return compareImages(with: image, tolerance: 0.1) } + // swiftlint:disable function_body_length + // swiftlint:disable cyclomatic_complexity open func compareImages(with image: UIImage?, tolerance: CGFloat) -> Bool { guard let image = image else { return false @@ -92,7 +94,7 @@ extension UIImage { guard let lhsData = lhs.dataProvider?.data, let rhsData = rhs.dataProvider?.data else { - return false + return false } if lhsData == rhsData { @@ -100,20 +102,22 @@ extension UIImage { } else { guard let lhsPixelsPointer: UnsafePointer = CFDataGetBytePtr(lhsData), let rhsPixelsPointer: UnsafePointer = CFDataGetBytePtr(rhsData) else { - return false + return false } var errorCount = 0 let numberOfPixels = Int(self.size.width * self.size.height * 4) - for i in stride(from: 0, to: numberOfPixels, by: 1) { - if lhsPixelsPointer[i] != rhsPixelsPointer[i] { - errorCount += 1 - let error = CGFloat(CGFloat(errorCount) / CGFloat(numberOfPixels)) - if error > tolerance { - return false - } + // swiftlint:disable line_length + for i in stride(from: 0, to: numberOfPixels, by: 1) where lhsPixelsPointer[i] != rhsPixelsPointer[i] { + errorCount += 1 + let error = CGFloat(CGFloat(errorCount) / CGFloat(numberOfPixels)) + if error > tolerance { + return false } } + // swiftlint:enable line_length return true } } + // swiftlint:enable cyclomatic_complexity + // swiftlint:enable function_body_length } diff --git a/README.md b/README.md index 7addf19..7307104 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,8 @@ `LetterAvatarKit` is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile: ```ruby -pod "LetterAvatarKit", "1.2.3" # Swift 5.0+ +pod "LetterAvatarKit", "1.2.4" # Swift 5.0+, Xcode 12 +pod "LetterAvatarKit", "1.2.3" # Swift 5.0+, Xcode 11 pod "LetterAvatarKit", "1.1.7" # Swift 4.2 pod "LetterAvatarKit", "1.1.5" # Swift 4.0 ``` @@ -37,7 +38,8 @@ pod "LetterAvatarKit", "1.1.5" # Swift 4.0 Add this to `Cartfile` ```ruby -github "vpeschenkov/LetterAvatarKit" == 1.2.3 # Swift 5.0+ +github "vpeschenkov/LetterAvatarKit" == 1.2.4 # Swift 5.0+, Xcode 12 +github "vpeschenkov/LetterAvatarKit" == 1.2.3 # Swift 5.0+, Xcode 11 github "vpeschenkov/LetterAvatarKit" == 1.1.7 # Swift 4.2 github "vpeschenkov/LetterAvatarKit" == 1.1.5 # Swift 4.0 ```