0

I am at the beginning of a project, and I would like to set the iOS target to 10.3, but If I do it, Xcode pops up 15 errors, (for eg UIScene), that these only work in iOS 13.0 or later version. Should I just comment these functions out in AppDelegate, or how can I use targets? And what would you suggest, what target should I pick that would serve most people?

Zoltan H
  • 5
  • 3
  • This should help: https://stackoverflow.com/a/57467270/1187415 – Martin R Mar 11 '20 at 10:23
  • It's difficult to tell what is being asked here, and this question cannot be reasonably answered in its current form. Please provide the context, and/or post code samples of what you have done (i.e.: [What have you tried?](http://whathaveyoutried.com)) – Miroslav Glamuzina Mar 11 '20 at 18:54

3 Answers3

1

check here

Targets usually it means that your project will target which iOS versions. eg if you choose target 11.0 your project will capable to run on devices having iOS 11.0 or later.

You are getting those errors because you are using Xcode 11 or later and it contains scene delegates which is for iOS 13.0 or later only to make it working on iOS 10.3 version you just need to add @available 13.0 in scene delegate.

Navneet Kaur
  • 264
  • 2
  • 14
0

The Scene delegate will introduce in iOS 13, So if you want to use iOS 10.3

Follow the following step:

1) Remove Scene Delegate File 2) Add UIWindow in AppDelegate file and Remove Scene LifeCycle Method From AppDelegate file 3) Remove UIApplicationSceneManifest Key From info.plist file

Hope this will help...

Jignesh Mayani
  • 6,937
  • 1
  • 20
  • 36
0

you can either add @available 13.0 tag for functions or this kind control flow to use different behavior depends on system

if #available(iOS 13, *) {
    // some function 
} else {
    // another function
}

of course you can specific more versions like #available(iOS 11, 12) and so on

Bartosz Jarosz
  • 188
  • 1
  • 5