Skip to content

Instantly share code, notes, and snippets.

@iamcrypticcoder
Created March 31, 2018 09:54
Show Gist options
  • Save iamcrypticcoder/b80065dc8757c63f115c4cd1fe81517e to your computer and use it in GitHub Desktop.
Save iamcrypticcoder/b80065dc8757c63f115c4cd1fe81517e to your computer and use it in GitHub Desktop.
import Foundation
public class Book {
var currentOwner: String?
func buy() -> Void {
print("Buying the book...")
currentOwner = "Me"
}
func sell() -> Void {
print("Selling the book...")
currentOwner = "Library"
}
func giftToFriend(_ friendName: String) -> Void {
print("Sending the book as gift to \(friendName)")
currentOwner = "Friend"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment