Skip to content

Instantly share code, notes, and snippets.

@NSAmit
NSAmit / HealthRecordAccess.swift
Last active March 8, 2019 01:16
Code to request authorization for Clinical Records
// Make sure you import HealthKit
// Get the HKHealthStore reference. Must be single reference in your app.
let healthStore = HKHealthStore()
// Create required Record Type's equivalent HKClinicalType using clinicalType func of HKObjectType
guard let allergyRecord = HKObjectType.clinicalType(forIdentifier: .allergyRecord),
let medicationRecord = HKObjectType.clinicalType(forIdentifier: .medicationRecord),
let conditionRecord = HKObjectType.clinicalType(forIdentifier: .conditionRecord),
@NSAmit
NSAmit / BuildNumber.sh
Created September 5, 2018 00:43
Code to increment build number automatically
# Assume that I have MyApp as a repository and my project root folder is also MyApp.
echo "Lets update the build number for featire releases"
echo "Creating temp folder as ~/Documents/TempCadenceIosBuildIncrement/"
mkdir ~/Documents/TempIosBuildIncrement/
cd ~/Documents/TempIosBuildIncrement/
echo "Cloning Repo of master branch....."
git clone https://gitlab.com/MyApp.git # clone your master branch here.
echo "Clonned successfully. Updating build number now using PlistBuddy"
cd MyApp/ # get into the project directory.