Saturday, February 13, 2021

How to run an Xcode project on an iOS device without payment for the US$99 Apple Developer account (2021)

To run an Xcode project on an iPhone/iPad without paying US$99 for Apple Developer account, this error message may happen:

Your development team has reached maximum number of registered iPhone devices.

According to StackOverflow, I got this warning because I have a previous paid account but I cannot configure it at this stage. So I register a new and free Apple Developer account. and add it to Xcode with Preferences->Accounts.

The project with Xcode 11.6 is configured as below:


After selecting the new Apple Developer account as the team and making sure that the bundle identifier is new, the deployment becomes successful!

References:

Development team has reached maximum number of registered iPhone devices (StackOverflow)

How to Test iOS App without Developer Account?

Run an Xcode project on an iOS device without US$99 Apple Developer account (Configuration for iPhone) (StudySwift)

Saturday, February 6, 2021

Xcode 11.6 (Swift 5.2.4) - Hello World and how to set the background color programmatically

 code:

import SwiftUI


struct ContentView: View {

    let screenWidth = UIScreen.main.bounds.width

    var body: some View {

        ZStack {

            Color.yellow

            .edgesIgnoringSafeArea(.all)

            Text("Hello, World!")

            

            Text("Study Swift")

            .position(CGPoint(x: screenWidth/2, y: 400))

            

        }

    }

}


struct ContentView_Previews: PreviewProvider {

    static var previews: some View {

        ContentView()

    }

}

Result:


Reference:


How to set a background color for the viewController in swiftUI? (StackOverflow)