pengwang
pengwang

Reputation: 19956

xcode shortcut key import h file and add the Delegate methods

I am new iOS development but I know android at eclipse. For example I am lack a package, I can use ctrl+shift+o to import the package,if there is shortcut key at Xcode can help to import the .h file. Because sometimes I do not know my methods from which .h file. you know when I add new Delegate to .h file,how to use shortcut key help me to add the need implement methods.

Upvotes: 2

Views: 3633

Answers (3)

Oritm
Oritm

Reputation: 2120

A bit late, but a plugin will do the job for you:

https://github.com/markohlebar/Peckham

Upvotes: 0

DrummerB
DrummerB

Reputation: 40211

I don't know of any shortcut for that. But you can Option-Click the delegate in your source code to get QuickHelp and from there you can open the Documentation with a list of all the methods in the protocol.

And usually protocol methods start always the same. For instance UITableViewDelegate methods all start with tableView: (like tableView:didSelectRowAtIndexPath:). If you know that, and are only unsure about the rest, or the type of the parameters, you can simply start typing -tableView at the beginning of a line and XCode will list all the possible methods for you.

Upvotes: 1

Rui Peres
Rui Peres

Reputation: 25917

You don't have that in Xcode, and honestly, at least in my perspective, I never really had the need to have it (and I am coming from an Android background). If you know what class you are using, you just have #import or @class it. I prefer this way because it makes you aware of the dependencies between classes.

Upvotes: 3

Related Questions