How do I create a category in Xcode 6 or higher?

后端 未结 8 1802
太阳男子
太阳男子 2020-11-27 09:53

I want to create a category on UIColor in my app using Xcode 6. But the thing is that in Xcode 6 there is no Objective-C category file template.

Is the

8条回答
  •  一整个雨季
    2020-11-27 10:05

    They didn't forget. They just moved it without telling anyone.

    1. Click File -> New -> File

    2. Select Objective-C file under Sources in iOS or Mac OS respectively and Click Next

    3. Now under File Type: choose either Category, Protocol, or Extension

    PS. Under File Name: whatever you type here will be either the Category, Protocol, or Extension Name.

提交回复
热议问题