Share this page

by Jon Hoffman     masteringswift.blogspot.com
Swift Version: 1.1

One of the many new features with Xcode 7 and Swift 2 is the @testable attribute. While we have been able to do unit testing in previous versions of Xcode and Swift the big drawback has always been that any routine we wanted to test had to have an access level of public. This was a pretty big drawback especially with frameworks where we need to test routines without making them public. This has changed in Xcode 7 and Swift 2. In this post we will demonstrate how to use the new @testable attribute in our test source code to make all public and internal routines usable by our test code but not usable by other frameworks and app targets.



© 2015 SoSoSwift. Blog · About · Contact · Privacy policy · Terms of service · RSS