From 612e3997cce08772695bebe07e77b8708f78673c Mon Sep 17 00:00:00 2001 From: AmrAngry Date: Mon, 15 Apr 2019 09:46:46 +0400 Subject: [PATCH 1/6] enable static analyzer check for missing localizbility for project config --- .../FSPagerViewExample.xcodeproj/project.pbxproj | 5 ++++- .../xcshareddata/xcschemes/FSPagerView.xcscheme | 2 +- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 FSPagerViewExamples.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/FSPageViewExample-Swift/FSPagerViewExample.xcodeproj/project.pbxproj b/FSPageViewExample-Swift/FSPagerViewExample.xcodeproj/project.pbxproj index 523c669..224e7b9 100644 --- a/FSPageViewExample-Swift/FSPagerViewExample.xcodeproj/project.pbxproj +++ b/FSPageViewExample-Swift/FSPagerViewExample.xcodeproj/project.pbxproj @@ -221,7 +221,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Wenchao Ding"; TargetAttributes = { F97C96761E1FDE25002D9E7E = { @@ -244,6 +244,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -348,6 +349,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -406,6 +408,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; diff --git a/FSPagerView/FSPagerView.xcodeproj/xcshareddata/xcschemes/FSPagerView.xcscheme b/FSPagerView/FSPagerView.xcodeproj/xcshareddata/xcschemes/FSPagerView.xcscheme index 717b691..c6eefba 100644 --- a/FSPagerView/FSPagerView.xcodeproj/xcshareddata/xcschemes/FSPagerView.xcscheme +++ b/FSPagerView/FSPagerView.xcodeproj/xcshareddata/xcschemes/FSPagerView.xcscheme @@ -1,6 +1,6 @@ + + + + IDEDidComputeMac32BitWarning + + + From 4af13b04b58c756b7f18813ab6298126c3eebaa6 Mon Sep 17 00:00:00 2001 From: AmrAngry Date: Mon, 15 Apr 2019 09:48:37 +0400 Subject: [PATCH 2/6] Migrate for ensuring that all localized file goes to en.Iproj not English.Iproj --- .../FSPagerViewExample.xcodeproj/project.pbxproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/FSPageViewExample-Swift/FSPagerViewExample.xcodeproj/project.pbxproj b/FSPageViewExample-Swift/FSPagerViewExample.xcodeproj/project.pbxproj index 224e7b9..67776f9 100644 --- a/FSPageViewExample-Swift/FSPagerViewExample.xcodeproj/project.pbxproj +++ b/FSPageViewExample-Swift/FSPagerViewExample.xcodeproj/project.pbxproj @@ -241,10 +241,9 @@ }; buildConfigurationList = F97C96721E1FDE25002D9E7E /* Build configuration list for PBXProject "FSPagerViewExample" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, Base, ); From 2112c1815ee2409f34c83f011fe5acc198bd76a4 Mon Sep 17 00:00:00 2001 From: AmrAngry Date: Mon, 15 Apr 2019 09:50:01 +0400 Subject: [PATCH 3/6] enable static analyzer check for missing localizbility for project configuration --- FSPagerView/FSPagerView.xcodeproj/project.pbxproj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FSPagerView/FSPagerView.xcodeproj/project.pbxproj b/FSPagerView/FSPagerView.xcodeproj/project.pbxproj index 0fc531c..35de461 100644 --- a/FSPagerView/FSPagerView.xcodeproj/project.pbxproj +++ b/FSPagerView/FSPagerView.xcodeproj/project.pbxproj @@ -127,7 +127,7 @@ F9580B6D1E5D9F0600C5B267 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Wenchao Ding"; TargetAttributes = { F9580B751E5D9F0600C5B267 = { @@ -143,6 +143,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = F9580B6C1E5D9F0600C5B267; @@ -188,6 +189,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -250,6 +252,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; From 7771f34a9495901d31c8566f907ad4edfa5f65b9 Mon Sep 17 00:00:00 2001 From: AmrAngry Date: Mon, 15 Apr 2019 09:51:10 +0400 Subject: [PATCH 4/6] enable static analyzer check for missing localizbility for project configuration Migrate for ensuring that all localized file goes to en.Iproj not English.Iproj --- FSPagerView/FSPagerView.xcodeproj/project.pbxproj | 4 ++-- .../FSPagerViewExample-Objc.xcodeproj/project.pbxproj | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/FSPagerView/FSPagerView.xcodeproj/project.pbxproj b/FSPagerView/FSPagerView.xcodeproj/project.pbxproj index 35de461..403aa17 100644 --- a/FSPagerView/FSPagerView.xcodeproj/project.pbxproj +++ b/FSPagerView/FSPagerView.xcodeproj/project.pbxproj @@ -140,11 +140,11 @@ }; buildConfigurationList = F9580B701E5D9F0600C5B267 /* Build configuration list for PBXProject "FSPagerView" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, + Base, ); mainGroup = F9580B6C1E5D9F0600C5B267; productRefGroup = F9580B771E5D9F0600C5B267 /* Products */; diff --git a/FSPagerViewExample-Objc/FSPagerViewExample-Objc.xcodeproj/project.pbxproj b/FSPagerViewExample-Objc/FSPagerViewExample-Objc.xcodeproj/project.pbxproj index bc8c84b..30a978f 100644 --- a/FSPagerViewExample-Objc/FSPagerViewExample-Objc.xcodeproj/project.pbxproj +++ b/FSPagerViewExample-Objc/FSPagerViewExample-Objc.xcodeproj/project.pbxproj @@ -256,7 +256,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0940; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Wenchao Ding"; TargetAttributes = { F9C694481E40C6C1007084B6 = { @@ -276,7 +276,7 @@ }; buildConfigurationList = F9EC37141E304A830022B6D6 /* Build configuration list for PBXProject "FSPagerViewExample-Objc" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -419,6 +419,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; @@ -476,6 +477,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; From 759cf71c417d1ccc6841906ae6141ac03e12570e Mon Sep 17 00:00:00 2001 From: AmrAngry Date: Mon, 15 Apr 2019 09:51:55 +0400 Subject: [PATCH 5/6] Updated for swift 5 --- FSPagerView/FSPagerView.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FSPagerView/FSPagerView.xcodeproj/project.pbxproj b/FSPagerView/FSPagerView.xcodeproj/project.pbxproj index 403aa17..76d50af 100644 --- a/FSPagerView/FSPagerView.xcodeproj/project.pbxproj +++ b/FSPagerView/FSPagerView.xcodeproj/project.pbxproj @@ -133,7 +133,7 @@ F9580B751E5D9F0600C5B267 = { CreatedOnToolsVersion = 8.2.1; DevelopmentTeam = HZF422TY46; - LastSwiftMigration = 1000; + LastSwiftMigration = 1020; ProvisioningStyle = Automatic; }; }; @@ -322,7 +322,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -343,7 +343,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.wenchaod.FSPagerView; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; }; name = Release; }; From d4600c7f98e161ef470cc9fab8d9163f43828987 Mon Sep 17 00:00:00 2001 From: AmrAngry Date: Mon, 15 Apr 2019 09:52:20 +0400 Subject: [PATCH 6/6] syntax change to match swift 5 --- Sources/FSPageControl.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/FSPageControl.swift b/Sources/FSPageControl.swift index e7dc1c7..c1efc8a 100644 --- a/Sources/FSPageControl.swift +++ b/Sources/FSPageControl.swift @@ -240,7 +240,7 @@ open class FSPageControl: UIControl { } fileprivate func updateIndicatorAttributes(for layer: CAShapeLayer) { - let index = self.indicatorLayers.index(of: layer) + let index = self.indicatorLayers.firstIndex(of: layer) let state: UIControl.State = index == self.currentPage ? .selected : .normal if let image = self.images[state] { layer.strokeColor = nil