Skip to content

Instantly share code, notes, and snippets.

@fabb fabb/SongPoll4.swift
Created Dec 16, 2015

Embed
What would you like to do?
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.