Skip to content

Commit 65bfa36

Browse files
authored
Merge pull request #1 from NextFaze/feature/swift3
Feature/swift3
2 parents 0f4c88d + 072dbf6 commit 65bfa36

24 files changed

+970
-388
lines changed

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.3
1+
3.0

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# * https://github.com/supermarin/xcpretty#usage
44

55
language: objective-c # still specify this even though we are using swift - appears to tell travis which Xcode version to use
6-
osx_image: xcode7.3
6+
osx_image: xcode8
77
#cache: cocoapods
88
podfile: Example/Podfile
99
before_install:
@@ -15,7 +15,7 @@ script:
1515
- set -o pipefail
1616
- xcodebuild -version
1717
- xcodebuild -showsdks
18-
- xcodebuild build test -workspace Example/FazeKit.xcworkspace -scheme FazeKit-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
18+
- xcodebuild build test -workspace Example/FazeKit.xcworkspace -scheme FazeKit-Example -sdk iphonesimulator10.0 -destination 'platform=iOS Simulator,name=iPhone 6,OS=10.0' ONLY_ACTIVE_ARCH=NO | xcpretty
1919
- pod lib lint
2020
notifications:
2121
slack:

Example/FazeKit.xcodeproj/project.pbxproj

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; };
1515
607FACEC1AFB9204008FA782 /* UIViewAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* UIViewAdditionsTests.swift */; };
1616
78B6DD4BAF21BA4B263F3EF4 /* Pods_FazeKit_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DB0AD919FBE4556CA363D8B /* Pods_FazeKit_Tests.framework */; };
17-
C2E94BAE1D62CDD5007A7A4C /* NSProcessInfoAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2E94BAD1D62CDD5007A7A4C /* NSProcessInfoAdditionsTests.swift */; };
17+
C20FAFE21DD42EAA009E5C3F /* MulticastTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C20FAFE01DD42E7D009E5C3F /* MulticastTests.swift */; };
18+
C2B9A0321DD29F9100AF4E04 /* DateAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2B9A0301DD2941C00AF4E04 /* DateAdditionsTests.swift */; };
19+
C2B9A0381DD2DAE500AF4E04 /* CollectionAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2B9A0361DD2DAB500AF4E04 /* CollectionAdditionsTests.swift */; };
20+
C2E94BAE1D62CDD5007A7A4C /* ProcessInfoAdditionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2E94BAD1D62CDD5007A7A4C /* ProcessInfoAdditionsTests.swift */; };
1821
/* End PBXBuildFile section */
1922

