Apps Developer Blog

Swift

There are a few different ways of how to create an Array with default values in Swift. Below are a few Swift code examples of creating an Array. Each example creates an array with some initial values. Create an Array of Strings var appleProgrammingLanguages: [String] = [“Swift”, “Objective-C”] Thanks to Swift’s type inference, you don’t…

Read More Create an Array with Default Values in Swift

To present a ViewController in a NavigationController you can wrap ViewController into a NavigationController as it is in the example below. Then present NavigationController which contains ViewController. // Register Nib let newViewController = CustomSignupViewController(nibName: “CustomSignupViewController”, bundle: nil) let navigationController = UINavigationController(rootViewController: newViewController) // Present View “Modally” self.present(navigationController, animated: true, completion: nil)  

Read More Present ViewController in NavigationController

With this blog post, I wanted to share with you a code example as we as a few video tutorials that demonstrate how to add inline UIDatePicker or DateCell into a UITableView in Swift. Originally, the DateCell example was implemented by Apple as an Objective C project and it is available for download here: Apple DateCell.…

Read More Inline UIDatePicker or DateCell Example in Swift

There are different ways to test that the UIViewController has been successfully pushed onto the navigation stack and in this tutorial, I will cover a few of them. For this tutorial, I have created a simple project with two view controllers on the Main.storyboard. The very first view controller has a button. When the button…

Read More Test View Controller Push to Navigation Controller

There are a few different ways to Unit test code that throws an Error in Swift and my preferred way is to use the XCTAssertThrowError and XCTAssertNoThrows. I will also share with you how to use the traditional way of handling an error with the do-try-catch. Error To Be Thrown Let’s assume that we have…

Read More Unit Testing Code That Throws Error in Swift

Free Video Lessons

Enter your email and stay on top of things,

Subscribe!