This document introduces CardioMerkari Inc. and their Cardio health kit wrapper library. Cardio is an open source Swift library that provides a simple interface for accessing HealthKit functionality related to workouts. It handles authorization, reading workout data from sensors, and saving workout data to HealthKit. The document provides information on using Cardio such as initializing it with a context, setting up authorization, starting and ending workout sessions, handling sensor updates, and saving workout data.
This document introduces CardioMerkari Inc. and their Cardio health kit wrapper library. Cardio is an open source Swift library that provides a simple interface for accessing HealthKit functionality related to workouts. It handles authorization, reading workout data from sensors, and saving workout data to HealthKit. The document provides information on using Cardio such as initializing it with a context, setting up authorization, starting and ending workout sessions, handling sensor updates, and saving workout data.
13. // Storyboards.swift
extension UIStoryboard {
struct Scene {
enum Wizard : String, StoryboardScene {
static let storyboardName = "Wizard"
case CreateAccount = "CreateAccount"
static func createAccountViewController() -> CreateAccViewController {
return Wizard.CreateAccount.viewController() as! CreateAccViewController
}
case ValidatePassword = "Validate_Password"
static func validatePasswordViewController() -> UIViewController {
return Wizard.ValidatePassword.viewController()
}
}
enum Message : String, StoryboardScene {
static let storyboardName = "Message"
case Composer = "Composer"
static func composerViewController() -> UIViewController {
return Message.Composer.viewController()
}
case URLChooser = "URLChooser"
static func urlChooserViewController() -> XXPickerViewController {
return Message.URLChooser.viewController() as! XXPickerViewController
}
}
}
struct Segue {
enum Message : String {
case Custom = "Custom"
case Back = "Back"
case NonCustom = "NonCustom"
}
}
}
Storyboard IDに対応
Storyboardファイルに対応
via https://github.com/AliSoftware/SwiftGen
14. Usage
// Initial VC
let initialVC = UIStoryboard.Scene.Wizard.initialViewController()
// Generic ViewController constructor, returns a UIViewController instance
let validateVC = UIStoryboard.Scene.Wizard.ValidatePassword.viewController()
// Dedicated type var that returns the right type of VC (CreateAccViewController here)
let createVC = UIStoryboard.Scene.Wizard.createAccountViewController()
override func prepareForSegue(_ segue: UIStoryboardSegue, sender sender: AnyObject?) {
switch UIStoryboard.Segue.Message(rawValue: segue.identifier)! {
case .Custom:
// Prepare for your custom segue transition
case .Back:
// Prepare for your custom segue transition
case .NonCustom:
// Prepare for your custom segue transition
}
}
via https://github.com/AliSoftware/SwiftGen