This document provides an overview of getting started with iOS development using Xcode. It recommends searching Apple's Human Interface Guidelines and downloading the free version of Xcode from the Mac App Store. It describes how to create projects using different templates like Master-Detail or Tabbed. It covers the basics of Xcode's interface and tools. It also provides guidance on working with common UI elements like labels, buttons, and text views. Additional topics covered include debugging, animations, alerts, storyboards, provisioning for device testing, and distributing builds using TestFlight.
3. Before you do anything…
Search Google for…
“Apple Mobile HIG”
Apple’s Mobile Human Interface Guidelines
developer.apple.com/library/ios/doc
umentation/UserExperience/Concep
tual/MobileHIG/
5. Using Xcode
Step One - Get a Mac, any Mac
Step Two - Get Xcode
Download the free version of Xcode from the app
store
Create a free developer account and download
Xcode
developer.apple.com
Register your company and pay for a developer
account to download Xcode betas
26. Working with the
UITextView
Control the keyboard
//make the keyboard display
[textField becomeFirstResponder];
//make the keyboard hide
[textField resignFirstResponder];
27. Working with the
UITextView
Implement optional delegate methods
//Dismiss the keyboard when the return key is tapped
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
if (textField == self.someTextfield) {
[textField resignFirstResponder];
return NO;
}
return YES;
}
//Only allow numeric characters
- (BOOL) textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range
replacementString:(NSString *)newString
{
NSCharacterSet* notNumbers =
[[NSCharacterSet characterSetWithCharactersInString:@"0123456789"]
invertedSet];
NSUInteger location = [newString rangeOfCharacterFromSet:notNumbers].location;
return ( location == NSNotFound );
}
30. Working with the UILabel
Drag and drop the object in IB onto the view
Connect the object in IB to Code
31. Working with the UIButton
Drag and drop the object in IB onto the view
Connect the object in IB to Code
Create an action for the object
32. Working with the
UITextView
Drag and drop the object in IB onto the view
Connect the object in IB to Code
Add the delegate interface to the View
Set the objects delegate as the view
Implement optional delegate methods
44. UIAlertView and its
Delegate
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:
@"Some Title" message:@"Some Alert”
delegate:self
cancelButtonTitle:@“Cancel"
otherButtonTitles:@"Ok", nil];
[alertView show];
Display an Alert
- (void)alertView:(UIAlertView *)alertView
clickedButtonAtIndex: (NSInteger)buttonIndex{
switch (buttonIndex) {
case 0:
NSLog(@"Cancel");
break;
case 1:
NSLog(@"OK");
break;
default:
break;
}
}
Respond to an Alert
45. Storyboards and Nibs (Xibs)
Nibs and Xibs are the same
“N” is for NeXt, “ib” is for Interface Builder
“X” is for XML, “ib” is for Interface Builder
One .xib file for one
Storyboards are like Xibs for multiple UIView
Controllers
48. Binding in Interface Builder
Select the ViewController in
Interface Builder
Navigate to the Identity Inspector
Set the Custom Class Name
Set the Storyboard ID
49. Storyboards and Nibs (Xibs)
Creating a UIViewController from a Storyboard
Creating a UIViewController from a Nib (Xib)
SomeViewController* someViewController =
[self.storyboard instantiateViewControllerWithIdentifier:@“SomeView"];
[[self navigationController]
presentViewController:someViewController animated:YES completion:nil];
SomeViewController* someViewController =
[[SomeViewController alloc] initWithNibName:@"SomeViewController" bundle:nil];
[[self navigationController]
presentViewController:someViewController animated:YES completion:nil];
51. Debugging on a device
Enable Mac to be in “Development
Mode”
Create Developer Account and
Provisioning Profile
Add your device to your account (hard
limit of 100 devices)
developer.apple.com
61. TestFlight Distribution
Setup a free TestFlight account and create a team.
Invite and gather the UDIDs from the team members.
Add devices to your ADC Provisioning Profile.
Build an .ipa archive in Xcode and upload to
TestFlight.
Distribute the build and manage the feedback.