Skip to content

Commit f1ed645

Browse files
authored
Swift 5 migration (ninjaprox#274)
1 parent 209132c commit f1ed645

File tree

11 files changed

+131
-34
lines changed

11 files changed

+131
-34
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ env:
55
- SCHEME=NVActivityIndicatorViewTests
66
matrix:
77
include:
8-
- osx_image: xcode10
9-
env: SDK="iphonesimulator12.0" DESTINATION="name=iPhone 6s,OS=12.0"
8+
- osx_image: xcode10.2
9+
env: SDK="iphonesimulator12.2" DESTINATION="name=iPhone 6s,OS=12.2"
1010
script:
1111
- set -o pipefail
1212
- pod install --project-directory=Example

Example/NVActivityIndicatorViewExample.xcodeproj/project.pbxproj

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,12 @@
193193
TargetAttributes = {
194194
1F0326F81F0D28CC00BF3358 = {
195195
CreatedOnToolsVersion = 8.3;
196-
LastSwiftMigration = 0900;
196+
LastSwiftMigration = 1020;
197197
ProvisioningStyle = Manual;
198198
};
199199
1F0327281F0D399E00BF3358 = {
200200
CreatedOnToolsVersion = 8.3;
201-
LastSwiftMigration = 0900;
201+
LastSwiftMigration = 1020;
202202
ProvisioningStyle = Manual;
203203
TestTargetID = 1F0326F81F0D28CC00BF3358;
204204
};
@@ -209,6 +209,7 @@
209209
developmentRegion = English;
210210
hasScannedForEncodings = 0;
211211
knownRegions = (
212+
English,
212213
en,
213214
Base,
214215
);
@@ -424,7 +425,7 @@
424425
SDKROOT = iphoneos;
425426
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
426427
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
427-
SWIFT_VERSION = 4.2;
428+
SWIFT_VERSION = 5.0;
428429
};
429430
name = Debug;
430431
};
@@ -475,7 +476,7 @@
475476
MTL_ENABLE_DEBUG_INFO = NO;
476477
SDKROOT = iphoneos;
477478
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
478-
SWIFT_VERSION = 4.2;
479+
SWIFT_VERSION = 5.0;
479480
VALIDATE_PRODUCT = YES;
480481
};
481482
name = Release;
@@ -491,8 +492,7 @@
491492
PRODUCT_BUNDLE_IDENTIFIER = me.vinhis.NVActivityIndicatorViewExample;
492493
PRODUCT_NAME = "$(TARGET_NAME)";
493494
PROVISIONING_PROFILE_SPECIFIER = "";
494-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
495-
SWIFT_VERSION = 4.2;
495+
SWIFT_VERSION = 5.0;
496496
};
497497
name = Debug;
498498
};
@@ -507,8 +507,7 @@
507507
PRODUCT_BUNDLE_IDENTIFIER = me.vinhis.NVActivityIndicatorViewExample;
508508
PRODUCT_NAME = "$(TARGET_NAME)";
509509
PROVISIONING_PROFILE_SPECIFIER = "";
510-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
511-
SWIFT_VERSION = 4.2;
510+
SWIFT_VERSION = 5.0;
512511
};
513512
name = Release;
514513
};
@@ -526,8 +525,7 @@
526525
PRODUCT_NAME = "$(TARGET_NAME)";
527526
PROVISIONING_PROFILE_SPECIFIER = "";
528527
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
529-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
530-
SWIFT_VERSION = 4.2;
528+
SWIFT_VERSION = 5.0;
531529
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NVActivityIndicatorViewExample.app/NVActivityIndicatorViewExample";
532530
};
533531
name = Debug;
@@ -545,8 +543,7 @@
545543
PRODUCT_BUNDLE_IDENTIFIER = me.vinhis.NVActivityIndicatorViewTests;
546544
PRODUCT_NAME = "$(TARGET_NAME)";
547545
PROVISIONING_PROFILE_SPECIFIER = "";
548-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
549-
SWIFT_VERSION = 4.2;
546+
SWIFT_VERSION = 5.0;
550547
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NVActivityIndicatorViewExample.app/NVActivityIndicatorViewExample";
551548
};
552549
name = Release;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1020"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "1F0326F81F0D28CC00BF3358"
18+
BuildableName = "NVActivityIndicatorViewExample.app"
19+
BlueprintName = "NVActivityIndicatorViewExample"
20+
ReferencedContainer = "container:NVActivityIndicatorViewExample.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
</BuildActionEntries>
24+
</BuildAction>
25+
<TestAction
26+
buildConfiguration = "Debug"
27+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<Testables>
31+
</Testables>
32+
<MacroExpansion>
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "1F0326F81F0D28CC00BF3358"
36+
BuildableName = "NVActivityIndicatorViewExample.app"
37+
BlueprintName = "NVActivityIndicatorViewExample"
38+
ReferencedContainer = "container:NVActivityIndicatorViewExample.xcodeproj">
39+
</BuildableReference>
40+
</MacroExpansion>
41+
<AdditionalOptions>
42+
</AdditionalOptions>
43+
</TestAction>
44+
<LaunchAction
45+
buildConfiguration = "Debug"
46+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
47+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48+
launchStyle = "0"
49+
useCustomWorkingDirectory = "NO"
50+
ignoresPersistentStateOnLaunch = "NO"
51+
debugDocumentVersioning = "YES"
52+
debugServiceExtension = "internal"
53+
allowLocationSimulation = "YES">
54+
<BuildableProductRunnable
55+
runnableDebuggingMode = "0">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "1F0326F81F0D28CC00BF3358"
59+
BuildableName = "NVActivityIndicatorViewExample.app"
60+
BlueprintName = "NVActivityIndicatorViewExample"
61+
ReferencedContainer = "container:NVActivityIndicatorViewExample.xcodeproj">
62+
</BuildableReference>
63+
</BuildableProductRunnable>
64+
<AdditionalOptions>
65+
</AdditionalOptions>
66+
</LaunchAction>
67+
<ProfileAction
68+
buildConfiguration = "Release"
69+
shouldUseLaunchSchemeArgsEnv = "YES"
70+
savedToolIdentifier = ""
71+
useCustomWorkingDirectory = "NO"
72+
debugDocumentVersioning = "YES">
73+
<BuildableProductRunnable
74+
runnableDebuggingMode = "0">
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "1F0326F81F0D28CC00BF3358"
78+
BuildableName = "NVActivityIndicatorViewExample.app"
79+
BlueprintName = "NVActivityIndicatorViewExample"
80+
ReferencedContainer = "container:NVActivityIndicatorViewExample.xcodeproj">
81+
</BuildableReference>
82+
</BuildableProductRunnable>
83+
</ProfileAction>
84+
<AnalyzeAction
85+
buildConfiguration = "Debug">
86+
</AnalyzeAction>
87+
<ArchiveAction
88+
buildConfiguration = "Release"
89+
revealArchiveInOrganizer = "YES">
90+
</ArchiveAction>
91+
</Scheme>

