Selector in Objc/Swift

In this short article you will know: Selector in Objc Selector in Swift Passing value using Selector Selector in Objc: Selector is a concept of Objective-C Runtime, which allows to turn a method’s name (NSString) into a SEL type. Basically you cand find @selectoreverywhere, such as adding a method to a view, NSNotification, etc. [gist
Read More »

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 following example shows how to use Runtime to
Read More »

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 objects can only have one instance. In other words, all the
Read More »

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; Reload the data in Table view: After update the table data array/dictionary, you probably want to manually reload the whole table. [self.fileSelectionTableView reloadData]; Remove blank
Read More »

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 https://gist.github.com/arkilis/fa6abfc9eb66ed5527fc3ea5bb70ffa3 /] Step 2: Use extension: [gist https://gist.github.com/arkilis/5a622dcf50d68d656d8d58965ff7d5ca /]
Read More »