2023
/* Begin PBXContainerItemProxy section */
@@ -43,7 +46,10 @@
4346
607FACEB1AFB9204008FA782 /* UIViewAdditionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewAdditionsTests.swift; sourceTree = "<group>"; };
4447
739B56FA57C1D0E13427B629 /* Pods-FazeKit_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FazeKit_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-FazeKit_Tests/Pods-FazeKit_Tests.release.xcconfig"; sourceTree = "<group>"; };
4548
AE54F13DF076B827802B2E27 /* Pods-FazeKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FazeKit_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-FazeKit_Example/Pods-FazeKit_Example.debug.xcconfig"; sourceTree = "<group>"; };
46-
C2E94BAD1D62CDD5007A7A4C /* NSProcessInfoAdditionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSProcessInfoAdditionsTests.swift; sourceTree = "<group>"; };
49+
C20FAFE01DD42E7D009E5C3F /* MulticastTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MulticastTests.swift; sourceTree = "<group>"; };
50+
C2B9A0301DD2941C00AF4E04 /* DateAdditionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateAdditionsTests.swift; sourceTree = "<group>"; };
51+
C2B9A0361DD2DAB500AF4E04 /* CollectionAdditionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionAdditionsTests.swift; sourceTree = "<group>"; };
52+
C2E94BAD1D62CDD5007A7A4C /* ProcessInfoAdditionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProcessInfoAdditionsTests.swift; sourceTree = "<group>"; };
4753
C5F04A4E1B4661BFB20EEE1D /* Pods_FazeKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_FazeKit_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4854
E2A7D960882894C1CF4EB4D0 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = "<group>"; };
4955
FAD6E5E790BC646CAF8A952D /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
@@ -123,7 +129,10 @@
123129
607FACE81AFB9204008FA782 /* Tests */ = {
124130
isa = PBXGroup;
125131
children = (
126-
C2E94BAD1D62CDD5007A7A4C /* NSProcessInfoAdditionsTests.swift */,
132+
C2B9A0361DD2DAB500AF4E04 /* CollectionAdditionsTests.swift */,
133+
C2B9A0301DD2941C00AF4E04 /* DateAdditionsTests.swift */,
134+
C20FAFE01DD42E7D009E5C3F /* MulticastTests.swift */,
135+
C2E94BAD1D62CDD5007A7A4C /* ProcessInfoAdditionsTests.swift */,
127136
607FACEB1AFB9204008FA782 /* UIViewAdditionsTests.swift */,
128137
607FACE91AFB9204008FA782 /* Supporting Files */,
129138
);
@@ -215,10 +224,12 @@
215224
TargetAttributes = {
216225
607FACCF1AFB9204008FA782 = {
217226
CreatedOnToolsVersion = 6.3.1;
227+
DevelopmentTeam = B89H5L73N6;
218228
LastSwiftMigration = 0800;
219229
};
220230
607FACE41AFB9204008FA782 = {
221231
CreatedOnToolsVersion = 6.3.1;
232+
DevelopmentTeam = B89H5L73N6;
222233
LastSwiftMigration = 0800;
223234
TestTargetID = 607FACCF1AFB9204008FA782;
224235
};
@@ -369,8 +380,11 @@
369380
isa = PBXSourcesBuildPhase;
370381
buildActionMask = 2147483647;
371382
files = (
372-
C2E94BAE1D62CDD5007A7A4C /* NSProcessInfoAdditionsTests.swift in Sources */,
383+
C2E94BAE1D62CDD5007A7A4C /* ProcessInfoAdditionsTests.swift in Sources */,
373384
607FACEC1AFB9204008FA782 /* UIViewAdditionsTests.swift in Sources */,
385+
C2B9A0321DD29F9100AF4E04 /* DateAdditionsTests.swift in Sources */,
386+
C20FAFE21DD42EAA009E5C3F /* MulticastTests.swift in Sources */,
387+
C2B9A0381DD2DAE500AF4E04 /* CollectionAdditionsTests.swift in Sources */,
374388
);
375389
runOnlyForDeploymentPostprocessing = 0;
376390
};
@@ -483,13 +497,14 @@
483497
baseConfigurationReference = AE54F13DF076B827802B2E27 /* Pods-FazeKit_Example.debug.xcconfig */;
484498
buildSettings = {
485499
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
500+
DEVELOPMENT_TEAM = B89H5L73N6;
486501
INFOPLIST_FILE = FazeKit/Info.plist;
487502
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
488503
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
489504
MODULE_NAME = ExampleApp;
490505
PRODUCT_BUNDLE_IDENTIFIER = "com.nextfaze.FazeKit-Example";
491506
PRODUCT_NAME = "$(TARGET_NAME)";
492-
SWIFT_VERSION = 2.3;
507+
SWIFT_VERSION = 3.0;
493508
};
494509
name = Debug;
495510
};
@@ -498,20 +513,22 @@
498513
baseConfigurationReference = 17B25E2129639E7E62C9740F /* Pods-FazeKit_Example.release.xcconfig */;
499514
buildSettings = {
500515
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
516+
DEVELOPMENT_TEAM = B89H5L73N6;
501517
INFOPLIST_FILE = FazeKit/Info.plist;
502518
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
503519
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
504520
MODULE_NAME = ExampleApp;
505521
PRODUCT_BUNDLE_IDENTIFIER = "com.nextfaze.FazeKit-Example";
506522
PRODUCT_NAME = "$(TARGET_NAME)";
507-
SWIFT_VERSION = 2.3;
523+
SWIFT_VERSION = 3.0;
508524
};
509525
name = Release;
510526
};
511527
607FACF31AFB9204008FA782 /* Debug */ = {
512528
isa = XCBuildConfiguration;
513529
baseConfigurationReference = 1E3B0E69CF2CF2930A6BA13A /* Pods-FazeKit_Tests.debug.xcconfig */;
514530
buildSettings = {
531+
DEVELOPMENT_TEAM = B89H5L73N6;
515532
FRAMEWORK_SEARCH_PATHS = (
516533
"$(SDKROOT)/Developer/Library/Frameworks",
517534
"$(inherited)",
@@ -524,14 +541,15 @@
524541
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
525542
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
526543
PRODUCT_NAME = "$(TARGET_NAME)";
527-
SWIFT_VERSION = 2.3;
544+
SWIFT_VERSION = 3.0;
528545
};
529546
name = Debug;
530547
};
531548
607FACF41AFB9204008FA782 /* Release */ = {
532549
isa = XCBuildConfiguration;
533550
baseConfigurationReference = 739B56FA57C1D0E13427B629 /* Pods-FazeKit_Tests.release.xcconfig */;
534551
buildSettings = {
552+
DEVELOPMENT_TEAM = B89H5L73N6;
535553
FRAMEWORK_SEARCH_PATHS = (
536554
"$(SDKROOT)/Developer/Library/Frameworks",
537555
"$(inherited)",
@@ -540,7 +558,7 @@
540558
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
541559
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)";
542560
PRODUCT_NAME = "$(TARGET_NAME)";
543-
SWIFT_VERSION = 2.3;
561+
SWIFT_VERSION = 3.0;
544562
};
545563
name = Release;
546564
};

Example/FazeKit/AppDelegate.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,35 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
2727
var window: UIWindow?
2828

2929

30-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
31-
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
30+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
31+
self.window = UIWindow(frame: UIScreen.main.bounds)
3232

3333
self.window?.rootViewController = UINavigationController(rootViewController: MenuViewController())
34-
self.window?.backgroundColor = UIColor.blackColor()
34+
self.window?.backgroundColor = UIColor.black
3535
self.window?.makeKeyAndVisible()
3636

3737
return true
3838
}
3939

