Advertisement
Guest User

Untitled

a guest
Apr 27th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1.  
  2. protocol FooProtocol {
  3. func blah()
  4. }
  5.  
  6.  
  7. struct Foo : FooProtocol {
  8. func blah() {}
  9. }
  10.  
  11. struct FooTaker {
  12. init(inout aFoo: FooProtocol) {
  13. println("I got a foo! \(aFoo)")
  14. }
  15. }
  16.  
  17. let x: FooProtocol? = Foo()
  18. if var foo = x {
  19. FooTaker(aFoo: &foo)
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement