[iOS SDK] Useful simulator shortcuts and basic operations

After a while developing iOS Apps, i’ve discovered some frequently used shortcuts that make your life easier:

In iOS Simulator:

Alt+shift: double tap (two-finger tap), for scrolling etc.

Ctrl+Alt: Pinch (zoom-in / zoom-out).

Cmd+Shift+H: Device’s Home button press

Cmd+1, Cmd+2, Cmd+3: Rescale simulator to support different screen sizes

In Xcode:

Cmd+Alt+Shift+Left: Collapse all methods in file

Cmd+Alt+Left: Collapse current code block (Cmd+Alt+Right to expand)

Cmd+7: Shows all breakpoints (Cmd+A selects them all, backspace deletes)

some simple routinary Xcode tasks:

Create segue from an UIButton to another ViewController quickly using Storyboards:

1.- [Storyboard] Place an UIButton inside the current ViewController

2.- [Code] Create the IBOutlet in the .h file, implement it in the .m file

3.- [Storyboard] Ctrl+drag from UIButton to UIVIewController.

Create outlet inside ViewController (UILabel, UIButton, UITextView…)

1.- [Code] Create the property for the outlet in the .h file

Example: @property (weak, nonatomic) IBOutlet UIImageView *img;

2.- [SB] Place the UILabel, UIButton, etc. inside the ViewController (resize it, set its title, etc)

3.- [SB] Ctrl+drag from ViewController (yellow square on the bottom) to the UILabel, UIButton, … , select the attribute defined in step 1.

Create a progress bar (slightly different than the rest of the components)

1.- Place the UIProgressView inside the ViewController

2.- Create the @property in the .h file

3.- ctrl+drag from UIProgressView to an empty zone of the ViewController. Select the attribute specified in step 2

Choose if deploying App to iPhone/iPad or to iOS Simulator:

Select Product > Destination

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s