40-
func applicationWillResignActive(application: UIApplication) {
40+
func applicationWillResignActive(_ application: UIApplication) {
4141
// 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.
4242
// 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.
4343
}
4444

45-
func applicationDidEnterBackground(application: UIApplication) {
45+
func applicationDidEnterBackground(_ application: UIApplication) {
4646
// 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.
4747
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
4848
}
4949

50-
func applicationWillEnterForeground(application: UIApplication) {
50+
func applicationWillEnterForeground(_ application: UIApplication) {
5151
// 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.
5252
}
5353

54-
func applicationDidBecomeActive(application: UIApplication) {
54+
func applicationDidBecomeActive(_ application: UIApplication) {
5555
// 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.
5656
}
5757

58-
func applicationWillTerminate(application: UIApplication) {
58+
func applicationWillTerminate(_ application: UIApplication) {
5959
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
6060
}
6161

Example/FazeKit/MenuViewController.swift

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,62 @@
2222
import UIKit
2323
import FazeKit
2424

25-
class MenuViewController: UIViewController {
26-
25+
class MenuViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
26+
enum MenuItem {
27+
case jailbreak
28+
}
29+
30+
let items: [MenuItem] = [.jailbreak]
31+
32+
let tableView = UITableView()
33+
static let cellReuseIdentifier = "MenuTableViewCell"
34+
2735
override func viewDidLoad() {
2836
super.viewDidLoad()
2937

3038
self.title = "FazeKit"
31-
self.view.backgroundColor = UIColor.whiteColor()
39+
self.view.backgroundColor = UIColor.white
40+
41+
self.tableView.dataSource = self
42+
self.tableView.delegate = self
43+
self.tableView.tableFooterView = UIView()
44+
self.view.addSubview(self.tableView)
3245
}
3346

47+
override func viewDidLayoutSubviews() {
48+
super.viewDidLayoutSubviews()
49+
50+
self.tableView.frame = self.view.bounds
51+
}
52+
3453
override func didReceiveMemoryWarning() {
3554
super.didReceiveMemoryWarning()
36-
// Dispose of any resources that can be recreated.
55+
print("WARNING: Memory warning.")
3756
}
3857

58+
// MARK: UITableViewDataSource
59+
60+
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
61+
return self.items.count
62+
}
63+
64+
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
65+
let cell = tableView.dequeueReusableCell(withIdentifier: MenuViewController.cellReuseIdentifier) ?? UITableViewCell(style: UITableViewCellStyle.value1, reuseIdentifier: MenuViewController.cellReuseIdentifier)
66+
67+
let item = self.items[indexPath.row]
68+
switch item {
69+
case .jailbreak:
70+
cell.textLabel?.text = "Jailbroken"
71+
cell.detailTextLabel?.text = UIDevice.isJailbroken() ? "Yes" : "No"
72+
}
73+
74+
return cell
75+
}
76+
77+
// MARK: UITableViewDelegate
78+
79+
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
80+
tableView.deselectRow(at: indexPath, animated: true)
81+
}
3982
}
4083

0 commit comments

Comments
 (0)