1

I am trying to make an Xcode project that was set up for iOS 13 work with a target of iOS 10 or even 12. I'm using Xcode 10 for Swift 3 compatibility.

According to the advice here: Xcode 11 backward compatibility I have added @available(iOS 13.0, *) in the places it was recommended to add it, and I have also declared var window : UIWindow? in the AppDelegate class.

// MARK: UISceneSession Lifecycle

@available(iOS 13.0, *)
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {

...

@available(iOS 13.0, *)
    func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {

In Scene Delegate:

@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {

But I am getting:

Use of undeclared type 'UISceneConfiguration', 'UIWindowSceneDelegate', 'UIScene', 'UISceneSession'

How can I fix this? I don't see what else I can do.

shim
  • 9,289
  • 12
  • 69
  • 108
Paul
  • 115
  • 2
  • 10

1 Answers1

3

I'm using Xcode 10 for Swift 3 compatibility.

That’s the problem. You cannot mention iOS 13 classes using Xcode 10. It knows nothing about them. You must work entirely within Xcode 11 if you want to link against the iOS 13 SDK.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Ah, thank you! This is all just for learning using “old” books so I’ll try just deleting those bits and see how it goes. – Paul Dec 10 '19 at 15:42
  • 1
    It would be better to use new books. Swift 3 is very dead. – matt Dec 10 '19 at 15:45
  • It’s true. I do have Programming iOS 11 & 12, and iOS 11 Programming Fundamentals. I’m almost to the point where they are not over my head. – Paul Dec 10 '19 at 20:33
  • I feel like I could do with an intro just a tad more on the side of the idea of how an app is built, a step or two before where your books pick up. I’m working my way through Angela Yu’s series now, that’s helpful. – Paul Dec 10 '19 at 23:49