Greetings
> Thanks for your reply, Rien. I just tried this again, and now it seems that
> either is acceptable. Seems a little weird, but I guess I’d rather have more
> flexibility than less.
> class GPS : Powerable, CustomStringConvertible {
> // Either of these work
> // var description: String {
> // return "I am a GPS"
> // }
> var description:String = "I am a GPS"
You can also implement description as a let, since there is no intention to
modify it :
class GPS : Powerable, CustomStringConvertible
{
let description = "I am a GPS"
…
}
Joanna
--
Joanna Carter
Carter Consulting
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users