Skip to content

Commit b06d55a

Browse files
authored
Merge pull request #201 from piv199/swift3xcode8
Swift3 Xcode8 support for master
2 parents 12bca06 + 9d3a539 commit b06d55a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1073
-244
lines changed

EZSwiftExtensions.xcodeproj/project.pbxproj

+20-1
Original file line numberDiff line numberDiff line change
@@ -596,14 +596,16 @@
596596
isa = PBXProject;
597597
attributes = {
598598
LastSwiftUpdateCheck = 0730;
599-
LastUpgradeCheck = 0710;
599+
LastUpgradeCheck = 0800;
600600
ORGANIZATIONNAME = "Goktug Yilmaz";
601601
TargetAttributes = {
602602
B5DC86A81C0ED06700972D0A = {
603603
CreatedOnToolsVersion = 7.1;
604+
LastSwiftMigration = 0800;
604605
};
605606
B5DC86B21C0ED06700972D0A = {
606607
CreatedOnToolsVersion = 7.1;
608+
LastSwiftMigration = 0800;
607609
};
608610
};
609611
};
@@ -933,8 +935,10 @@
933935
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
934936
CLANG_WARN_EMPTY_BODY = YES;
935937
CLANG_WARN_ENUM_CONVERSION = YES;
938+
CLANG_WARN_INFINITE_RECURSION = YES;
936939
CLANG_WARN_INT_CONVERSION = YES;
937940
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
941+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
938942
CLANG_WARN_UNREACHABLE_CODE = YES;
939943
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
940944
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -979,8 +983,10 @@
979983
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
980984
CLANG_WARN_EMPTY_BODY = YES;
981985
CLANG_WARN_ENUM_CONVERSION = YES;
986+
CLANG_WARN_INFINITE_RECURSION = YES;
982987
CLANG_WARN_INT_CONVERSION = YES;
983988
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
989+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
984990
CLANG_WARN_UNREACHABLE_CODE = YES;
985991
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
986992
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -999,6 +1005,7 @@
9991005
GCC_WARN_UNUSED_VARIABLE = YES;
10001006
MTL_ENABLE_DEBUG_INFO = NO;
10011007
SDKROOT = iphoneos;
1008+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
10021009
VALIDATE_PRODUCT = YES;
10031010
VERSIONING_SYSTEM = "apple-generic";
10041011
VERSION_INFO_PREFIX = "";
@@ -1008,6 +1015,7 @@
10081015
B5DC86BE1C0ED06700972D0A /* Debug */ = {
10091016
isa = XCBuildConfiguration;
10101017
buildSettings = {
1018+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
10111019
DEFINES_MODULE = YES;
10121020
DYLIB_COMPATIBILITY_VERSION = 1;
10131021
DYLIB_CURRENT_VERSION = 1.0.2;
@@ -1019,13 +1027,15 @@
10191027
PRODUCT_BUNDLE_IDENTIFIER = com.gbf.EZSwiftExtensions.EZSwiftExtensions;
10201028
PRODUCT_NAME = EZSwiftExtensions;
10211029
SKIP_INSTALL = YES;
1030+
SWIFT_VERSION = 3.0;
10221031
TARGETED_DEVICE_FAMILY = "1,2";
10231032
};
10241033
name = Debug;
10251034
};
10261035
B5DC86BF1C0ED06700972D0A /* Release */ = {
10271036
isa = XCBuildConfiguration;
10281037
buildSettings = {
1038+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
10291039
DEFINES_MODULE = YES;
10301040
DYLIB_COMPATIBILITY_VERSION = 1;
10311041
DYLIB_CURRENT_VERSION = 1.0.2;
@@ -1037,6 +1047,7 @@
10371047
PRODUCT_BUNDLE_IDENTIFIER = com.gbf.EZSwiftExtensions.EZSwiftExtensions;
10381048
PRODUCT_NAME = EZSwiftExtensions;
10391049
SKIP_INSTALL = YES;
1050+
SWIFT_VERSION = 3.0;
10401051
TARGETED_DEVICE_FAMILY = "1,2";
10411052
};
10421053
name = Release;
@@ -1048,6 +1059,7 @@
10481059
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
10491060
PRODUCT_BUNDLE_IDENTIFIER = com.gbf.EZSwiftExtensions.EZSwiftExtensionsTests;
10501061
PRODUCT_NAME = EZSwiftExtensionsTest;
1062+
SWIFT_VERSION = 3.0;
10511063
};
10521064
name = Debug;
10531065
};
@@ -1058,12 +1070,14 @@
10581070
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
10591071
PRODUCT_BUNDLE_IDENTIFIER = com.gbf.EZSwiftExtensions.EZSwiftExtensionsTests;
10601072
PRODUCT_NAME = EZSwiftExtensionsTest;
1073+
SWIFT_VERSION = 3.0;
10611074
};
10621075
name = Release;
10631076
};
10641077
CD4D30E11CEEAFD900CB53BC /* Debug */ = {
10651078
isa = XCBuildConfiguration;
10661079
buildSettings = {
1080+
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
10671081
DEFINES_MODULE = YES;
10681082
DYLIB_COMPATIBILITY_VERSION = 1;
10691083
DYLIB_CURRENT_VERSION = 1.0.2;
@@ -1075,13 +1089,15 @@
10751089
PRODUCT_NAME = EZSwiftExtensions;
10761090
SDKROOT = appletvos;
10771091
SKIP_INSTALL = YES;
1092+
SWIFT_VERSION = 3.0;
10781093
TVOS_DEPLOYMENT_TARGET = 9.0;
10791094
};
10801095
name = Debug;
10811096
};
10821097
CD4D30E21CEEAFD900CB53BC /* Release */ = {
10831098
isa = XCBuildConfiguration;
10841099
buildSettings = {
1100+
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
10851101
DEFINES_MODULE = YES;
10861102
DYLIB_COMPATIBILITY_VERSION = 1;
10871103
DYLIB_CURRENT_VERSION = 1.0.2;
@@ -1093,6 +1109,7 @@
10931109
PRODUCT_NAME = EZSwiftExtensions;
10941110
SDKROOT = appletvos;
10951111
SKIP_INSTALL = YES;
1112+
SWIFT_VERSION = 3.0;
10961113
TVOS_DEPLOYMENT_TARGET = 9.0;
10971114
};
10981115
name = Release;
@@ -1105,6 +1122,7 @@
11051122
PRODUCT_BUNDLE_IDENTIFIER = com.gbf.EZSwiftExtensions.EZSwiftExtensionsTests;
11061123
PRODUCT_NAME = EZSwiftExtensionsTest;
11071124
SDKROOT = appletvos;
1125+
SWIFT_VERSION = 3.0;
11081126
};
11091127
name = Debug;
11101128
};
@@ -1116,6 +1134,7 @@
11161134
PRODUCT_BUNDLE_IDENTIFIER = com.gbf.EZSwiftExtensions.EZSwiftExtensionsTests;
11171135
PRODUCT_NAME = EZSwiftExtensionsTest;
11181136
SDKROOT = appletvos;
1137+
SWIFT_VERSION = 3.0;
11191138
};
11201139
name = Release;
11211140
};

EZSwiftExtensions.xcodeproj/xcshareddata/xcschemes/EZSwiftExtensions-iOS.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0710"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

EZSwiftExtensionsExample.xcodeproj/project.pbxproj

+16-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
C48E3F661D902B6700ED2DF7 /* NSUserDefaultsExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C48E3F651D902B6700ED2DF7 /* NSUserDefaultsExtension.swift */; };
1011
C85840ED1C43B05200595696 /* NSURLExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85840EC1C43B05200595696 /* NSURLExtensions.swift */; };
1112
E10A79321D6F2ED700735549 /* UIApplicationExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E10A79311D6F2ED700735549 /* UIApplicationExtensions.swift */; };
1213
E10A79371D6F4BDB00735549 /* UITextFieldExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E10A79361D6F4BDB00735549 /* UITextFieldExtensions.swift */; };
@@ -61,6 +62,7 @@
6162
/* End PBXBuildFile section */
6263

6364
/* Begin PBXFileReference section */
65+
C48E3F651D902B6700ED2DF7 /* NSUserDefaultsExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NSUserDefaultsExtension.swift; path = Sources/NSUserDefaultsExtension.swift; sourceTree = SOURCE_ROOT; };
6466
C85840EC1C43B05200595696 /* NSURLExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NSURLExtensions.swift; path = Sources/NSURLExtensions.swift; sourceTree = SOURCE_ROOT; };
6567
E10A79311D6F2ED700735549 /* UIApplicationExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UIApplicationExtensions.swift; path = Sources/UIApplicationExtensions.swift; sourceTree = SOURCE_ROOT; };
6668
E10A79361D6F4BDB00735549 /* UITextFieldExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UITextFieldExtensions.swift; path = Sources/UITextFieldExtensions.swift; sourceTree = SOURCE_ROOT; };
@@ -135,6 +137,7 @@
135137
E1839E041BF79974002212C6 /* BlockLongPress.swift */,
136138
E1839E051BF79974002212C6 /* BlockPan.swift */,
137139
E1839E061BF79974002212C6 /* BlockPinch.swift */,
140+
C48E3F651D902B6700ED2DF7 /* NSUserDefaultsExtension.swift */,
138141
E1839E071BF79974002212C6 /* BlockSwipe.swift */,
139142
E1839E081BF79974002212C6 /* BlockTap.swift */,
140143
E1839E091BF79974002212C6 /* BlockWebView.swift */,
@@ -237,7 +240,7 @@
237240
E1839DAD1BF79335002212C6 /* Project object */ = {
238241
isa = PBXProject;
239242
attributes = {
240-
LastUpgradeCheck = 0700;
243+
LastUpgradeCheck = 0800;
241244
ORGANIZATIONNAME = "Goktug Yilmaz";
242245
TargetAttributes = {
243246
E1839DB41BF79335002212C6 = {
@@ -292,6 +295,7 @@
292295
E1839E351BF79974002212C6 /* UIImageViewExtensions.swift in Sources */,
293296
E1839E371BF79974002212C6 /* UITextViewExtensions.swift in Sources */,
294297
E1839E2F1BF79974002212C6 /* UIButtonExtensions.swift in Sources */,
298+
C48E3F661D902B6700ED2DF7 /* NSUserDefaultsExtension.swift in Sources */,
295299
E1587FB01CCA41F400A0B071 /* UISwitchExtensions.swift in Sources */,
296300
E10A79491D6F51E200735549 /* NSDictionaryExtensions.swift in Sources */,
297301
E1839E301BF79974002212C6 /* UIColoredView.swift in Sources */,
@@ -368,8 +372,10 @@
368372
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
369373
CLANG_WARN_EMPTY_BODY = YES;
370374
CLANG_WARN_ENUM_CONVERSION = YES;
375+
CLANG_WARN_INFINITE_RECURSION = YES;
371376
CLANG_WARN_INT_CONVERSION = YES;
372377
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
378+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
373379
CLANG_WARN_UNREACHABLE_CODE = YES;
374380
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
375381
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -396,6 +402,7 @@
396402
ONLY_ACTIVE_ARCH = YES;
397403
SDKROOT = iphoneos;
398404
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
405+
SWIFT_VERSION = 3.0;
399406
TARGETED_DEVICE_FAMILY = "1,2";
400407
};
401408
name = Debug;
@@ -413,8 +420,10 @@
413420
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
414421
CLANG_WARN_EMPTY_BODY = YES;
415422
CLANG_WARN_ENUM_CONVERSION = YES;
423+
CLANG_WARN_INFINITE_RECURSION = YES;
416424
CLANG_WARN_INT_CONVERSION = YES;
417425
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
426+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
418427
CLANG_WARN_UNREACHABLE_CODE = YES;
419428
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
420429
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -433,6 +442,8 @@
433442
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
434443
MTL_ENABLE_DEBUG_INFO = NO;
435444
SDKROOT = iphoneos;
445+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
446+
SWIFT_VERSION = 3.0;
436447
TARGETED_DEVICE_FAMILY = "1,2";
437448
VALIDATE_PRODUCT = YES;
438449
};
@@ -442,23 +453,27 @@
442453
isa = XCBuildConfiguration;
443454
buildSettings = {
444455
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
456+
DEVELOPMENT_TEAM = "";
445457
INFOPLIST_FILE = EZSwiftExtensions/Info.plist;
446458
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
447459
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
448460
PRODUCT_BUNDLE_IDENTIFIER = com.gbf.EZSwiftExtensions;
449461
PRODUCT_NAME = EZSwiftExtensionsExample;
462+
SWIFT_VERSION = 3.0;
450463
};
451464
name = Debug;
452465
};
453466
E1839DC91BF79335002212C6 /* Release */ = {
454467
isa = XCBuildConfiguration;
455468
buildSettings = {
456469
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
470+
DEVELOPMENT_TEAM = "";
457471
INFOPLIST_FILE = EZSwiftExtensions/Info.plist;
458472
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
459473
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
460474
PRODUCT_BUNDLE_IDENTIFIER = com.gbf.EZSwiftExtensions;
461475
PRODUCT_NAME = EZSwiftExtensionsExample;
476+
SWIFT_VERSION = 3.0;
462477
};
463478
name = Release;
464479
};

EZSwiftExtensionsExample/AppDelegate.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,34 @@ import UIKit
1212
class AppDelegate: UIResponder, UIApplicationDelegate {
1313
var window: UIWindow?
1414

15-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
15+
private func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
1616
// Override point for customization after application launch.
1717
return true
1818
}
1919

20-
func applicationWillResignActive(application: UIApplication) {
20+
func applicationWillResignActive(_ application: UIApplication) {
2121
// Sent when the application is about to move from active to inactive state.
2222
// This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
2323
// or when the user quits the application and it begins the transition to the background state.
2424
// 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.
2525
}
2626

27-
func applicationDidEnterBackground(application: UIApplication) {
27+
func applicationDidEnterBackground(_ application: UIApplication) {
2828
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information
2929
// to restore your application to its current state in case it is terminated later.
3030
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
3131
}
3232

33-
func applicationWillEnterForeground(application: UIApplication) {
33+
func applicationWillEnterForeground(_ application: UIApplication) {
3434
// 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.
3535
}
3636

37-
func applicationDidBecomeActive(application: UIApplication) {
37+
func applicationDidBecomeActive(_ application: UIApplication) {
3838
// Restart any tasks that were paused (or not yet started) while the application was inactive.
3939
// If the application was previously in the background, optionally refresh the user interface.
4040
}
4141

42-
func applicationWillTerminate(application: UIApplication) {
42+
func applicationWillTerminate(_ application: UIApplication) {
4343
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
4444
}
4545
}

EZSwiftExtensionsExample/Assets.xcassets/AppIcon.appiconset/Contents.json

+20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
{
22
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "20x20",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "20x20",
11+
"scale" : "3x"
12+
},
313
{
414
"idiom" : "iphone",
515
"size" : "29x29",
@@ -30,6 +40,16 @@
3040
"size" : "60x60",
3141
"scale" : "3x"
3242
},
43+
{
44+
"idiom" : "ipad",
45+
"size" : "20x20",
46+
"scale" : "1x"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"size" : "20x20",
51+
"scale" : "2x"
52+
},
3353
{
3454
"idiom" : "ipad",
3555
"size" : "29x29",

EZSwiftExtensionsExample/Base.lproj/Main.storyboard

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="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="11201" systemVersion="16A319" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
33
<dependencies>
44
<deployment identifier="iOS"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
6+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
67
</dependencies>
78
<scenes>
89
<!--View Controller-->
@@ -14,9 +15,9 @@
1415
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
1516
</layoutGuides>
1617
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
17-
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
18+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
1819
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19-
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
20+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
2021
</view>
2122
</viewController>
2223
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>

EZSwiftExtensionsTests/ArrayTests.swift

+6-5
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,14 @@ class ArrayTests: XCTestCase {
126126
XCTAssertEqual(difference, [0, 5, 6, 7, 8])
127127
}
128128

129+
/// WARNING: [SE-0121] Remove Optional Comparison Operators
129130
func testOptionalEquatable() {
130131
let a: [Int]? = [1, 2, 3]
131132
let b: [Int]? = [1, 2, 3]
132-
let c: [Int]? = nil
133+
// let c: [Int]? = nil
133134

134-
XCTAssertTrue(a == b)
135-
XCTAssertFalse(a == c)
135+
XCTAssertTrue(a! == b!)
136+
// XCTAssertFalse(a! == c!)
136137
}
137138

138139
func testShuffle() {
@@ -144,8 +145,8 @@ class ArrayTests: XCTestCase {
144145
XCTAssertEqual(numberArray.count, copyArray.count)
145146

146147
for e in copyArray {
147-
if let i = numberArray.indexOf(e) {
148-
numberArray.removeAtIndex(i)
148+
if let i = numberArray.index(of: e) {
149+
numberArray.remove(at: i)
149150
}
150151
}
151152
XCTAssertEqual(numberArray, [])

EZSwiftExtensionsTests/CGFloatTests.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class CGFloatTests: XCTestCase {
1818
degrees = 360
1919
}
2020

21-
func testToggle() {
22-
XCTAssertEqual(radians, degrees.degreesToRadians())
21+
func testConversion() {
22+
XCTAssertEqual(radians, degrees.toRadians())
2323
}
2424
}

0 commit comments

Comments
 (0)