diff --git a/Example.xcodeproj/project.pbxproj b/Example.xcodeproj/project.pbxproj index 042dddb..aaa5890 100644 --- a/Example.xcodeproj/project.pbxproj +++ b/Example.xcodeproj/project.pbxproj @@ -265,7 +265,7 @@ attributes = { LastSwiftMigration = 0700; LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Alexander Schuch"; TargetAttributes = { 4D248F061A751C3700E44E6B = { @@ -285,7 +285,7 @@ }; buildConfigurationList = 4D248F021A751C3700E44E6B /* Build configuration list for PBXProject "Example" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -403,18 +403,27 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -450,18 +459,27 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -491,11 +509,11 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Example/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.aschuch.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0.1; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -504,11 +522,11 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = Example/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.aschuch.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0.1; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -528,13 +546,13 @@ ); INFOPLIST_FILE = QRCode/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.aschuch.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0.1; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -553,12 +571,12 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = QRCode/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.aschuch.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0.1; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; diff --git a/Example.xcodeproj/xcshareddata/xcschemes/QRCode.xcscheme b/Example.xcodeproj/xcshareddata/xcschemes/QRCode.xcscheme index 820d857..4f96c65 100644 --- a/Example.xcodeproj/xcshareddata/xcschemes/QRCode.xcscheme +++ b/Example.xcodeproj/xcshareddata/xcschemes/QRCode.xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES" + shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/Example.xcodeproj/xcshareddata/xcschemes/QRCodeTests.xcscheme b/Example.xcodeproj/xcshareddata/xcschemes/QRCodeTests.xcscheme index 44264cb..52b4e53 100644 --- a/Example.xcodeproj/xcshareddata/xcschemes/QRCodeTests.xcscheme +++ b/Example.xcodeproj/xcshareddata/xcschemes/QRCodeTests.xcscheme @@ -1,6 +1,6 @@ - - - - diff --git a/Example/AppDelegate.swift b/Example/AppDelegate.swift index 6d11608..891c29d 100644 --- a/Example/AppDelegate.swift +++ b/Example/AppDelegate.swift @@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { // Override point for customization after application launch. return true } diff --git a/QRCode/CIColorExtension.swift b/QRCode/CIColorExtension.swift index 40b4435..50d959d 100644 --- a/QRCode/CIColorExtension.swift +++ b/QRCode/CIColorExtension.swift @@ -19,7 +19,7 @@ public extension CIColor { /// `aabbccff` /// /// - parameter rgba: The hex string to parse in rgba format - public convenience init(rgba: String) { + convenience init(rgba: String) { var r: CGFloat = 0.0 var g: CGFloat = 0.0 var b: CGFloat = 0.0 @@ -29,7 +29,7 @@ public extension CIColor { var hexValue: CUnsignedLongLong = 0 if scanner.scanHexInt64(&hexValue) { - let length = rgba.characters.count + let length = rgba.count switch (length) { case 3: diff --git a/QRCode/CIImageExtension.swift b/QRCode/CIImageExtension.swift index f096069..2366ccc 100644 --- a/QRCode/CIImageExtension.swift +++ b/QRCode/CIImageExtension.swift @@ -17,7 +17,7 @@ internal extension CIImage { /// - parameter withScale: a given scale using to resize the result image /// /// - returns: an non-interpolated UIImage - internal func nonInterpolatedImage(withScale scale: Scale = Scale(dx: 1, dy: 1)) -> UIImage? { + func nonInterpolatedImage(withScale scale: Scale = Scale(dx: 1, dy: 1)) -> UIImage? { guard let cgImage = CIContext(options: nil).createCGImage(self, from: self.extent) else { return nil } let size = CGSize(width: self.extent.size.width * scale.dx, height: self.extent.size.height * scale.dy) diff --git a/QRCode/UIImageViewExtension.swift b/QRCode/UIImageViewExtension.swift index 789175d..37fb4fb 100644 --- a/QRCode/UIImageViewExtension.swift +++ b/QRCode/UIImageViewExtension.swift @@ -13,7 +13,7 @@ public extension UIImageView { /// Creates a new image view with the given QRCode /// /// - parameter qrCode: The QRCode to display in the image view - public convenience init(qrCode: QRCode) { + convenience init(qrCode: QRCode) { self.init(image: qrCode.image) }