Created the Geocoding tutorial in Swift

Yeah, we can also do that. I would suggest that we keep them as is for these tutorials and follow what you suggested in the new tutorials/sample. (the ones we change from now onwards)

From: Divesh Goyal <notifications@github.com<mailto:notifications@github.com>>
Reply-To: dg0yal/arcgis-runtime-tutorials-ios <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Monday, August 4, 2014 at 2:55 PM
To: dg0yal/arcgis-runtime-tutorials-ios <arcgis-runtime-tutorials-ios@noreply.github.com<mailto:arcgis-runtime-tutorials-ios@noreply.github.com>>
Cc: Gagandeep Singh <gagandeep_singh@esri.com<mailto:gagandeep_singh@esri.com>>
Subject: Re: [arcgis-runtime-tutorials-ios] Created the Geocoding tutorial in Swift (#5)


In Geocoding Swift Tutorial/MyFirstMapApp/MyFirstMapApp/ViewController.swift:

> +
> +    func searchBarSearchButtonClicked(searchBar: UISearchBar!) {
> +        //Hide the keyboard
> +        searchBar.resignFirstResponder()
> +
> +        if(!self.graphicLayer) {
> +            //Add a graphics layer to the map. This layer will hold geocoding results
> +            self.graphicLayer = AGSGraphicsLayer.graphicsLayer() as? AGSGraphicsLayer
> +            self.mapView.addMapLayer(self.graphicLayer, withName:"Results")
> +
> +            //Assign a simple renderer to the layer to display results as pushpins
> +            var pushpin = AGSPictureMarkerSymbol(imageNamed: "BluePushpin.png")
> +            pushpin.offset = CGPointMake(9, 16)
> +            pushpin.leaderPoint = CGPointMake(-9, 11)
> +            var renderer = AGSSimpleRenderer.simpleRendererWithSymbol(pushpin) as AGSSimpleRenderer
> +            self.graphicLayer!.renderer = renderer


Continuing from my comment above about making it implicitly unwrapped optional, we could then change this to be self.graphicLayer.renderer = renderer. No unwrapping needed.

—
Reply to this email directly or view it on GitHub<https://github.com/dg0yal/arcgis-runtime-tutorials-ios/pull/5/files#r15783897>.