I hereby claim:
- I am gregheo on github.
- I am gregheo (https://keybase.io/gregheo) on keybase.
- I have a public key whose fingerprint is 1A52 D760 6FDD D32E 2B2A D269 F17C 8DA5 8AFF CE57
To claim this, I am signing this object:
import Foundation | |
let encodedString = "data=%7B%0D%0A%22coffee%22%3A%20%22coffee%22%2C%0D%0A%22beer%22%3A%20%22beer%22%2C%0D%0A%22has_bylaws%22%3A%20true%0D%0A%7D%0D%0A" | |
guard let c = URLComponents(string: "http://fake.com/?" + encodedString) else { | |
fatalError("could not generate url components! :(") | |
} | |
for item in c.queryItems ?? [] { | |
print("Got key \(item.name) with value \(item.value)") |
/* | |
@objc and dynamic dispatch demo | |
From the article "@objc, Swift, and the Depths of Dynamic Dispatch" | |
https://swiftunboxed.com/interop/objc-dynamic/ | |
*/ | |
import Foundation | |
class ToObjcOrNotObjc { | |
@discardableResult |
#include <stdio.h> | |
#include <math.h> | |
int main(void) { | |
double const number = 8.0; | |
for (double i = number; i < number * 2 + 1; ++i) { | |
printf("remainder(%2.0f, %2.0f) = %2.0f\n", i, number, remainder(i, number)); | |
} |
I hereby claim:
To claim this, I am signing this object:
import UIKit | |
import CoreImage | |
class CustomFilter : CIFilter { | |
var privateInputImage: CIImage? | |
var inputImage: CIImage? { | |
set { | |
privateInputImage = newValue | |
} | |
get { |
Testing and iOS: References
Effects of TDD:
About Unit Testing:
Session 409, Testing in Xcode 5:
-(void) uploadVideo { | |
NSMutableDictionary *fbParams = @{@"title": @"Video Title", | |
@"description": @"Video Description", | |
@"json", @"format"}; | |
FBVideoUpload *faceBookVideoUpload = [[FBVideoUpload alloc] init]; | |
faceBookVideoUpload.apiKey = APP_KEY; | |
faceBookVideoUpload.appSecret = APP_SECRET; | |
faceBookVideoUpload.accessToken = accessToken; | |
[faceBookVideoUpload startUploadWithURL:videoURL fbParams delegate:self]; |