![]() */ func requestVenues(location: CLLocation, query: String?, completion: (venues: ?) -> Void) :param: completion A closure which is called with venues, an array of FoursquareVenue objects :param: location A CLLocation for the user's current location Sends an API request to 4sq for venues around a given location with an optional text search In Objective-C, there were a few different formats that you could use but in general documentation looked like this: This is all powered by inline documentation snippets of text that precede class or method definitions and provide a quick look into the important parts of the code, like parameter and return types, or text describing cases where you might use the code. You should see a question mark cursor like this:Ĭlicking on the that link should bring up a small popover like this one with details on the class or method: Find a UIKit class or method in your code and hold your option key down while hovering over it. As luck would have it, we’re now able to discuss how to document Swift in a similar way as our Objective-C.įirst, a quick introduction to Quick Help in Xcode 5 or 6. I didn’t realize that Quick Help was a “hidden” feature of Xcode until I mentioned it at the SF Swift Meetup last week and realized some were unfamiliar. You may also want to check out the Swift Documentation post from NSHipster.īeta 5 brought us some notable improvements in optionals and ranges but also the beginning of Quick Help in Swift.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |