Skip to content

Commit 5cdf2d3

Browse files
authored
Merge pull request #43 from loudnate/dev
Version 0.7.0
2 parents 2dab733 + dc9f9ef commit 5cdf2d3

36 files changed

+475
-463
lines changed

.travis.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
language: objective-c
2-
osx_image: xcode7.3
3-
before_deploy:
4-
- carthage build --no-skip-current
2+
osx_image: xcode8
53

6-
cache: cocoapods
7-
podfile: Example/Podfile
4+
# cache: cocoapods
5+
# podfile: Example/Podfile
86

97
before_install:
10-
- gem install cocoapods # Since Travis is not always on latest version
11-
- pod install --project-directory=Example
8+
# - gem install cocoapods # Since Travis is not always on latest version
9+
# - pod install --project-directory=Example
1210

1311
script:
14-
- set -o pipefail && xcodebuild -workspace Example/xDripG5.xcworkspace -scheme xDripG5-Example -sdk iphonesimulator -destination name="iPhone 6" ONLY_ACTIVE_ARCH=NO | xcpretty
15-
- xctool -project xDripG5.xcodeproj -scheme xDripG5 -sdk iphonesimulator9.3 build test
16-
- pod lib lint
12+
# Build cocoapods example project
13+
# - set -o pipefail && xcodebuild -workspace Example/xDripG5.xcworkspace -scheme xDripG5-Example -sdk iphonesimulator -destination name="iPhone SE" ONLY_ACTIVE_ARCH=NO | xcpretty
14+
# Build Travis project and run tests
15+
- xcodebuild -project xDripG5.xcodeproj -scheme xDripG5 -sdk iphonesimulator10.0 build -destination name="iPhone SE" test
16+
# - pod lib lint

Example/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- xDripG5 (0.6.0)
2+
- xDripG5 (0.7.0)
33

44
DEPENDENCIES:
55
- xDripG5 (from `../`)
@@ -9,8 +9,8 @@ EXTERNAL SOURCES:
99
:path: ../
1010

1111
SPEC CHECKSUMS:
12-
xDripG5: ef0c18aa2916c968645fc20313e402b13eb5c845
12+
xDripG5: b0bfa28e1dc510799d919ab6a67badb56a024247
1313

1414
PODFILE CHECKSUM: 6b30cba971694d5258509315fb52eb645c9bc5e3
1515

16-
COCOAPODS: 1.0.1
16+
COCOAPODS: 1.1.0.beta.2

