0

Xcode 11 beta 3 does not accept this code to instantiate UIAction anymore:

let action = UIAction(__title: "title", image: someImage, options: []) { _ in
    // some action
}

There's nothing in the documentation either.

I've found a post on Apple Developer Forums describing this same problem and the syntax that's now accepted, but it results in a runtime error:

let action = UIAction(__title: "title", image: someImage, identifier: nil, handler: { _ in
    // some action
}

+[UIAction actionWithTitle:image:identifier:handler:]: unrecognized selector sent to class 0x7fffa1b30178

There's also this new parameter identifier, but I couldn't find any documentation about how to use it.

Has anyone been able to successfully use UIAction with Xcode 11 beta 3?

Marcos Tanaka
  • 3,112
  • 3
  • 25
  • 41

2 Answers2

0

I don't see where you're getting the options parameter from. This compiles and runs (no crash) on my machine using Xcode 11 beta 3:

    let action = UIAction(__title: "Howdy", image: nil, identifier: nil) {
        _ in
    }
matt
  • 515,959
  • 87
  • 875
  • 1,141
  • Perhaps your installation of Xcode 11 beta 3 or the simulator is flawed? I recommend deleting all simulators and starting over every time you download a new version of Xcode, just to be on the safe side. – matt Jul 03 '19 at 16:40
  • 1
    I've tried on the iPad Pro simulator and it works! I think the problem is on my iPhone 7 Plus, which did not receive iOS 13 beta 3. – Marcos Tanaka Jul 03 '19 at 16:45
  • Reading the release notes is good: https://developer.apple.com/documentation/ios_ipados_release_notes/ios_ipados_13_beta_3_release_notes iOS 13 beta 3 isn’t available for iPhone 7 or iPhone 7 Plus. (52363318) – matt Jul 03 '19 at 16:55
0

Check out the WWDC https://developer.apple.com/videos/play/wwdc2019/224/ and goto time 44:46.

CrazyPro007
  • 1,006
  • 9
  • 15