This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert UIColor to Color | |
import SwiftUI | |
extension UIColor { | |
var color: Color { | |
get { | |
let rgbColours = self.cgColor.components | |
return Color( | |
red: Double(rgbColours![0]), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@UIApplicationMain | |
final class AppDelegate: UIResponder, UIApplicationDelegate { | |
let healthKitManager = HealthKitManager() | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
if onboardingComplete { | |
healthKitManager.requestAccessWithCompletion() { success, error in | |
if success { print("HealthKit access granted") } | |
else { print("Error requesting access to HealthKit: \(error)") } | |
} |