How To Create A Swift Project In Xcode

This article will tell you how to use Xcode to create a swift project, then you can develop iOS app in it. But before start, you should install Xcode in your mac os.

1. Create Swift Project In Xcode Steps.

  1. Start Xcode editor, then click File —> New —> Project… menu item at top menu bar, it will popup below project template dialog window. Select iOS —> Single View App template. Click Next button.
    xcode ios single view app template
  2. Input iOS app product name in the next window, the product name should be camelcased. Input organization name and organization identifier. Select Swift in the Language drop down list. Click Next button.
    input roundedborderbutton in the xcode project detail info dialog
  3. Now it will popup a file explorer dialog to let you select the project saved folder. You can click the New Folder button to open New Folder popup dialog, input folder name and click Create button to create the folder. And then the new folder will be selected automatically, all the project files will be saved in this folder. Then click Create button at bottom right to create the Xcode project.
    create new folder for swift xcode project
  4. The swift xcode project will be created after some time, and you can see the project files list in left panel.
    newly created swift xcode project files list
  5. The Main.storyboard file is where you design the iOS app UI, you can also add UI element event processor in it. The ViewController.swift file is where your swift source code located.
  6. Now you can read reference articles for further learning.

References

  1. iOS Swift Hello World Example
  2. iOS Xcode Project And Target Structure Example
  3. iOS Add Click Event To UIButton Swift Example
  4. How To Set iOS App Icon In Xcode Project
  5. How To Add Subview In iOS Programmatically
READ :   How To Call Objective C Code From Swift Project

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.