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.
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.
Tomer
On
In Objective C you can simply #import them, as there are no such "internal" method access limitations as in Swift.
Also, On Xcode 6 your main target should be already linked to the test target. If not, try to check the "Allow testing Host Application APIs" checkbox inside Your Test Target > General > Testing. Take a look at this question for more information.
Copyright © 2021 Jogjafile Inc.
@testableoverrides access rights in Swift, allowing you to testinternalmethods in unit tests.Objective-C has no such access modifiers, therefore you don't need
@testableand you just import the module normally.If you need to unit test internal Swift methods, you will have to write your tests in Swift.