<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.scott5.org/index.php?action=history&amp;feed=atom&amp;title=IPhone</id>
	<title>IPhone - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.scott5.org/index.php?action=history&amp;feed=atom&amp;title=IPhone"/>
	<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=IPhone&amp;action=history"/>
	<updated>2026-04-12T19:10:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.scott5.org/index.php?title=IPhone&amp;diff=1840&amp;oldid=prev</id>
		<title>Scott at 22:31, 25 October 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=IPhone&amp;diff=1840&amp;oldid=prev"/>
		<updated>2024-10-25T22:31:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:31, 25 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* top status bar is 20px, bottom tab bar is 44px&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* top status bar is 20px, bottom tab bar is 44px&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* All images should be png&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* All images should be png&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* test&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Basic Setup==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Basic Setup==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Scott</name></author>
	</entry>
	<entry>
		<id>https://wiki.scott5.org/index.php?title=IPhone&amp;diff=1839&amp;oldid=prev</id>
		<title>Scott: /* Facts */</title>
		<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=IPhone&amp;diff=1839&amp;oldid=prev"/>
		<updated>2024-10-25T22:31:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Facts&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:31, 25 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* top status bar is 20px, bottom tab bar is 44px&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* top status bar is 20px, bottom tab bar is 44px&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* All images should be png&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* All images should be png&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* test&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Basic Setup==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Basic Setup==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Scott</name></author>
	</entry>
	<entry>
		<id>https://wiki.scott5.org/index.php?title=IPhone&amp;diff=427&amp;oldid=prev</id>
		<title>Scott at 00:21, 4 February 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.scott5.org/index.php?title=IPhone&amp;diff=427&amp;oldid=prev"/>
		<updated>2011-02-04T00:21:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{lowercase title}}&lt;br /&gt;
==Facts==&lt;br /&gt;
* iPhone Resolution: 320x480&lt;br /&gt;
* top status bar is 20px, bottom tab bar is 44px&lt;br /&gt;
* All images should be png&lt;br /&gt;
&lt;br /&gt;
==Basic Setup==&lt;br /&gt;
* Start by launching &amp;lt;code&amp;gt;/Developer/Applications/Xcode&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;File -&amp;gt; New Project -&amp;gt; View-Based Application&amp;lt;/code&amp;gt;, choose name (e.g. &amp;lt;code&amp;gt;MyProject&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Edit Objective-C code in &amp;lt;code&amp;gt;Groups &amp;amp; FIles -&amp;gt; Classes&amp;lt;/code&amp;gt; with Xcode&lt;br /&gt;
* Edit user interface with &amp;lt;code&amp;gt;Groups &amp;amp; Files -&amp;gt; Resources -&amp;gt; MyProjectViewController.xib&amp;lt;/code&amp;gt; with Interface Builder.  Drag elements from the Library window to the View window.&lt;br /&gt;
* Click Build and Run in Xcode to test.&lt;br /&gt;
&lt;br /&gt;
==Application Icon==&lt;br /&gt;
# Create a 57x57 png file&lt;br /&gt;
# Drag from Finder to Xcode &amp;lt;code&amp;gt;Resources&amp;lt;/code&amp;gt; folder&lt;br /&gt;
# Choose &amp;quot;&amp;lt;code&amp;gt;Copy&amp;lt;/code&amp;gt;&amp;quot; to create a copy in the project directory&lt;br /&gt;
# Click the &amp;lt;code&amp;gt;Resources -&amp;gt; Info.plist&amp;lt;/code&amp;gt; file&lt;br /&gt;
# Next to &amp;quot;&amp;lt;code&amp;gt;Icon File&amp;lt;/code&amp;gt;&amp;quot;, enter the name of the png.&lt;br /&gt;
&lt;br /&gt;
==Interface Builder hints==&lt;br /&gt;
* The MyProjectViewController.xib window has three &amp;quot;View Mode&amp;quot; buttons.  Use the middle one to drill down and select overlapped or hidden View elements.&lt;br /&gt;
* When a View element is selected, double click it or use Command-1 to edit attributes. (Command is the clover-shaped button)&lt;br /&gt;
* Hold the Option key when mousing over View elements to see more properties.&lt;br /&gt;
* If you have an existing element in the View that you want to duplicate, Option-drag it to get a copy.&lt;br /&gt;
&lt;br /&gt;
==Outlet==&lt;br /&gt;
* Communicate from code to view with an IBOutlet.  In header file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
IBOutlet UILabel *statusText;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* An outlet must be defined in the header file before it can be accessed in Interface Builder.&lt;br /&gt;
* Control-drag from File&amp;#039;s Owner to the element and choose the corresponding outlet.&lt;br /&gt;
&lt;br /&gt;
==Action==&lt;br /&gt;
* Communicate from view to code with an IBAction.  In header file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
- (IBAction)doSomething:(id)sender;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
* Select element and bring up connections inspector (Tools-&amp;gt;Connections or Command-2). &lt;br /&gt;
* Choose the desired event by clicking the circle to the left of it. &lt;br /&gt;
* Drag circle to File&amp;#039;s Owner and select the desired action.&lt;br /&gt;
&lt;br /&gt;
==Basic Interaction Sample App==&lt;br /&gt;
MyProjectViewController.h:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;UIKit/UIKit.h&amp;gt;&lt;br /&gt;
@interface MyProjectViewController : UIViewController {&lt;br /&gt;
    IBOutlet UILabel *statusText;&lt;br /&gt;
}&lt;br /&gt;
@property (retain, nonatomic) UILabel *statusText;&lt;br /&gt;
-(IBAction)buttonPressed:(id)sender;&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MyProjectViewController.m:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;quot;MyProjectViewController.h&amp;quot;&lt;br /&gt;
@implementation MyProjectViewController&lt;br /&gt;
@synthesize statusText;&lt;br /&gt;
-(IBAction)buttonPressed:(id)sender {&lt;br /&gt;
    NSString *title = [sender titleForState:UIControlStateNormal];&lt;br /&gt;
    NSString *newText = [[NSString alloc] initWithFormat: @&amp;quot;%@ button pressed.&amp;quot;, title];&lt;br /&gt;
    statusText.text = newText;&lt;br /&gt;
    [newText release];&lt;br /&gt;
}&lt;br /&gt;
...boilerplate...&lt;br /&gt;
-(void)dealloc {&lt;br /&gt;
    [statusText release];&lt;br /&gt;
    [super dealloc];&lt;br /&gt;
}&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
======View:======&lt;br /&gt;
&lt;br /&gt;
# Double-click MyProjectViewController.xib in the Resources directory.&lt;br /&gt;
# Create a Label with no text and two RoundRect buttons named &amp;quot;Left&amp;quot; and &amp;quot;Right&amp;quot;.&lt;br /&gt;
# Control-click on &amp;quot;File&amp;#039;s Owner&amp;quot; in the xib window and drag it to the Label object in the view window. Let go of the mouse button and choose &amp;quot;statusText&amp;quot; from the Outlets popup menu.&lt;br /&gt;
# Select the Left button by clicking it; then open the Connection Inspector from Tools menu.&lt;br /&gt;
# Find Events -&amp;gt; TouchUpInside&lt;br /&gt;
# Click the circle next to TouchUpInside and drag to the &amp;quot;File&amp;#039;s Owner&amp;quot; icon.  Select &amp;quot;buttonPressed&amp;quot; from the popup menu.&lt;br /&gt;
# Do the same for the Right button.&lt;br /&gt;
# Build and Run&lt;br /&gt;
&lt;br /&gt;
==User Interface Elements==&lt;br /&gt;
&lt;br /&gt;
======Label======&lt;br /&gt;
&lt;br /&gt;
Has a &amp;quot;text&amp;quot; attribute that you can change with an outlet.  See the example above.&lt;br /&gt;
&lt;br /&gt;
======Image======&lt;br /&gt;
&lt;br /&gt;
# Drag a png file from Finder to the Resources folder in Xcode to import the image.&lt;br /&gt;
# Drag an ImageView element into the View&lt;br /&gt;
# Open attributes and tell it which png file to use&lt;br /&gt;
# Select &amp;quot;Size to Fit&amp;quot; from the Layout menu so the ImageView object is the same size as the imported image.&lt;br /&gt;
# Choose Drawing-&amp;gt;Opaque to speed up drawing if there is no background&lt;br /&gt;
&lt;br /&gt;
======Text field======&lt;br /&gt;
In MyProjectViewController.h:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
#import &amp;lt;UIKit/UIKit.h&amp;gt;&lt;br /&gt;
@interface MyProjectViewController : UIViewController {&lt;br /&gt;
    IBOutlet UITextField *nameField;&lt;br /&gt;
}&lt;br /&gt;
@property (nonatomic, retain) UITextField *nameField;&lt;br /&gt;
- (IBAction)textFieldDoneEditing:(id)sender;  // make sure the text field gives up control when done editing&lt;br /&gt;
@end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In MyProjectViewController.m:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@implementation MyProjectViewController&lt;br /&gt;
@synthesize nameField;&lt;br /&gt;
- (IBAction)textFieldDoneEditing:(id)sender {  // make sure the text field gives up control when done editing&lt;br /&gt;
    [sender resignFirstResponder];&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Interface Builder&lt;br /&gt;
&lt;br /&gt;
Outlet: Control-drag from File&amp;#039;s Owner to the text field and choose the corresponding outlet.&lt;br /&gt;
&lt;br /&gt;
Action: Select text field and bring up connections inspector.  Choose the &amp;quot;Did End on Exit&amp;quot; event.  Drag circle to File&amp;#039;s Owner and select &amp;quot;textFieldDoneEditing&amp;quot; action.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Number field======&lt;br /&gt;
&lt;br /&gt;
Same as text field but you need a background click action to allow the user to leave the field when done editing.  Add the method declaration to both header and implementation file.  Here is the implementation:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
- (IBAction)backgroundClick:(id)sender {&lt;br /&gt;
	[numberField resignFirstResponder];&lt;br /&gt;
	// add the same for any other edit fields that should lose focus&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
View:&lt;br /&gt;
# Use a Round Rect Button in the view and drag its edges to cover the entire screen. &lt;br /&gt;
# Use Layout-&amp;gt;Send to Back to put it behind everything else. &lt;br /&gt;
# Then change its Type to Custom to make it disappear altogether.&lt;br /&gt;
# Tie the Touch Up Inside event to File&amp;#039;s Owner backgroundClick action.&lt;br /&gt;
&lt;br /&gt;
======Slider======&lt;br /&gt;
Use the &amp;quot;Value Changed&amp;quot; event to call the sliderChanged action.  Access slider value with slider.value.  Sample code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
-(IBAction)sliderChanged:(id)sender {&lt;br /&gt;
	UISlider *slider = (UISlider *)sender;&lt;br /&gt;
	int progressAsInt = (int)(slider.value + 0.5f);&lt;br /&gt;
	NSString *newText = [[NSString alloc] initWithFormat:@&amp;quot;%d&amp;quot;, progressAsInt];&lt;br /&gt;
	sliderLabel.text = newText;&lt;br /&gt;
	[newText release];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======Switch======&lt;br /&gt;
Get value from &amp;lt;code&amp;gt;switch.isOn&amp;lt;/code&amp;gt;.  Use &amp;quot;Value Changed&amp;quot; event.&lt;br /&gt;
&lt;br /&gt;
======Segmented Control======&lt;br /&gt;
Get value from &amp;lt;code&amp;gt;segmentedControl.selectedSegmentIndex&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======SubView======&lt;br /&gt;
Group elements inside a sub view.  Hide all with &amp;lt;code&amp;gt;subview.hidden = YES&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======Action Sheet======&lt;br /&gt;
Modal dialog to force the user to choose an option.  Use UIActionSheetDelegate protocol:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
...&lt;br /&gt;
@interface MyProjectViewController : UIViewController &amp;lt;UIActionSheetDelegate&amp;gt; {&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create an Action Sheet in an action method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
UIActionSheet *actionSheet = [[UIActionSheet alloc]&lt;br /&gt;
	initWithTitle:@&amp;quot;Are you sure?&amp;quot;&lt;br /&gt;
	delegate:self&lt;br /&gt;
	cancelButtonTitle:@&amp;quot;No way!&amp;quot;&lt;br /&gt;
	destructiveButtonTitle:@&amp;quot;Yes, I&amp;#039;m sure!&amp;quot;&lt;br /&gt;
	otherButtonTitles:nil];&lt;br /&gt;
[actionSheet showInView:self.view];&lt;br /&gt;
[actionSheet release];&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Handle the action sheet response with this method:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
-(void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {&lt;br /&gt;
	if (buttonIndex == [actionSheet cancelButtonIndex] { /* do cancel action, if any */ }&lt;br /&gt;
	else { /* do destructive (positive) action */}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
======Custom Button======&lt;br /&gt;
To get nicer looking buttons, create a Round Rect button and then change its type to Custom.  Download a nice looking button template from the web:&lt;br /&gt;
&lt;br /&gt;
http://developer.apple.com/iphone/library/samplecode/UICatalog/index.html&lt;br /&gt;
&lt;br /&gt;
Then implement the viewDidLoad method of UIViewController:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
-(void)viewDidLoad {&lt;br /&gt;
	jmUIImage *buttonImage = [UIImage imageNamed:@&amp;quot;whiteButton.png&amp;quot;];&lt;br /&gt;
	UIIMage *stretchableButtonImage = [buttonImage stretchableImageWithLeftCapWidth:12 topCapHeight:0];&lt;br /&gt;
	[doSomethingButton setBackgroundImage:stretchableButtonImage forState:UIControlStateNormal];&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Can also make the button change when pressed by using a different background image for state &amp;lt;code&amp;gt;UIControlStateHighlighted&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Autorotation==&lt;br /&gt;
Controlled from the&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {&lt;br /&gt;
    return (interfaceOrientation == UIInterfaceOrientationPortrait);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Available orientations:&lt;br /&gt;
* UIInterfaceOrientationPortrait&lt;br /&gt;
* UIInterfaceOrientationPortraitUpsideDown&lt;br /&gt;
* UIInterfaceOrientationLandscapeLeft&lt;br /&gt;
* UIInterfaceOrientationLandscapeRight&lt;br /&gt;
&lt;br /&gt;
There are three different approaches to autorotation:&lt;br /&gt;
&lt;br /&gt;
=====Autosize=====&lt;br /&gt;
Give elements autosize properties using the size inspector (command-3).&lt;br /&gt;
&lt;br /&gt;
=====Restructure=====&lt;br /&gt;
Create outlets for each element; then call something like &amp;lt;code&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
element.frame = CGRectMake(x1, y1, width, height)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
to resize/relocate each on rotation in the&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
-(void)willAnimateSecondHalfOfRotationFromInterfaceOrientation&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
method using self.interfaceOrientation as the &amp;quot;to&amp;quot; orientation.&lt;br /&gt;
&lt;br /&gt;
======Animating a rotation======&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
[UIView beginAnimations:@&amp;quot;move buttons&amp;quot; context:nil];&lt;br /&gt;
... CGRectMake calls to move stuff around ...&lt;br /&gt;
[UIView commitAnimations];&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====Swap views=====&lt;br /&gt;
* Create portrait and landscape outlets in the .h file.  Save.&lt;br /&gt;
* Delete the default view from the project. &lt;br /&gt;
* Drag two or more View elements from the library and give them names like &amp;quot;portrait&amp;quot; and &amp;quot;landscape&amp;quot;. &lt;br /&gt;
* Use the size inspector to update the geometry (480x300 for landscape with top status bar).&lt;br /&gt;
* Control-drag from File&amp;#039;s Owner to each view and choose the related outlet.&lt;br /&gt;
* Control-drag from File&amp;#039;s Owner to portrait and choose the View outlet to choose it as default&lt;br /&gt;
* Create this method in the .m file:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;objc&amp;quot;&amp;gt;&lt;br /&gt;
-(void)willAnimateFirstHalfOfRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation&lt;br /&gt;
    duration:(NSTimeInterval)duration {&lt;br /&gt;
	if (toOrientation == UIInterfaceOrientationPortrait){&lt;br /&gt;
		self.view = self.portrait;&lt;br /&gt;
		self.view.transform = CGAffineTransformIdentity;&lt;br /&gt;
		self.view.transform = CGAffineTransformMakeRotation(0);  // In radians&lt;br /&gt;
		self.view.bounds = CGRectMake(0, 0, 300, 480);&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Transform angles are:&lt;br /&gt;
** 0 for portrait&lt;br /&gt;
** M_PI/2 for landscape right&lt;br /&gt;
** M_PI for upside down&lt;br /&gt;
** -M_PI/2 for landscape left&lt;br /&gt;
* Link in the CoreGraphics framework to support the transform:&lt;br /&gt;
** Click Frameworks under the Groups and Files pane&lt;br /&gt;
** Project -&amp;gt; Add to Project menu&lt;br /&gt;
** /Developer/Platforms/iPhoneSimulator/Developer/SDKs/iPhoneSimulator3.1.sdk/System/Library/Frameworks/CoreGraphics.framework&lt;br /&gt;
** uncheck &amp;quot;Copy items to destination...&amp;quot;&lt;br /&gt;
** Reference type should be &amp;quot;Relative to current SDK&amp;quot;&lt;/div&gt;</summary>
		<author><name>Scott</name></author>
	</entry>
</feed>