Example/xDripG5.xcodeproj/project.pbxproj

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 46;
6+
objectVersion = 48;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -147,11 +147,12 @@
147147
isa = PBXProject;
148148
attributes = {
149149
LastSwiftUpdateCheck = 0720;
150-
LastUpgradeCheck = 0720;
150+
LastUpgradeCheck = 0800;
151151
ORGANIZATIONNAME = "Nathan Racklyeft";
152152
TargetAttributes = {
153153
607FACCF1AFB9204008FA782 = {
154154
CreatedOnToolsVersion = 6.3.1;
155+
LastSwiftMigration = 0800;
155156
SystemCapabilities = {
156157
com.apple.BackgroundModes = {
157158
enabled = 1;
@@ -161,7 +162,7 @@
161162
};
162163
};
163164
buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "xDripG5" */;
164-
compatibilityVersion = "Xcode 3.2";
165+
compatibilityVersion = "Xcode 8.0";
165166
developmentRegion = English;
166167
hasScannedForEncodings = 0;
167168
knownRegions = (
@@ -204,7 +205,7 @@
204205
);
205206
runOnlyForDeploymentPostprocessing = 0;
206207
shellPath = /bin/sh;
207-
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
208+
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
208209
showEnvVarsInLog = 0;
209210
};
210211
2FC4228A9369221D367ED688 /* [CP] Copy Pods Resources */ = {
@@ -286,8 +287,10 @@
286287
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
287288
CLANG_WARN_EMPTY_BODY = YES;
288289
CLANG_WARN_ENUM_CONVERSION = YES;
290+
CLANG_WARN_INFINITE_RECURSION = YES;
289291
CLANG_WARN_INT_CONVERSION = YES;
290292
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
293+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
291294
CLANG_WARN_UNREACHABLE_CODE = YES;
292295
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
293296
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -331,8 +334,10 @@
331334
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
332335
CLANG_WARN_EMPTY_BODY = YES;
333336
CLANG_WARN_ENUM_CONVERSION = YES;
337+
CLANG_WARN_INFINITE_RECURSION = YES;
334338
CLANG_WARN_INT_CONVERSION = YES;
335339
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
340+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
336341
CLANG_WARN_UNREACHABLE_CODE = YES;
337342
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
338343
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -351,6 +356,7 @@
351356
IPHONEOS_DEPLOYMENT_TARGET = 9.3;
352357
MTL_ENABLE_DEBUG_INFO = NO;
353358
SDKROOT = iphoneos;
359+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
354360
VALIDATE_PRODUCT = YES;
355361
};
356362
name = Release;
@@ -359,12 +365,14 @@
359365
isa = XCBuildConfiguration;
360366
baseConfigurationReference = F3147B948B4F90A741304461 /* Pods-xDripG5_Example.debug.xcconfig */;
361367
buildSettings = {
368+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
362369
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
363370
INFOPLIST_FILE = xDripG5/Info.plist;
364371
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
365372
MODULE_NAME = ExampleApp;
366373
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.xDripG5-Example";
367374
PRODUCT_NAME = "$(TARGET_NAME)";
375+
SWIFT_VERSION = 3.0;
368376
TARGETED_DEVICE_FAMILY = "1,2";
369377
};
370378
name = Debug;
@@ -373,12 +381,14 @@
373381
isa = XCBuildConfiguration;
374382
baseConfigurationReference = CFBD776BFE02F42998A8820B /* Pods-xDripG5_Example.release.xcconfig */;
375383
buildSettings = {
384+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
376385
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
377386
INFOPLIST_FILE = xDripG5/Info.plist;
378387
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
379388
MODULE_NAME = ExampleApp;
380389
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.xDripG5-Example";
381390
PRODUCT_NAME = "$(TARGET_NAME)";
391+
SWIFT_VERSION = 3.0;
382392
TARGETED_DEVICE_FAMILY = "1,2";
383393
};
384394
name = Release;

Example/xDripG5.xcodeproj/xcshareddata/xcschemes/xDripG5-Example.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 = "0720"
3+
LastUpgradeVersion = "0800"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Example/xDripG5/AppDelegate.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,73 +16,73 @@ class AppDelegate: UIResponder, UIApplicationDelegate, TransmitterDelegate {
1616
var window: UIWindow?
1717

1818
static var sharedDelegate: AppDelegate {
19-
return UIApplication.sharedApplication().delegate as! AppDelegate
19+
return UIApplication.shared.delegate as! AppDelegate
2020
}
2121

2222
var transmitter: Transmitter?
2323

24-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
24+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
2525

2626
transmitter = Transmitter(
27-
ID: NSUserDefaults.standardUserDefaults().transmitterID,
28-
passiveModeEnabled: NSUserDefaults.standardUserDefaults().passiveModeEnabled
27+
ID: UserDefaults.standard.transmitterID,
28+
passiveModeEnabled: UserDefaults.standard.passiveModeEnabled
2929
)
30-
transmitter?.stayConnected = NSUserDefaults.standardUserDefaults().stayConnected
30+
transmitter?.stayConnected = UserDefaults.standard.stayConnected
3131
transmitter?.delegate = self
3232

3333
return true
3434
}
3535

36-
func applicationWillResignActive(application: UIApplication) {
36+
func applicationWillResignActive(_ application: UIApplication) {
3737
// 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.
3838
// 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.
3939
}
4040

41-
func applicationDidEnterBackground(application: UIApplication) {
41+
func applicationDidEnterBackground(_ application: UIApplication) {
4242
// 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.
4343
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
4444

45-
if let transmitter = transmitter where !transmitter.stayConnected {
45+
if let transmitter = transmitter , !transmitter.stayConnected {
4646
transmitter.stopScanning()
4747
}
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
transmitter?.resumeScanning()
5858
}
5959

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

6464
// MARK: - TransmitterDelegate
6565

66-
private let dateFormatter: NSDateFormatter = {
67-
let dateFormatter = NSDateFormatter()
66+
private let dateFormatter: DateFormatter = {
67+
let dateFormatter = DateFormatter()
6868

6969
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
70-
dateFormatter.locale = NSLocale(localeIdentifier: "en_US_POSIX")
70+
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
7171

7272
return dateFormatter
7373
}()
7474

75-
func transmitter(transmitter: Transmitter, didError error: ErrorType) {
75+
func transmitter(_ transmitter: Transmitter, didError error: Error) {
7676
if let vc = window?.rootViewController as? TransmitterDelegate {
77-
dispatch_async(dispatch_get_main_queue()) {
77+
DispatchQueue.main.async {
7878
vc.transmitter(transmitter, didError: error)
7979
}
8080
}
8181
}
8282

83-
func transmitter(transmitter: Transmitter, didRead glucose: Glucose) {
83+
func transmitter(_ transmitter: Transmitter, didRead glucose: Glucose) {
8484
if let vc = window?.rootViewController as? TransmitterDelegate {
85-
dispatch_async(dispatch_get_main_queue()) {
85+
DispatchQueue.main.async {
8686
vc.transmitter(transmitter, didRead: glucose)
8787
}
8888
}

0 commit comments

Comments
 (0)