How to start with SwiftUI

Published by @SoNiceInfo at 6/24/2020


Download Xcode

You need the latest Xcode to build iOS apps with SwiftUI.
If you don't have it, you can download it from the App Store.
‎「Xcode」- Mac App Store

Create a new project

1. Open Xcode and select Create a new Xcode project

Open Xcode and Choose Create a new Xcode Project

2. Select a template simillar to your vision.

Choose a template for your new project
I select Single View App for this page.

3. Input about Projects

Choose options for your new project
  • You can change Team/Organization after the dialog.
  • Choose SwiftUI for User Interface.
  • Choose save place pressing Next button.
Please not you will got an error without choosing Team.

4. Hello World

Start editing codes
Now you can start a SwiftUI project.
ContentView.swift is a main page. (Like index.html)

Build

You need to build an app first.
⌘ + B to build
Or pushing play button on top left of Xcode.

Run

You can run your app on the simulator and iPhone.

1. Select to run on the simulator or iPhone

You can select it by changing the name of the iPhone model to the right of the project name at the top left of Xcode.
Choose iPhone for simulator or real one

2. ⌘ + R to run

3. Check the result

Check result on a simulator

Note

use canvas for simulate view quickly
If you're using macOS 10.15 or higher, you can use Canvas to verify the display.


    I released iOS App!

    ToDo App

    Visualize Activity, Data sharing with iCloud, Dark mode supported.

    リリースしたToDoアプリのスクリーンショット

    IP Address bookmark.

    Check and bookamrk IP address of all interfaces with geolocation.

    リリースしたIPアドレス保存アプリのスクリーンショット