Monthly Review: July 2015

Blog posts about iOS development in July 2015.

On The Web

 

On This Blog

  • Objective-C: Lightweight Generics: Since Xcode 7 there are so-called “Lightweight” Generics in Objective-C. The biggest benefit of this feature is a better interoperability between Objective-C and Swift.
  • Container ViewController: Basically, there are two types of view controllers: Content view controllers and container view controllers. Container view controllers are used to manage some set of content view controllers and present them as so-called child view controllers whereas content view controllers are used to present – surprise – some content. Most of the times, container view controllers are without any relation to a specific content. Therefore, they are highly reusable.  UIKit provides a rich set of container view controllers like UINavigationController, UITabBarController and UISplitViewController.  However, if these controllers fulfill not your user interface requirements, you can create your own container view controller. UIKit supports this since iOS 5.
  • Loading a View from a XIB: Generally, there are two ways to layout views: building it in interface builder or by coding. Both ways have their applications, but in many cases the interface builder way is more comfortable. If you layout a view in the interface builder, then it is most times associated with a view controller. But it is also possible to layout a view that is NOT associated with a view controller but only with a custom view! Then you have the possibility to initialize the view from code, load the layout from the XIB and add this view as a subview to another view.
  • The MVC-Trap: The fundamental software architecture pattern in iOS and Mac OS  development is the Model-View-Controller pattern (MVC). The idea of this pattern is, that each of these three layers has a clear and precise role, which leads to more reusable code and less bugs. However, in iOS development there is a drastic tendency that the controller layer do more than it should do. In this post we discuss some ways of avoiding this trap.
  • Using Custom Fonts: Out of the box iOS provides you a rich set of fonts. But sometimes there is the need to add another font to your project. For example, this could be one of the Google Fonts, which are open source.  In this post we look how you can add a custom font to your project and how you can use it.
  • Error Handling in Swift 2.0: Swift 2.0 has a new way of error handling. It uses a do-try-catch syntax, which is the replacement for NSError.  In this post we will discuss how to use this new syntax.
  • Objective-C: Nullability: One of the biggest differences between Objective-C and Swift is the handling of nullability. But since Xcode 6.3 there are two new keywords in Objective-C that improve their interoperability: nullable and nunnull.
  • Optionals in Swift: In Swift every variable can be declared as a so-called optional – then the variable is allowed to become nil what is equivalent to the absence of a value. In this post we will discuss the most important aspects of optionals.

References

Image: @ Gustavo Frazao / shutterstock.com

Book Tip

Big Nerd Range Guide: iOS Programming: Excellent introduction to iOS development. Some programming experience is recommended.

Amazon