Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialWameedh Mohammed Ali
5,150 Pointslong: coordinate?????!!!
Why do we need to include 'long:' before: 'coordinate.long' wihle we include 'lat:' 'before coordinate.lat' ?
forecastService.getForecast(coordinate.lat, long: coordinate.long){ (let currently) in if let currentWeather = currently { //Update UI }
1 Answer
Rebecca Hansmeyer
712 PointsIn Swift, the name of the first parameter in a function is omitted by default. You can read more about it in Apple's Swift documentation under "Function Parameter Names." You can certainly add "lat:" in front of coordinate.lat if you want to add some clarity to the function declaration...it will still work fine!
Wameedh Mohammed Ali
5,150 PointsWameedh Mohammed Ali
5,150 PointsThank you Rebecca!