42
43

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SwiftでDelegateパターン

Last updated at Posted at 2014-06-04

初Qiitaなんでフォーマットとか崩してたらすいません

#Swiftでのdelegateパターン

宣言

@objc protocol delegateName {    
    optional func delegateMethodName(name1: Int) -> Int
}

呼び出し元

let hoge = delegate?.delegateMethodName?(0)

呼び出される側

func delegateMethodName(name1: Int) -> Int{    
    return 0
}
42
43
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
42
43

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?