This is a very straight forward and clean post to help fellow developers to successfully install and run their first iOS mobile app.
Prerequisites
- Xcode
- iPhone(optional)
Agenda
To guide you to successfully create and run a very simple sample native iOS application on a device or simulator.
Let’s start
- Open the xcode in your machine. If you don’t have xcode installed, please open
Appstoreapp and search forxcodeand click on install. - Choose
File -> New -> Projectand chooseSingle View App - Enter
Product NameOrganisationof your choice. The product name will be the name of your app which thus can be altered later too. - Click Next.
- Open
ViewController.mand add line#import<UIKit/UIKit.h> - Add below code snippet in the
viewDidLoadto create a label with text message.
UILabel *helloWorldLabel = [[UILabel alloc]initWithFrame:CGRectMake(91, 350, 300, 100)];
helloWorldLabel.text = @"Hello World";
[self.view addSubview:helloWorldLabel];