What do you mean by "Water Lock"? If you mean the feature that the app reverts to the clock when you stick it in water then check out:
HKWorkoutConfiguration *configuration = [[HKWorkoutConfiguration alloc] init];
configuration.activityType = HKWorkoutActivityTypeSwimming;
configuration.locationType = HKWorkoutSessionLocationTypeIndoor;
NSError *error = nil;
hKSession = [[HKWorkoutSession alloc] initWithConfiguration:configuration error:&error];
if (hKSession == nil) {
/
NSLog(@"*** Unable to create the workout session: %@ ***", error.localizedDescription);
return; /
}
hKSession.delegate = self;
[healthStore startWorkoutSession:hKSession];
But be sure to turn it off after you are done with:
if(hKSession!=nil)
[healthStore endWorkoutSession:hKSession];
-(void)workoutSession:(HKWorkoutSession *)workoutSession didChangeToState:(HKWorkoutSessionState)toState fromState:(HKWorkoutSessionState)fromState date:(NSDate *)date{
NSLog(@"workoutsession state changed to state %ld",(long)toState);
if(toState==3){
workoutSession=nil;
hKSession=nil;
}
}