Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
247 changes: 112 additions & 135 deletions Loop.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Loop.xcodeproj/xcshareddata/xcschemes/WatchApp.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "43A943711B926B7B0051FA24"
BuildableName = "WatchApp.app"
BlueprintName = "WatchApp"
ReferencedContainer = "container:Loop.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand All @@ -102,7 +101,6 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "43A943711B926B7B0051FA24"
BuildableName = "WatchApp.app"
BlueprintName = "WatchApp"
ReferencedContainer = "container:Loop.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
Expand Down
62 changes: 7 additions & 55 deletions Loop/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
import UIKit
import LoopKit

final class AppDelegate: UIResponder, UIApplicationDelegate, WindowProvider {
var window: UIWindow?
final class AppDelegate: UIResponder, UIApplicationDelegate {

let loopAppManager = LoopAppManager()

private(set) var launchOptions: [UIApplication.LaunchOptionsKey: Any]?

private let loopAppManager = LoopAppManager()
private let log = DiagnosticLog(category: "AppDelegate")

// MARK: - UIApplicationDelegate - Initialization
Expand All @@ -22,45 +24,9 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, WindowProvider {

setenv("CFNETWORK_DIAGNOSTICS", "3", 1)

log.default("lastPathComponent = %{public}@", String(describing: Bundle.main.appStoreReceiptURL?.lastPathComponent))

loopAppManager.initialize(windowProvider: self, launchOptions: launchOptions)
loopAppManager.launch()
return loopAppManager.isLaunchComplete
// Avoid doing full initialization when running tests
if ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] == nil {
loopAppManager.initialize(windowProvider: self, launchOptions: launchOptions)
loopAppManager.launch()
return loopAppManager.isLaunchComplete
} else {
return true
}
}

// MARK: - UIApplicationDelegate - Life Cycle

func applicationDidBecomeActive(_ application: UIApplication) {
log.default(#function)
self.launchOptions = launchOptions

loopAppManager.didBecomeActive()
}

func applicationWillResignActive(_ application: UIApplication) {
log.default(#function)
}

func applicationDidEnterBackground(_ application: UIApplication) {
log.default(#function)
}

func applicationWillEnterForeground(_ application: UIApplication) {
log.default(#function)

loopAppManager.askUserToConfirmLoopReset()
}

func applicationWillTerminate(_ application: UIApplication) {
log.default(#function)
return true
}

// MARK: - UIApplicationDelegate - Environment
Expand Down Expand Up @@ -91,20 +57,6 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, WindowProvider {

completionHandler(loopAppManager.handleRemoteNotification(userInfo as? [String: AnyObject]) ? .noData : .failed)
}

// MARK: - UIApplicationDelegate - Deeplinking

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
loopAppManager.handle(url)
}

// MARK: - UIApplicationDelegate - Continuity

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
log.default(#function)

return loopAppManager.userActivity(userActivity, restorationHandler: restorationHandler)
}

// MARK: - UIApplicationDelegate - Interface

Expand Down
2 changes: 1 addition & 1 deletion Loop/Extensions/ChartSettings+Loop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Copyright © 2017 LoopKit Authors. All rights reserved.
//

import SwiftCharts
import LoopKitUI

extension ChartSettings {
static var `default`: ChartSettings {
Expand Down
20 changes: 0 additions & 20 deletions Loop/Extensions/Image+Optional.swift

This file was deleted.

8 changes: 6 additions & 2 deletions Loop/Extensions/UIAlertController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extension UIAlertController {
self.init(
title: NSLocalizedString("Add Pump", comment: "Action sheet title selecting Pump"),
message: nil,
preferredStyle: .actionSheet
preferredStyle: .alert
)

for availablePumpManager in availablePumpManagers {
Expand All @@ -55,6 +55,8 @@ extension UIAlertController {
}
))
}

addCancelAction()
}

/// Initializes an action sheet-styled controller for selecting a CGMManager
Expand All @@ -67,7 +69,7 @@ extension UIAlertController {
self.init(
title: NSLocalizedString("Add CGM", comment: "Action sheet title selecting CGM"),
message: nil,
preferredStyle: .actionSheet
preferredStyle: .alert
)

for availableCGMManager in availableCGMManagers.sorted(by: {$0.localizedTitle < $1.localizedTitle}) {
Expand All @@ -79,6 +81,8 @@ extension UIAlertController {
}
))
}

addCancelAction()
}

internal convenience init(deleteCGMManagerHandler handler: @escaping (_ isDeleted: Bool) -> Void) {
Expand Down
23 changes: 19 additions & 4 deletions Loop/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,34 @@
<string>NewCarbEntryIntent</string>
<string>ViewLoopStatus</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UIBackgroundModes</key>
<array>
<string>bluetooth-central</string>
<string>processing</string>
<string>remote-notification</string>
<string>audio</string>
</array>
<key>UIDesignRequiresCompatibility</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down
Loading