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/Foundation.h> | |
/* Test I had to do, Took me way to long so thought I would draft it up in objective c | |
basically getting the remainder using the % modular type. | |
loop through to 100, if number is divisible by 3 print buzz if its divisible by 5 print fizz and if its both print buzz fizz. Else just print the number. | |
*/ | |
int main(int argc, char *argv[]) { |
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
NSString *string = [NSString alloc] initWithStringFormat:@"%i", 3]; |
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
// Playground - noun: a place where people can play | |
import UIKit | |
let numberFormatter = NSNumberFormatter() | |
numberFormatter.numberStyle = NSNumberFormatterStyle.CurrencyStyle | |
numberFormatter.formatterBehavior = NSNumberFormatterBehavior.Behavior10_4 | |
numberFormatter.currencyCode = "GBP" | |
numberFormatter.generatesDecimalNumbers = true | |
numberFormatter.locale = NSLocale(localeIdentifier: "en_UK") |
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
// | |
// HealthKitFormatter.m | |
// HealthKitExample | |
// | |
// Created by Scott Roberts on 24/07/2014. | |
// Copyright (c) 2014 Scottr. All rights reserved. | |
// | |
#import "HealthKitFormatter.h" |
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
-(BOOL)checkAuthorisationForCharacteristicType:(HKCharacteristicType *)characteristicType{ | |
HKAuthorizationStatus authStatus = [self.store authorizationStatusForType:characteristicType]; | |
if(authStatus == HKAuthorizationStatusSharingAuthorized){ | |
return YES; | |
}else{ | |
return NO; | |
} |
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
for i in 1...100{ | |
let divisbleBy3 = i%3 | |
let divisbleBy5 = i%5 | |
if divisbleBy3 == 0 && divisbleBy5 == 0{ // no remainder | |
println("fizz buzz") | |
}else if divisbleBy3 == 0{ | |
println("fizz") | |
}else if divisbleBy5 == 0{ | |
println("buzz") |
NewerOlder