Whats the alternative of @testable import in Objective C

Babul Prabhakar picture Babul Prabhakar · Apr 27, 2016 · Viewed 8.4k times · Source

I am working with Unit Testing in Xcode using XCTest provided by Xcode in objective C. I know how to import Module in Swift like below.


@testable import  AppName

Whats the alternative in objective C.

Answer

Sulthan picture Sulthan · Apr 27, 2016

@testable overrides access rights in Swift, allowing you to test internal methods in unit tests.

Objective-C has no such access modifiers, therefore you don't need @testable and you just import the module normally.

If you need to unit test internal Swift methods, you will have to write your tests in Swift.