From b22a605285836fb02203e4ac4ce2088e07c8d839 Mon Sep 17 00:00:00 2001 From: weak Date: Thu, 19 Sep 2019 10:23:37 +0200 Subject: [PATCH 1/2] update projects to recommended settings --- Armchair.xcodeproj/project.pbxproj | 7 ++++-- .../xcshareddata/xcschemes/Armchair.xcscheme | 24 ++++++++----------- .../xcschemes/ArmchairMac.xcscheme | 6 +---- .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++++++ .../LaunchScreen.storyboard | 0 .../{en.lproj => Base.lproj}/Main.storyboard | 0 Mac Example.xcodeproj/project.pbxproj | 8 +++++-- iOS Example.xcodeproj/project.pbxproj | 15 +++++++----- 8 files changed, 39 insertions(+), 29 deletions(-) create mode 100644 Armchair.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename Example/{en.lproj => Base.lproj}/LaunchScreen.storyboard (100%) rename Example/{en.lproj => Base.lproj}/Main.storyboard (100%) diff --git a/Armchair.xcodeproj/project.pbxproj b/Armchair.xcodeproj/project.pbxproj index ebcaa1c..865dd1c 100644 --- a/Armchair.xcodeproj/project.pbxproj +++ b/Armchair.xcodeproj/project.pbxproj @@ -318,7 +318,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = Armchair; TargetAttributes = { E6A0AF6419C9CFF400C3A7DC = { @@ -336,10 +336,11 @@ }; buildConfigurationList = F8111E2D19A95C8B0040E7D1 /* Build configuration list for PBXProject "Armchair" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = F8111E2919A95C8B0040E7D1; productRefGroup = F8111E2919A95C8B0040E7D1; @@ -618,6 +619,7 @@ 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; @@ -679,6 +681,7 @@ 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; diff --git a/Armchair.xcodeproj/xcshareddata/xcschemes/Armchair.xcscheme b/Armchair.xcodeproj/xcshareddata/xcschemes/Armchair.xcscheme index fd70c11..bc9d804 100644 --- a/Armchair.xcodeproj/xcshareddata/xcschemes/Armchair.xcscheme +++ b/Armchair.xcodeproj/xcshareddata/xcschemes/Armchair.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -39,17 +48,6 @@ - - - - - - - - - - - - + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/en.lproj/LaunchScreen.storyboard b/Example/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from Example/en.lproj/LaunchScreen.storyboard rename to Example/Base.lproj/LaunchScreen.storyboard diff --git a/Example/en.lproj/Main.storyboard b/Example/Base.lproj/Main.storyboard similarity index 100% rename from Example/en.lproj/Main.storyboard rename to Example/Base.lproj/Main.storyboard diff --git a/Mac Example.xcodeproj/project.pbxproj b/Mac Example.xcodeproj/project.pbxproj index af88d1d..f92f9ed 100644 --- a/Mac Example.xcodeproj/project.pbxproj +++ b/Mac Example.xcodeproj/project.pbxproj @@ -161,7 +161,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = Armchair; TargetAttributes = { E60FA7B919C908FE00179D70 = { @@ -171,7 +171,7 @@ }; buildConfigurationList = E60FA7B519C908FE00179D70 /* Build configuration list for PBXProject "Mac Example" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -281,6 +281,7 @@ 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; @@ -336,6 +337,7 @@ 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; @@ -384,6 +386,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = "Example/Info-Mac.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; @@ -396,6 +399,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; INFOPLIST_FILE = "Example/Info-Mac.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; diff --git a/iOS Example.xcodeproj/project.pbxproj b/iOS Example.xcodeproj/project.pbxproj index 31241de..f6fdbe2 100644 --- a/iOS Example.xcodeproj/project.pbxproj +++ b/iOS Example.xcodeproj/project.pbxproj @@ -87,9 +87,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 939461E32333725B00C8A00E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 939461E42333725B00C8A00E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; E60FA81719C9219600179D70 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; - E66F854919D0A7C600AD80EC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - E6A0AF5D19C9C89E00C3A7DC /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/Main.storyboard; sourceTree = ""; }; E6C49DC519C23C91006A4544 /* iOS Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Example.app"; sourceTree = BUILT_PRODUCTS_DIR; }; E6E5F4C219C8E18E008A6C1B /* armchair.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = armchair.jpg; sourceTree = ""; }; E6E5F4CC19C8E388008A6C1B /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; @@ -188,7 +188,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = Armchair; TargetAttributes = { F8111E0419A951050040E7D1 = { @@ -200,10 +200,11 @@ }; buildConfigurationList = F8111E0019A951050040E7D1 /* Build configuration list for PBXProject "iOS Example" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = F8111DFC19A951050040E7D1; productRefGroup = F8111DFC19A951050040E7D1; @@ -303,7 +304,7 @@ E66F854819D0A7C600AD80EC /* LaunchScreen.storyboard */ = { isa = PBXVariantGroup; children = ( - E66F854919D0A7C600AD80EC /* en */, + 939461E42333725B00C8A00E /* Base */, ); name = LaunchScreen.storyboard; sourceTree = ""; @@ -311,7 +312,7 @@ F8111E1019A951050040E7D1 /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( - E6A0AF5D19C9C89E00C3A7DC /* en */, + 939461E32333725B00C8A00E /* Base */, ); name = Main.storyboard; sourceTree = ""; @@ -323,6 +324,7 @@ 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; @@ -379,6 +381,7 @@ 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; From 51eca2a9311b5862f9cf50ac24c8b52adbbe0687 Mon Sep 17 00:00:00 2001 From: weak Date: Thu, 19 Sep 2019 10:47:04 +0200 Subject: [PATCH 2/2] Conversion to Swift 5 - convert all targets to Swift 5 - bump .swift-version - update podspec - fix warnings --- .swift-version | 2 +- Armchair.podspec | 4 +-- Armchair.xcodeproj/project.pbxproj | 12 ++++---- Example/AppDelegate.swift | 2 +- .../AppIcon.appiconset/Contents.json | 30 +++++++++++++++++++ Mac Example.xcodeproj/project.pbxproj | 3 ++ Source/Armchair.swift | 4 +-- iOS Example.xcodeproj/project.pbxproj | 8 ++--- 8 files changed, 48 insertions(+), 17 deletions(-) diff --git a/.swift-version b/.swift-version index bf77d54..819e07a 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -4.2 +5.0 diff --git a/Armchair.podspec b/Armchair.podspec index 45a4845..917735e 100644 --- a/Armchair.podspec +++ b/Armchair.podspec @@ -22,12 +22,12 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/UrbanApps/Armchair.git', :tag => s.version } s.license = { :type => "MIT", :file => "LICENSE" } - + s.source_files = "Source/*.{h,swift}" s.resources = "Localization/*.lproj" s.ios.deployment_target = '8.0' s.osx.deployment_target = '10.10' s.requires_arc = true - s.swift_version = '4.2' + s.swift_version = '5.0' end diff --git a/Armchair.xcodeproj/project.pbxproj b/Armchair.xcodeproj/project.pbxproj index 865dd1c..2b95a52 100644 --- a/Armchair.xcodeproj/project.pbxproj +++ b/Armchair.xcodeproj/project.pbxproj @@ -326,11 +326,11 @@ ProvisioningStyle = Manual; }; E6D8B8EF19C756A4001AD043 = { - LastSwiftMigration = 0900; + LastSwiftMigration = 1100; }; F8111E3219A95C8B0040E7D1 = { CreatedOnToolsVersion = 6.0; - LastSwiftMigration = 0800; + LastSwiftMigration = 1100; }; }; }; @@ -546,7 +546,7 @@ SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -572,7 +572,7 @@ SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -750,7 +750,7 @@ SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -772,7 +772,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OBJC_BRIDGING_HEADER = ""; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Example/AppDelegate.swift b/Example/AppDelegate.swift index c03e5a8..841564c 100644 --- a/Example/AppDelegate.swift +++ b/Example/AppDelegate.swift @@ -28,7 +28,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { + func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { AppDelegate.setupArmchair() return true } diff --git a/Example/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/Images.xcassets/AppIcon.appiconset/Contents.json index 36d2c80..d8db8d6 100644 --- a/Example/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", @@ -30,6 +40,16 @@ "size" : "60x60", "scale" : "3x" }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, { "idiom" : "ipad", "size" : "29x29", @@ -59,6 +79,16 @@ "idiom" : "ipad", "size" : "76x76", "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/Mac Example.xcodeproj/project.pbxproj b/Mac Example.xcodeproj/project.pbxproj index f92f9ed..acd8401 100644 --- a/Mac Example.xcodeproj/project.pbxproj +++ b/Mac Example.xcodeproj/project.pbxproj @@ -166,6 +166,7 @@ TargetAttributes = { E60FA7B919C908FE00179D70 = { CreatedOnToolsVersion = 6.1; + LastSwiftMigration = 1100; }; }; }; @@ -392,6 +393,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -405,6 +407,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Source/Armchair.swift b/Source/Armchair.swift index e04aaa4..5ce117c 100644 --- a/Source/Armchair.swift +++ b/Source/Armchair.swift @@ -1723,11 +1723,11 @@ open class Manager : ArmchairManager { private static func getRootViewController() -> UIViewController? { if var window = UIApplication.shared.keyWindow { - if window.windowLevel != .normal { + if window.windowLevel != UIWindow.Level.normal { let windows: NSArray = UIApplication.shared.windows as NSArray for candidateWindow in windows { if let candidateWindow = candidateWindow as? UIWindow { - if candidateWindow.windowLevel == .normal { + if candidateWindow.windowLevel == UIWindow.Level.normal { window = candidateWindow break } diff --git a/iOS Example.xcodeproj/project.pbxproj b/iOS Example.xcodeproj/project.pbxproj index f6fdbe2..878132d 100644 --- a/iOS Example.xcodeproj/project.pbxproj +++ b/iOS Example.xcodeproj/project.pbxproj @@ -194,7 +194,7 @@ F8111E0419A951050040E7D1 = { CreatedOnToolsVersion = 6.0; DevelopmentTeam = 9H3S97RP4K; - LastSwiftMigration = 0830; + LastSwiftMigration = 1100; }; }; }; @@ -432,7 +432,6 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; @@ -443,7 +442,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "iOS Example"; PROVISIONING_PROFILE = ""; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -452,7 +451,6 @@ buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = "$(SRCROOT)/Example/Info-iOS.plist"; @@ -461,7 +459,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.armchair.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "iOS Example"; PROVISIONING_PROFILE = ""; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; }; name = Release; };