This file contains hidden or 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
// | |
// Reindeer.h | |
// ReindeerGamesObjC | |
// | |
// Created by Paul Wilkinson on 9/02/2016. | |
// Copyright © 2016 Paul Wilkinson. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
This file contains hidden or 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
// | |
// BTManager.swift | |
// TableTest | |
// | |
// Created by Paul Wilkinson on 8/03/2016. | |
// Copyright © 2016 Paul Wilkinson. All rights reserved. | |
// | |
import Foundation | |
import CoreBluetooth |
This file contains hidden or 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 XCPlayground | |
import Foundation | |
XCPlaygroundPage.currentPage.needsIndefiniteExecution=true | |
var imageURL = NSURL(string : "https://www.nasa.gov/sites/default/files/wave_earth_mosaic_3.jpg") | |
if let url = imageURL{ | |
let task = NSURLSession.sharedSession().dataTaskWithURL(url, completionHandler: { (data, response, error) in |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10116" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> | |
<dependencies> | |
<deployment identifier="iOS"/> | |
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> | |
<capability name="Constraints to layout margins" minToolsVersion="6.0"/> | |
</dependencies> | |
<scenes> | |
<!--View Controller--> | |
<scene sceneID="tne-QT-ifu"> |
This file contains hidden or 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
2016-04-30 10:52:01.705 CDTEst[29411:1815405] 2016-04-30 00:52:01 +0000 | |
2016-04-30 10:52:01.706 CDTEst[29411:1815405] Saturday | |
2016-04-30 10:52:01.706 CDTEst[29411:1815405] 2016-03-31 23:52:01 +0000 | |
2016-04-30 10:52:01.706 CDTEst[29411:1815405] Friday | |
2016-04-30 10:52:01.706 CDTEst[29411:1815405] 2016-04-01 23:52:01 +0000 | |
2016-04-30 10:52:01.707 CDTEst[29411:1815405] Saturday | |
2016-04-30 10:52:01.707 CDTEst[29411:1815405] 2016-04-03 00:52:01 +0000 | |
2016-04-30 10:52:01.707 CDTEst[29411:1815405] Sunday | |
2016-04-30 10:52:01.707 CDTEst[29411:1815405] 2016-04-04 00:52:01 +0000 | |
2016-04-30 10:52:01.707 CDTEst[29411:1815405] Monday |
This file contains hidden or 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 *url = @"https://www.google.com"; | |
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; | |
// [request setValue:@"api.example.com" forHTTPHeaderField:@"Host"]; | |
[request setValue:@"http://www.examplegood.com/" forHTTPHeaderField:@"Referer"]; | |
[request setURL:[NSURL URLWithString:url]]; | |
[request setHTTPMethod: @"GET"]; | |
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { | |
NSLog(@"%@",response); | |
NSLog(@"%@",error); | |
NSString* resultStr = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; |
This file contains hidden or 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
let vowels=["a","e","i","o","u"] | |
let vowelSet = NSCharacterSet(charactersInString: "aeiou") | |
func findVowelAndReplace(start: NSString, end: NSString) -> [String] { | |
let vowelPosition = end.rangeOfCharacterFromSet(vowelSet) | |
var outputArray = [String]() | |
if vowelPosition.location != NSNotFound { | |
let newEnd = end.substringFromIndex(vowelPosition.location+1) | |
let newStart = end.substringToIndex(vowelPosition.location) | |
for vowel in vowels { |
This file contains hidden or 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
// | |
// ViewController.swift | |
// AdTableTest | |
// | |
// Created by Paul Wilkinson on 15/06/2016. | |
// Copyright © 2016 Paul Wilkinson. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or 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
if ([self canFlash]) { | |
self.flashLabel.text = self.sentences[self.sentenceCounter][self.wordCounter]; | |
self.wordCounter++; | |
if (self.wordCounter == [self.sentences[self.sentenceCounter] count]) { | |
self.sentenceCounter++; | |
self.wordCounter = 0; | |
} | |
} |
This file contains hidden or 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
// | |
// AppDelegate.m | |
// DefaultsTest | |
// | |
// Created by Paul Wilkinson on 24/06/2016. | |
// Copyright © 2016 Paul Wilkinson. All rights reserved. | |
// | |
#import "AppDelegate.h" |