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
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
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Ethics towards AI in product and experience design
skipperchong
2
370
[SF Ruby Conf 2025] Rails X
palkan
2
1.4k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
510
The Cult of Friendly URLs
andyhume
79
7k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
57k
A Soul's Torment
seathinner
7
3.6k
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