Skip to content

Instantly share code, notes, and snippets.

@fabb
Created December 16, 2015 11:12
Show Gist options
  • Save fabb/e72a58a175f84d68937b to your computer and use it in GitHub Desktop.
Save fabb/e72a58a175f84d68937b to your computer and use it in GitHub Desktop.
import Foundation
struct Song {
var title: String
var length: Float
mutating func addAdvertisement() {
self.title += " plus commercial"
self.length += 10
}
}
var song = Song(title: "Aerials", length: 240)
song.addAdvertisement()
print(song.length)
@fabb
Copy link
Author

fabb commented Dec 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment