Created
December 16, 2015 11:21
-
-
Save fabb/2b0d390e077b130927cc to your computer and use it in GitHub Desktop.
Revisions
-
fabb created this gist
Dec 16, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ import Foundation struct Song { let title: String let length: Float func withAddedAdvertisement() -> Song { return Song(title: self.title + " plus commercial", length: self.length + 10) } } let song1 = Song(title: "Aerials", length: 240) let song2 = song1.withAddedAdvertisement() print(song2.length)