Skip to content

Commit 09c2e95

Browse files
committed
Update to swift 3
Bump cocoapods
1 parent a37c123 commit 09c2e95

File tree

8 files changed

+145
-141
lines changed

8 files changed

+145
-141
lines changed

Example/Example.xcodeproj/project.pbxproj

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@
9494
isa = PBXProject;
9595
attributes = {
9696
LastSwiftUpdateCheck = 0730;
97-
LastUpgradeCheck = 0730;
97+
LastUpgradeCheck = 0820;
9898
ORGANIZATIONNAME = "Rafael Machado";
9999
TargetAttributes = {
100100
926B14761CDA2AE600785834 = {
101101
CreatedOnToolsVersion = 7.3;
102-
LastSwiftMigration = 0800;
102+
LastSwiftMigration = 0820;
103103
};
104104
};
105105
};
@@ -173,8 +173,10 @@
173173
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
174174
CLANG_WARN_EMPTY_BODY = YES;
175175
CLANG_WARN_ENUM_CONVERSION = YES;
176+
CLANG_WARN_INFINITE_RECURSION = YES;
176177
CLANG_WARN_INT_CONVERSION = YES;
177178
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
179+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
178180
CLANG_WARN_UNREACHABLE_CODE = YES;
179181
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
180182
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -219,8 +221,10 @@
219221
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
220222
CLANG_WARN_EMPTY_BODY = YES;
221223
CLANG_WARN_ENUM_CONVERSION = YES;
224+
CLANG_WARN_INFINITE_RECURSION = YES;
222225
CLANG_WARN_INT_CONVERSION = YES;
223226
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
227+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
224228
CLANG_WARN_UNREACHABLE_CODE = YES;
225229
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
226230
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -239,6 +243,7 @@
239243
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
240244
MTL_ENABLE_DEBUG_INFO = NO;
241245
SDKROOT = iphoneos;
246+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
242247
TARGETED_DEVICE_FAMILY = "1,2";
243248
VALIDATE_PRODUCT = YES;
244249
};
@@ -252,7 +257,7 @@
252257
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
253258
PRODUCT_BUNDLE_IDENTIFIER = RM.Example;
254259
PRODUCT_NAME = "$(TARGET_NAME)";
255-
SWIFT_VERSION = 2.3;
260+
SWIFT_VERSION = 3.0;
256261
};
257262
name = Debug;
258263
};
@@ -264,7 +269,7 @@
264269
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
265270
PRODUCT_BUNDLE_IDENTIFIER = RM.Example;
266271
PRODUCT_NAME = "$(TARGET_NAME)";
267-
SWIFT_VERSION = 2.3;
272+
SWIFT_VERSION = 3.0;
268273
};
269274
name = Release;
270275
};

Example/Example/AppDelegate.swift

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1313

1414
var window: UIWindow?
1515

16-
17-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18-
// Override point for customization after application launch.
16+
func application(_ application: UIApplication,
17+
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
1918
return true
2019
}
21-
22-
func applicationWillResignActive(application: UIApplication) {
23-
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24-
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25-
}
26-
27-
func applicationDidEnterBackground(application: UIApplication) {
28-
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29-
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30-
}
31-
32-
func applicationWillEnterForeground(application: UIApplication) {
33-
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34-
}
35-
36-
func applicationDidBecomeActive(application: UIApplication) {
37-
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38-
}
39-
40-
func applicationWillTerminate(application: UIApplication) {
41-
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42-
}
43-
44-
4520
}
46-

Example/Example/Main.storyboard

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
36
<dependencies>
47
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
610
</dependencies>
711
<scenes>
812
<!--View Controller-->
@@ -14,24 +18,24 @@
1418
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
1519
</layoutGuides>
1620
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
17-
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
21+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
1822
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
1923
<subviews>
2024
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pki-oD-8ua" customClass="OnOffButton" customModule="Example" customModuleProvider="target">
21-
<rect key="frame" x="110" y="234" width="100" height="100"/>
25+
<rect key="frame" x="138" y="284" width="100" height="100"/>
2226
<constraints>
2327
<constraint firstAttribute="height" constant="100" id="PqE-a0-8ZX"/>
2428
<constraint firstAttribute="width" constant="100" id="zhN-Sb-6TG"/>
2529
</constraints>
2630
<state key="normal">
27-
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
31+
<color key="titleShadowColor" red="0.5" green="0.5" blue="0.5" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2832
</state>
2933
<userDefinedRuntimeAttributes>
3034
<userDefinedRuntimeAttribute type="number" keyPath="lineWidth">
3135
<real key="value" value="5"/>
3236
</userDefinedRuntimeAttribute>
3337
<userDefinedRuntimeAttribute type="color" keyPath="strokeColor">
34-
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
38+
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
3539
</userDefinedRuntimeAttribute>
3640
<userDefinedRuntimeAttribute type="number" keyPath="ringAlpha">
3741
<real key="value" value="0.29999999999999999"/>
@@ -42,7 +46,7 @@
4246
</connections>
4347
</button>
4448
</subviews>
45-
<color key="backgroundColor" red="0.19607843137254902" green="0.73725490196078436" blue="0.2627450980392157" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
49+
<color key="backgroundColor" red="0.17791272699832916" green="0.7009960412979126" blue="0.20318764448165894" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
4650
<constraints>
4751
<constraint firstAttribute="centerY" secondItem="pki-oD-8ua" secondAttribute="centerY" id="Kke-Hz-Uok"/>
4852
<constraint firstAttribute="centerX" secondItem="pki-oD-8ua" secondAttribute="centerX" id="UZa-x9-mr2"/>
@@ -54,4 +58,9 @@
5458
<point key="canvasLocation" x="162" y="333"/>
5559
</scene>
5660
</scenes>
61+
<simulatedMetricsContainer key="defaultSimulatedMetrics">
62+
<simulatedStatusBarMetrics key="statusBar"/>
63+
<simulatedOrientationMetrics key="orientation"/>
64+
<simulatedScreenMetrics key="destination" type="retina4_7.fullscreen"/>
65+
</simulatedMetricsContainer>
5766
</document>

Example/Example/ViewController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ class ViewController: UIViewController {
55
override func viewDidLoad() {
66
super.viewDidLoad()
77
}
8-
9-
@IBAction func changeButtonState(sender: OnOffButton) {
8+
9+
@IBAction func changeButtonState(_ sender: OnOffButton) {
1010
sender.checked = !sender.checked
1111
}
12-
}
12+
}

OnOffButton.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Pod::Spec.new do |s|
33
s.name = 'OnOffButton'
4-
s.version = '1.3'
4+
s.version = '1.5'
55
s.summary = 'Custom On/Off UIButton'
66

77
s.description = <<-DESC

OnOffButton.xcodeproj/project.pbxproj

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
/* Begin PBXBuildFile section */
1010
926B14981CDA2B8F00785834 /* OnOffButton.h in Headers */ = {isa = PBXBuildFile; fileRef = 926B14971CDA2B8F00785834 /* OnOffButton.h */; settings = {ATTRIBUTES = (Public, ); }; };
1111
926B149E1CDA2BA900785834 /* OnOffButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 926B149D1CDA2BA900785834 /* OnOffButton.swift */; };
12-
926B14A01CDA2D2F00785834 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 926B149F1CDA2D2F00785834 /* Info.plist */; };
1312
/* End PBXBuildFile section */
1413

1514
/* Begin PBXFileReference section */
@@ -104,12 +103,12 @@
104103
attributes = {
105104
LastSwiftMigration = 0730;
106105
LastSwiftUpdateCheck = 0730;
107-
LastUpgradeCheck = 0730;
106+
LastUpgradeCheck = 0820;
108107
ORGANIZATIONNAME = "Rafael Machado";
109108
TargetAttributes = {
110109
926B14941CDA2B8F00785834 = {
111110
CreatedOnToolsVersion = 7.3;
112-
LastSwiftMigration = 0800;
111+
LastSwiftMigration = 0820;
113112
};
114113
};
115114
};
@@ -136,7 +135,6 @@
136135
isa = PBXResourcesBuildPhase;
137136
buildActionMask = 2147483647;
138137
files = (
139-
926B14A01CDA2D2F00785834 /* Info.plist in Resources */,
140138
);
141139
runOnlyForDeploymentPostprocessing = 0;
142140
};
@@ -167,8 +165,10 @@
167165
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
168166
CLANG_WARN_EMPTY_BODY = YES;
169167
CLANG_WARN_ENUM_CONVERSION = YES;
168+
CLANG_WARN_INFINITE_RECURSION = YES;
170169
CLANG_WARN_INT_CONVERSION = YES;
171170
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
171+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
172172
CLANG_WARN_UNREACHABLE_CODE = YES;
173173
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
174174
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -177,6 +177,7 @@
177177
ENABLE_TESTABILITY = YES;
178178
GCC_C_LANGUAGE_STANDARD = gnu99;
179179
GCC_DYNAMIC_NO_PIC = NO;
180+
GCC_NO_COMMON_BLOCKS = YES;
180181
GCC_OPTIMIZATION_LEVEL = 0;
181182
GCC_PREPROCESSOR_DEFINITIONS = (
182183
"DEBUG=1",
@@ -211,15 +212,18 @@
211212
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
212213
CLANG_WARN_EMPTY_BODY = YES;
213214
CLANG_WARN_ENUM_CONVERSION = YES;
215+
CLANG_WARN_INFINITE_RECURSION = YES;
214216
CLANG_WARN_INT_CONVERSION = YES;
215217
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
218+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
216219
CLANG_WARN_UNREACHABLE_CODE = YES;
217220
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
218221
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
219222
COPY_PHASE_STRIP = YES;
220223
ENABLE_NS_ASSERTIONS = NO;
221224
ENABLE_STRICT_OBJC_MSGSEND = YES;
222225
GCC_C_LANGUAGE_STANDARD = gnu99;
226+
GCC_NO_COMMON_BLOCKS = YES;
223227
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
224228
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
225229
GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -229,6 +233,7 @@
229233
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
230234
MTL_ENABLE_DEBUG_INFO = NO;
231235
SDKROOT = iphoneos;
236+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
232237
TARGETED_DEVICE_FAMILY = "1,2";
233238
VALIDATE_PRODUCT = YES;
234239
};
@@ -239,6 +244,7 @@
239244
buildSettings = {
240245
CLANG_ANALYZER_NONNULL = YES;
241246
CLANG_ENABLE_MODULES = YES;
247+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
242248
CURRENT_PROJECT_VERSION = 1;
243249
DEBUG_INFORMATION_FORMAT = dwarf;
244250
DEFINES_MODULE = YES;
@@ -254,7 +260,7 @@
254260
PRODUCT_NAME = "$(TARGET_NAME)";
255261
SKIP_INSTALL = YES;
256262
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
257-
SWIFT_VERSION = 2.3;
263+
SWIFT_VERSION = 3.0;
258264
VERSIONING_SYSTEM = "apple-generic";
259265
VERSION_INFO_PREFIX = "";
260266
};
@@ -265,6 +271,7 @@
265271
buildSettings = {
266272
CLANG_ANALYZER_NONNULL = YES;
267273
CLANG_ENABLE_MODULES = YES;
274+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
268275
COPY_PHASE_STRIP = NO;
269276
CURRENT_PROJECT_VERSION = 1;
270277
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
@@ -280,7 +287,7 @@
280287
PRODUCT_BUNDLE_IDENTIFIER = RM.OnOffButton;
281288
PRODUCT_NAME = "$(TARGET_NAME)";
282289
SKIP_INSTALL = YES;
283-
SWIFT_VERSION = 2.3;
290+
SWIFT_VERSION = 3.0;
284291
VERSIONING_SYSTEM = "apple-generic";
285292
VERSION_INFO_PREFIX = "";
286293
};

OnOffButton.xcodeproj/xcshareddata/xcschemes/OnOffButton.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 = "0730"
3+
LastUpgradeVersion = "0820"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

0 commit comments

Comments
 (0)