From 1ca215dd4eb648d588e747bd03a7bc2f2a30731e Mon Sep 17 00:00:00 2001 From: tokorom Date: Tue, 3 Oct 2017 17:30:18 +0900 Subject: [PATCH 1/2] Siwft 4.0 compatibility --- Demo/AppDelegate.swift | 2 +- .../project.pbxproj | 38 +++++++++++++++---- .../xcshareddata/xcschemes/Demo.xcscheme | 4 +- .../xcschemes/HasAssociatedObjects.xcscheme | 4 +- 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/Demo/AppDelegate.swift b/Demo/AppDelegate.swift index 4e9275b..25daf6f 100644 --- a/Demo/AppDelegate.swift +++ b/Demo/AppDelegate.swift @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + private func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after application launch. return true } diff --git a/HasAssociatedObjects.xcodeproj/project.pbxproj b/HasAssociatedObjects.xcodeproj/project.pbxproj index 8a32411..3d7c166 100644 --- a/HasAssociatedObjects.xcodeproj/project.pbxproj +++ b/HasAssociatedObjects.xcodeproj/project.pbxproj @@ -223,14 +223,16 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = tokoro; TargetAttributes = { F3797EFE1BED99630040E69D = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0900; }; F3797F081BED99640040E69D = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0900; }; F3797F1E1BEEE5230040E69D = { CreatedOnToolsVersion = 7.1; @@ -353,13 +355,21 @@ 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_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_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; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -401,13 +411,21 @@ 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_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_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; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -439,6 +457,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -451,7 +470,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -460,6 +480,7 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CLANG_ENABLE_MODULES = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -472,7 +493,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -484,7 +506,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = me.tokoro.HasAssociatedObjectsTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -497,7 +520,8 @@ PRODUCT_BUNDLE_IDENTIFIER = me.tokoro.HasAssociatedObjectsTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -510,7 +534,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = me.tokoro.Demo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -524,7 +548,7 @@ PRODUCT_BUNDLE_IDENTIFIER = me.tokoro.Demo; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/HasAssociatedObjects.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme b/HasAssociatedObjects.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme index 174697f..2be9330 100644 --- a/HasAssociatedObjects.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme +++ b/HasAssociatedObjects.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme @@ -1,6 +1,6 @@ @@ -45,6 +46,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/HasAssociatedObjects.xcodeproj/xcshareddata/xcschemes/HasAssociatedObjects.xcscheme b/HasAssociatedObjects.xcodeproj/xcshareddata/xcschemes/HasAssociatedObjects.xcscheme index 0ef4936..9557dfe 100644 --- a/HasAssociatedObjects.xcodeproj/xcshareddata/xcschemes/HasAssociatedObjects.xcscheme +++ b/HasAssociatedObjects.xcodeproj/xcshareddata/xcschemes/HasAssociatedObjects.xcscheme @@ -1,6 +1,6 @@ Date: Tue, 3 Oct 2017 17:31:20 +0900 Subject: [PATCH 2/2] Update podspec --- HasAssociatedObjects.podspec | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HasAssociatedObjects.podspec b/HasAssociatedObjects.podspec index 99d2cd0..f2ff4ef 100644 --- a/HasAssociatedObjects.podspec +++ b/HasAssociatedObjects.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "HasAssociatedObjects" - s.version = "1.0.1" + s.version = "2.0.0" s.summary = "We can add some stored objects to Swift extension" s.homepage = "https://github.com/tokorom/HasAssociatedObjects" diff --git a/README.md b/README.md index 5b7fb58..54f8f22 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # HasAssociatedObjects ================== -[![Swift Version](https://img.shields.io/badge/Swift-3.0-orange.svg?style=flat)](https://developer.apple.com/swift/) +[![Swift Version](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)](https://developer.apple.com/swift/) [![License](https://img.shields.io/cocoapods/l/HasAssociatedObjects.svg?style=flat)](https://github.com/tokorom/HasAssociatedObjects/blob/master/LICENSE) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/HasAssociatedObjects.svg?style=flat)](https://cocoapods.org/) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)