Example/NVActivityIndicatorViewExample.xcodeproj/xcshareddata/xcschemes/NVActivityIndicatorViewTests.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Source/NVActivityIndicatorView.xcodeproj/project.pbxproj

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,12 @@
363363
isa = PBXProject;
364364
attributes = {
365365
LastSwiftUpdateCheck = 0830;
366-
LastUpgradeCheck = 0930;
366+
LastUpgradeCheck = 1020;
367367
ORGANIZATIONNAME = "Vinh Nguyen";
368368
TargetAttributes = {
369369
1F0326931F0D24BE00BF3358 = {
370370
CreatedOnToolsVersion = 8.3;
371-
LastSwiftMigration = 0900;
371+
LastSwiftMigration = 1020;
372372
ProvisioningStyle = Manual;
373373
};
374374
1F88C9D81F10D0B200869231 = {
@@ -384,10 +384,11 @@
384384
};
385385
buildConfigurationList = 1F03268E1F0D24BE00BF3358 /* Build configuration list for PBXProject "NVActivityIndicatorView" */;
386386
compatibilityVersion = "Xcode 3.2";
387-
developmentRegion = English;
387+
developmentRegion = en;
388388
hasScannedForEncodings = 0;
389389
knownRegions = (
390390
en,
391+
Base,
391392
);
392393
mainGroup = 1F03268A1F0D24BE00BF3358;
393394
productRefGroup = 1F0326951F0D24BE00BF3358 /* Products */;
@@ -571,6 +572,7 @@
571572
isa = XCBuildConfiguration;
572573
buildSettings = {
573574
ALWAYS_SEARCH_USER_PATHS = NO;
575+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
574576
CLANG_ANALYZER_NONNULL = YES;
575577
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
576578
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -624,7 +626,7 @@
624626
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
625627
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
626628
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
627-
SWIFT_VERSION = 4.2;
629+
SWIFT_VERSION = 5.0;
628630
TARGETED_DEVICE_FAMILY = "1,2";
629631
VERSIONING_SYSTEM = "apple-generic";
630632
VERSION_INFO_PREFIX = "";
@@ -635,6 +637,7 @@
635637
isa = XCBuildConfiguration;
636638
buildSettings = {
637639
ALWAYS_SEARCH_USER_PATHS = NO;
640+
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
638641
CLANG_ANALYZER_NONNULL = YES;
639642
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
640643
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
@@ -680,7 +683,7 @@
680683
SDKROOT = iphoneos;
681684
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
682685
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
683-
SWIFT_VERSION = 4.2;
686+
SWIFT_VERSION = 5.0;
684687
TARGETED_DEVICE_FAMILY = "1,2";
685688
VALIDATE_PRODUCT = YES;
686689
VERSIONING_SYSTEM = "apple-generic";
@@ -708,8 +711,7 @@
708711
PROVISIONING_PROFILE_SPECIFIER = "";
709712
SKIP_INSTALL = YES;
710713
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
711-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
712-
SWIFT_VERSION = 4.2;
714+
SWIFT_VERSION = 5.0;
713715
};
714716
name = Debug;
715717
};
@@ -732,8 +734,7 @@
732734
PRODUCT_NAME = NVActivityIndicatorView;
733735
PROVISIONING_PROFILE_SPECIFIER = "";
734736
SKIP_INSTALL = YES;
735-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
736-
SWIFT_VERSION = 4.2;
737+
SWIFT_VERSION = 5.0;
737738
};
738739
name = Release;
739740
};
@@ -756,7 +757,7 @@
756757
PROVISIONING_PROFILE_SPECIFIER = "";
757758
SKIP_INSTALL = YES;
758759
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
759-
SWIFT_VERSION = 4.2;
760+
SWIFT_VERSION = 5.0;
760761
};
761762
name = Debug;
762763
};
@@ -779,7 +780,7 @@
779780
PROVISIONING_PROFILE_SPECIFIER = "";
780781
SKIP_INSTALL = YES;
781782
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
782-
SWIFT_VERSION = 4.2;
783+
SWIFT_VERSION = 5.0;
783784
};
784785
name = Release;
785786
};
@@ -807,7 +808,7 @@
807808
PROVISIONING_PROFILE_SPECIFIER = "";
808809
SDKROOT = appletvos;
809810
SKIP_INSTALL = YES;
810-
SWIFT_VERSION = 4.2;
811+
SWIFT_VERSION = 5.0;
811812
TARGETED_DEVICE_FAMILY = 3;
812813
TVOS_DEPLOYMENT_TARGET = 9.0;
813814
};
@@ -836,7 +837,7 @@
836837
PROVISIONING_PROFILE_SPECIFIER = "";
837838
SDKROOT = appletvos;
838839
SKIP_INSTALL = YES;
839-
SWIFT_VERSION = 4.2;
840+
SWIFT_VERSION = 5.0;
840841
TARGETED_DEVICE_FAMILY = 3;
841842
TVOS_DEPLOYMENT_TARGET = 9.0;
842843
};

Source/NVActivityIndicatorView.xcodeproj/xcshareddata/xcschemes/NVActivityIndicatorView-iOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Source/NVActivityIndicatorView.xcodeproj/xcshareddata/xcschemes/NVActivityIndicatorView-tvOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1010"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Source/NVActivityIndicatorView.xcodeproj/xcshareddata/xcschemes/NVActivityIndicatorViewAppExtension-iOS.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0930"
3+
LastUpgradeVersion = "1020"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Source/NVActivityIndicatorView/NVActivityIndicatorView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ public final class NVActivityIndicatorView: UIView {
439439
@IBInspectable public var padding: CGFloat = NVActivityIndicatorView.DEFAULT_PADDING
440440

441441
/// Current status of animation, read-only.
442-
@available(*, deprecated: 3.1)
442+
@available(*, deprecated)
443443
public var animating: Bool { return isAnimating }
444444

445445
/// Current status of animation, read-only.

Source/NVActivityIndicatorView/Presenter/NVActivityIndicatorViewable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public extension NVActivityIndicatorViewable where Self: UIViewController {
5454
- parameter minimumDisplayTime: minimum display time of UI blocker.
5555
- parameter fadeInAnimation: fade in animation.
5656
*/
57-
public func startAnimating(
57+
func startAnimating(
5858
_ size: CGSize? = nil,
5959
message: String? = nil,
6060
messageFont: UIFont? = nil,
@@ -85,7 +85,7 @@ public extension NVActivityIndicatorViewable where Self: UIViewController {
8585

8686
- parameter fadeOutAnimation: fade out animation.
8787
*/
88-
public func stopAnimating(_ fadeOutAnimation: FadeOutAnimation? = NVActivityIndicatorView.DEFAULT_FADE_OUT_ANIMATION) {
88+
func stopAnimating(_ fadeOutAnimation: FadeOutAnimation? = NVActivityIndicatorView.DEFAULT_FADE_OUT_ANIMATION) {
8989
NVActivityIndicatorPresenter.sharedInstance.stopAnimating(fadeOutAnimation)
9090
}
9191
}

0 commit comments

Comments
 (0)