chevron-up bell reply instagram twitter2 feed3 finder search-25px-p0

Tag Archives: iOS

iOS Unit Test Practise with OCMock 2/3

The idea behind Mock: Using a fake object to simulate target object, a method returned value/object. For example, there might be an amount of classes including models, viewControllers and etc. With regular unit tests, we need to instantiate the objects that we are going to test……

iOS App: MyNBN — Code and Publish to AppStore in 2 weeks!

Want to find out the NBN availability of your address? MyNBN is an app provides you a shortcut to check the NBN coverage in Australia. Simple search Search by typing in your address and your answer is one tap away. If you are checking the NBN availability of your current addre……

Runtime in Objective-C

Objective-C is a dynamic language. With Runtime, objects can be represented through struct in C, and methods can be done via c language function. Runtime is written in assembly and c. With the benefits of Runtime, we have another way to call class and instance methods. The foll……

Singleton in Objective-C/Swift

What is behind the Singleton? Singleton: Instantiation of a class to ONLY one object Features of Singleton: One class only can have only one instance; It must can create this instance automatically; This instance must be provided to other objects. Benefits of Singleton: All o……

Key-Value Coding and Key-Value Observing in Objective-C

What is KVO/KVC KVC(Key-Value Coding) is a coding style which coming from Functional Programming, KVO(Key-Vlaue Observing) is the technology that underlies Cocoa Bindings, and it provides a way for objects to get notified when the properties of other objects are changed. How do……

iOS TableView Development Tips

The following are some frequently used iOS TableView tips while developing: Change the tableview background color: Sometimes you probably need to change the whole table view background. self.tableView.backgroundColor = colorTableview; ……

Delegation in Swift

Similarly, in Swift you can have Delegation: Step 1: Create a new Cocoa class, i.e WeatherService.swift, in this Swift file which include: A Protocol A Delegate Property WeatherService.swift .gist table { margin-bottom: 0; } Step 2: Implement Delegation .gist table { margin-……

Swift Extension and Objective-C category

Category in Objective-C, Extension in Swift are the same concept. They can help you to organise your class code. With category and extension, you don't have to create a inherited class. Extension in Swift Step 1: Create a Swift file Then in the Swift file: .gist table { margin……