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:
Step 2: Use extension:
Compared with the
Step 1: Create a Objective-C file
Category in the file type, and choose the class you want to extend:
Then it will create two files:
To use the category in your project, i.e. Change the background color of current view controller.