Skip to content

Instantly share code, notes, and snippets.

View sourov2008's full-sized avatar
🌴
On vacation

Shourob Datta sourov2008

🌴
On vacation
  • Brain Station 23 Ltd.
  • Dhaka, Bangladesh
View GitHub Profile
@chris-redbeed
chris-redbeed / UIColorToColor.swift
Last active March 6, 2024 22:05
SwiftUI - UIColor to Color
// Convert UIColor to Color
import SwiftUI
extension UIColor {
var color: Color {
get {
let rgbColours = self.cgColor.components
return Color(
red: Double(rgbColours![0]),
@phatblat
phatblat / AppDelegate.swift
Last active February 2, 2025 15:25
Example of creating HKObserverQuery and enabling background delivery for multiple HKObjectType
@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)") }
}