Created
March 31, 2018 09:54
-
-
Save iamcrypticcoder/b80065dc8757c63f115c4cd1fe81517e to your computer and use it in GitHub Desktop.
This file contains 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 characters
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