Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Foundation
- class CookTheChef {
- func addCheese() -> CookTheChef {
- print("adding Cheese")
- return self
- }
- func addPeper() -> CookTheChef {
- print("adding Peper")
- return self
- }
- func makeBurger() {
- print("making Burger")
- }
- }
- class CookTheChefTest {
- func test() {
- let cookTheChef = CookTheChef()
- cookTheChef.addPeper().addCheese().makeBurger()
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement