Can I use @_implementationOnly import in my Framework

We have FrameworkA which needs to use another FrameworkB internally to fetch a token.

Now when I try to use this FrameworkA, we are seeing an issue with internal framework i.e. No such module 'FrameworkB'.

But when I use @_implementationOnly import for the internal FrameworkB, I didn't see any issues.

So just wanted to check If I can go ahead and use this @_implementationOnly import flag in Production?

Answered by DTS Engineer in 841135022

@_implementationOnly has largely been supplanted by access-level modifiers on import itself. See SE-0409 Access-level modifiers on import declarations for the details. I recommend that you try that first.

So just wanted to check If I can go ahead and use this import flag in Production?

If you’re shipping on the App Store then the App Store Connect upload process does perform somes checks on your built binary, but @_implementationOnly shouldn’t have any effect there. So, this is between you, your organisation’s code policy, and any clients of your code. From an Apple perspective, there’s nothing stopping you.

Having said that, I generally recommend you steer clear of underscored features because there’s no guarantee that they’ll be supported in the long term. Hence my advice above.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

@_implementationOnly has largely been supplanted by access-level modifiers on import itself. See SE-0409 Access-level modifiers on import declarations for the details. I recommend that you try that first.

So just wanted to check If I can go ahead and use this import flag in Production?

If you’re shipping on the App Store then the App Store Connect upload process does perform somes checks on your built binary, but @_implementationOnly shouldn’t have any effect there. So, this is between you, your organisation’s code policy, and any clients of your code. From an Apple perspective, there’s nothing stopping you.

Having said that, I generally recommend you steer clear of underscored features because there’s no guarantee that they’ll be supported in the long term. Hence my advice above.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you so much for the response. Sure, I will check the SE-0409 Access-level modifiers on import declarations and let you know If I need any further clarification.

Can I use @_implementationOnly import in my Framework
 
 
Q