- iPhone1,1 — iPhone
- iPhone1,2 — iPhone 3G
- iPhone2,1 — iPhone 3GS
- iPhone3,1 — iPhone 4 (GSM)
- iPhone3,3 — iPhone 4 (CDMA/Verizon/Sprint)
- iPhone4,1 — iPhone 4S
- iPhone5,1 — iPhone 5 (model A1428, AT&T/Canada)
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 | |
extension Data { | |
public var fnv32Hash: UInt32 { | |
return UInt32( self.reduce(0x811c9dc5) { 0x00000000FFFFFFFF & ($0 * 16777619) ^ UInt64($1) } ) | |
} | |
public func fnv32HashString() -> String { | |
return String(format: "%08x", self.fnv32Hash) |
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
When Host.swift was started, it was before we new too much about Swift 3.0, now it has arrived we have a problem... | |
NSHost has been renamed Host when imported into Swift 3.x. We don't want to be a bad Swift citizen and iOS still doesn't have (NS)Host. so we need to rename the project. | |
At this point I am open to any suggestions... the simpler the better IMHO. | |
Add your suggestions here: |
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 - Demos a bug where a cast using `as` causes a, "fatal error: can't unsafeBitCast between types of different sizes" | |
import UIKit | |
protocol Thingable { | |
func getStuff() | |
} | |
enum MyList: Thingable { | |
case One |
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
1. No coverage of Stock price... ever. | |
2. No coverage of carrier contracts or offers... Unless John Legere joins the Apple board I don't want to read his name. | |
3. Never publish patents as news. | |
4. I dont care about US only Apple Pay roll outs. | |
5. Do not commission renderings of UI designs of unreleased products. | |
6. No wish lists. |
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
// | |
// TRVViewController.m | |
// AttString | |
// | |
// Created by Richard Stelling on 02/05/2013. | |
// Copyright (c) 2013 Richard Stelling. All rights reserved. | |
// | |
#import "TRVViewController.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
// Make a [UI]ViewController by just passing the name, the .xib needs to have the same name as the Class howerver (Xcode default) | |
#define MakeViewController(class_and_nib_name) [[class_and_nib_name alloc] initWithNibName:[NSString stringWithUTF8String:#class_and_nib_name] bundle:nil] | |
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
#!/usr/bin/env xcrun swift | |
// | |
// SwiftCommandLineWithNSOperation.swift | |
// SwiftCommandLineWithNSOperation | |
// | |
// Created by Richard Stelling on 27/11/2015. | |
// Copyright © 2015 Richard Stelling. All rights reserved. | |
// |
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+Verbose.h | |
// | |
// An NSString category for overly verbose methods that have little or no practical application. | |
// | |
@interface NSString (Verbose) | |
- (BOOL)isNotEqualToString:(NSString *)aString; |