0

Before this gets marked as duplicate, I've already checked The use of Swift 3 @objc inference in Swift 4 mode is deprecated?

I'm resuming development on app which I had been working on before Xcode 9 (with Swift 4) was released.

I'm getting the build time warning "The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use of deprecated Swift 3 @objc inference” logging enabled, and then disable inference by changing the "Swift 3 @objc Inference" build setting to "Default" for the "Rushed" target."

I know how to turn on/off/default the build setting but even when I turn it on and then 'default' it, the warning is still appearing.

Scrolling through my files, there are no warnings/yellow triangles which could tell me where the issue is occurring and there's no 'Fix' button appearing.

Please help!

Adi219
  • 4,712
  • 2
  • 20
  • 43
  • 1
    Are there other targets (a `...Tests` target for example)? The warning is displayed for each target individually. – vadian Jan 14 '18 at 10:58
  • @vadian I'm not sure I understand :-( Where should I look? – Adi219 Jan 14 '18 at 10:59
  • Select the project on the top of the project navigator and look at the targets. How many do you have? – vadian Jan 14 '18 at 11:02
  • @vadian Actually it's fine! I clicked on my project and then the `Target` section. It turns out that my app's @objc interference was on even though it was off in `Project` section. – Adi219 Jan 14 '18 at 11:02

1 Answers1

2
  1. Click on the project (the first thing in the massive drop-down list)
  2. Click on the Targets section that appears
  3. Search for the Swift 3 @objc interference section
  4. Turn it On and fix any warnings/errors that pop up
  5. Turn it to Default and your project should run without any issues
Adi219
  • 4,712
  • 2
  • 20
  • 43
  • I have the same problem in XCode 10.1, it is a project I started before XCode 9. I get this one warning message whether the 'Swift 3 @objc interference' is set to Default, On or Off. It appears to make no difference to running the app. I am changing this setting in both Project and Target – wheeliebin Feb 05 '19 at 19:13