Testing private methods
A private method inside a custom view holds complicated calculation logic and you want to test it. How would you test that private method, or should you leave it alone?
A private method inside a custom view holds complicated calculation logic and you want to test it. How would you test that private method, or should you leave it alone?
Don't try to test private itself: verify it through the public behavior, or extract it into its own type if the logic is worth testing. Internal plus @testable import is a workable compromise, but calculation logic living inside a view is a design signal in itself.
TestingMultiple choiceIntro
When the test target does @testable import MyApp, which declarations become accessible?
#testable
Memory and ARCMultiple choiceAdvanced
Which of these actually improve the performance of class-based code (dispatch and ARC…
#private
SwiftShort answerBasics
In one file you have class A { fileprivate func secret() {} } and class B. Can B call…
#private
UIKitShort answerBasics
You put a custom view you built (say, a tag chip view) into a UIStackView and it's sized…
#custom-view