Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
iOS Overview
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Chris Schepman
June 14, 2012
210
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
iOS Overview
Chris Schepman
June 14, 2012
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
Believing is Seeing
oripsolob
1
240
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Odyssey Design
rkendrick25
PRO
2
870
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
300
Git: the NoSQL Database
bkeepers
PRO
433
67k
Abbi's Birthday
coloredviolet
4
10k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Transcript
An iOS Overview or ... “Oh shit. I just got
put an iOS project! Help?” Thursday, June 14, 12
Quick Resources • Stanford CS193p • cs193p.stanford.edu • WWDC Videos
• Apple Docs (In Xcode!) Thursday, June 14, 12
Objective-C • It is weird. • But you know C
right? • err.. How about Javascript? • .. SmallTalk? Thursday, June 14, 12
“Message Passing” wtf? [activityIndicator startAnimating]; //verbosity cell.textLabel.text = [[songList objectAtIndex:indexPath.row]
title]; //this won’t work! not for methods activityIndicator.startAnimating(); //properties are happier though! activityIndicator.color = [UIColor ...]; Thursday, June 14, 12
Blocks! • So good. [UIView animateWithDuration:.5 animations:^{ self.quoteLabel.alpha = 0;
self.quoteWeb.alpha = 0; self.leftQuote.alpha = 0; self.rightQuote.alpha = 0; if (!isBookmarked) { self.bookmarkImage.alpha = 0; } } completion:^(BOOL finished) { //... }]; Thursday, June 14, 12
Manual Memory Management? • Reference Counting • http://www.raywenderlich.com/5677/ beginning-arc-in-ios-5-part-1 •
ARC is good Thursday, June 14, 12
Make it pretty! [UIView animateWithDuration:.5 animations:^{ //any property in here!
}]; //UIViewAnimationOptionCurveEaseInOut //UIViewAnimationOptionCurveLinear Thursday, June 14, 12
DATA • Core Data • Massive • Fast (speed) •
Slow (development) • Not Flexible • Very Good Documentation Thursday, June 14, 12
DATA - Cont’d Thursday, June 14, 12
DATA - Cont’d • NSUserDefaults • Key Value Store •
Fast (development) • Slow (speed) • Not Real Queries • Good Enough? Thursday, June 14, 12
DATA - Cont’d • Write [[NSUserDefaults standardUserDefaults] setObject:self.bookmarks forKey:@"bookmarks"]; [[NSUserDefaults
standardUserDefaults] synchronize]; • Read self.bookmarks = [[[NSUserDefaults standardUserDefaults] objectForKey:@"bookmarks"] mutableCopy]; Thursday, June 14, 12
DATA - Cont’d • Other Options! • FMDB • https://github.com/ccgus/fmdb
• Objective-C sqlite wrapper • Parse • https://parse.com Thursday, June 14, 12
Text Layout • UILabel doesn’t have a lineHeight property •
UIWebView to the rescue? quoteHTML = @"<html><body style=\"background-color: transparent; font-family: Georgia; line-height: 40px; font-size:18pt; text-shadow: 0px 1px #FFF; text-align: center;\">%@</body></html>"; Thursday, June 14, 12
Must Know Libraries • AFNetworking • https://github.com/AFNetworking/ AFNetworking • Blocks!
Thursday, June 14, 12
Must Know L’s - Cont’d //some function calls this! [self
loadTweetInBackground]; - (void)loadTweetInBackground { [tweetSpinner startAnimating]; latestTweet.text = @""; [NSThread detachNewThreadSelector:@selector(loadTweet) toTarget:self withObject:nil]; } - (void)loadTweet { ! NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [NSThread sleepForTimeInterval:1]; ! NSString *urlString = @"http://api.twitter.com/1/statuses/user_timeline.json? count=1&screen_name=babykettenOR"; ! NSURL *url = [NSURL URLWithString:urlString]; ! NSString *jsonString = [[NSString alloc] initWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil]; ! if (jsonString != nil) { id jsonValue = [jsonString JSONValue]; self.tweet = [[jsonValue objectAtIndex:0] valueForKey:@"text"]; } else { self.tweet = @"Can't reach the internetz! Sing pretty!"; } ! [self performSelectorOnMainThread:@selector(didFinishLoadingTweet) withObject:nil waitUntilDone:NO]; ! [jsonString release]; ! [pool release]; } - (void)didFinishLoadingTweet { ! [tweetSpinner stopAnimating]; latestTweet.text = tweet; } Thursday, June 14, 12
Must Know L’s - Cont’d NSURL *url = [NSURL URLWithString:@"https://gdata.youtube.com/feeds/api/standardfeeds/top_rated?
alt=json?time=this_week"]; NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:url]; [urlRequest setValue:@"gzip" forHTTPHeaderField:@"Accept-Encoding"]; MBJSONRequest *jsonRequest = [[[MBJSONRequest alloc] init] autorelease]; [jsonRequest performJSONRequest:urlRequest completionHandler:^(id responseJSON, NSError *error) { if (error != nil) { NSLog(@"Error requesting top-rated videos: %@", error); } else { NSArray *videos = [[responseJSON objectForKey:@"feed"] objectForKey:@"entry"]; for (NSDictionary *videoInfo in videos) { NSString *title = [[videoInfo objectForKey:@"title"] objectForKey:@"$t"]; NSString *author = [[[[videoInfo objectForKey:@"author"] objectAtIndex:0] objectForKey:@"name"] objectForKey:@"$t"]; NSLog(@"'%@' by %@", title, author); } } }]; Thursday, June 14, 12
Must Know L’s - Cont’d • JSONKit • https://github.com/johnezang/JSONKit •
faster than binary .plist! • Nineveh.gl (http://nineveh.gl/) • Import super common models • 3D framework worth exploring (young) Thursday, June 14, 12
Must Know L’s - Cont’d • http://iosboilerplate.com/ • MBProgressHUD /
SVProgressHUD • AFNetworking • Built-in browser • Lots more Thursday, June 14, 12
Totally Screwed? • You know the Web! • UIWebView •
Titanium/PhoneGap • Clutch - https://clutch.io/ • Mobile Safari! Thursday, June 14, 12
THE END Good Fucking Luck. <3 @cschep Thursday, June 14,
12