This file contains 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
// Construct startDate and endDate objects with NSDateComponents. | |
// See this article for more http://iaintheindie.com/2014/08/08/useful-nsdate-nscalendar-tricks/#StartEnd_of_the_Week | |
// For more examples of working with HealthKit see https://developer.apple.com/library/content/samplecode/Fit/Introduction/Intro.html | |
let workoutPredicate = NSPredicate(format: "(%K == %d) OR (%K == %d)", | |
HKPredicateKeyPathWorkoutType, | |
HKWorkoutActivityType.functionalStrengthTraining.rawValue, | |
HKPredicateKeyPathWorkoutType, | |
HKWorkoutActivityType.traditionalStrengthTraining.rawValue) |
This file contains 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
import Foundation | |
import PlaygroundSupport | |
/// A thread-safe array. | |
public class SynchronizedArray<Element> { | |
private let queue = DispatchQueue(label: "io.zamzam.ZamzamKit.SynchronizedArray", attributes: .concurrent) | |
private var array = [Element]() | |
public init() { } | |