#import last?, autocomplete


It seems like you often put the instructions to insert the #import lines after the code sections for implementations of stuff. If we were to add the #import first, that would let us autocomplete a lot of the code, so I’m wondering if there’s a reason for making us carefully watch our typing? :wink:

Relatedly, it seems like Xcode sometimes autocompletes delegate and datasource methods (after I add the protocol to the header file), but it doesn’t always do it. Is there a way to make typing those method names easier?




The main reason for importing afterwards is to not break up the flow of the conversation. I didn’t really take into account the autocompletion stuff, so you raise a good point. I might make the decision in the next edition of the book to put the import statement in earlier, but part of me just hates the idea of interrupting the transition from idea to implementation with something so repetitive and uninteresting.