Testing push notifications in the iOS simulator make adding support for remote notifications much more effortless. You often must iterate a lot to verify that your code is working as expected. After gaining permission to receive push notifications in your app, you can start testing out several notifications. Xcode’s Simulator supports testing both regular and …
testing
Getting started with Unit Tests in Swift
Unit tests in programming languages ensure that written code works as expected. Given a particular input, you expect the code to come with a specific output. By testing your code, you’re creating confidence for refactors and releases, as you’ll ensure the code works as expected after running your suite of tests successfully. Many developers do …
NSPredicate based XCTestExpectations for conditional checks
NSPredicate allows us to write predicates for validating a certain outcome. They’re often used combined with Core Data fetch requests and require a certain knowledge for writing custom formats. Besides my earlier shared Unit tests, best practices in Xcode and Swift predicates can be useful when writing unit tests. We can benefit from using predicates …
Testing private methods and variables in Swift
Testing private methods and variables is often something we run into when writing tests for our applications. You could think that it’s needed to fully verify that your code is working as expected and it helps you to get to that 100% code coverage. If you’re new to unit testing in Swift, you might first …
Enabling newly added opt-in features in Xcode 10
During WWDC 2018 Apple announced Xcode 10 with a lot of new features. Many of them are available for you automatically and enabled by default, but some of them might not show up and need some manual adjustments. Code folding To enable it, open preferences under Text Editing > Editing and select Code folding ribbon. …