Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. import Foundation
  2. class CookTheChef {
  3. func addCheese() -> CookTheChef {
  4. print("adding Cheese")
  5. return self
  6. }
  7. func addPeper() -> CookTheChef {
  8. print("adding Peper")
  9. return self
  10. }
  11. func makeBurger() {
  12. print("making Burger")
  13. }
  14. }
  15. class CookTheChefTest {
  16. func test() {
  17. let cookTheChef = CookTheChef()
  18. cookTheChef.addPeper().addCheese().makeBurger()
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement