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 trial

iOS Object-Oriented Swift 2.0 Classes Classes with Custom Types

Chance Robertson
Chance Robertson
2,975 Points

Having a challenge with this challenge. Anybody catch what I'm missing or doing wrong?

Having a challenge with this challenge. Anybody catch what I'm missing or doing wrong?

classes.swift
struct Location {
    let latitude: Double
    let longitude: Double

    init(latitude: Double, longitude: Double){
    self.latitude = latitude
    self.longitude = longitude
}
}

class Business {
let name: String
let location: Location

init(name: String, location: Location) {
self.name = name
self.location = location
}
}

let someBusiness = Business(name: "Chances", location: Location (latitude: 13.1, longitude: 31.3)
om patel
om patel
738 Points

class Business { let name: String let location: Location

init(name: String, location: Double) { self.name = name self.location = location } }

2 Answers

om patel
om patel
738 Points

class Business { let name: String let location: Location

init(name: String, location: Double) { self.name = name self.location = location } }

make this changes. also if this doesn't work copy and paste the whole question to better help you.

Your "someBusiness" variable needs another parenthesis at the end.

let someBusiness = Business(name: "Chances", location: Location (latitude: 13.1, longitude: 31.3))