Reputation: 2660
With Xcode when you create a new Objective-C file with subclass Uiviewcontroller, you get a new file with all the boilerplate code ready to be edited. When I create a new file in swift, it's completely blank. Is this by design? How do I get the same template/boilerplate code so that I can get started coding quickly?
Upvotes: 4
Views: 1101
Reputation: 6620
Instead of creating a "Swift File", choose "Cocoa Class":
Then choose the appropriate subclass:
Finally click next and save to your desired location.
You may need to change the import statement from import Cocoa
to import UIKit
Upvotes: 5