クロージャーって便利だなーと思うのですが、クロージャー変数を定義する時、メソッドの引数にクロージャーを使う時… ちょっとめんどくさいな… と思っていました。 ^^;
長いこと「typedef みたいな感じのないのかなぁ…」とは思っていたのですが、やっと見つけましたwww ^^;;;
これだわww
「typealias」これは楽だわww 毎回忘れて確認してたのがアホみたいwww ^^;
This file contains hidden or 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
/** | |
* https://stackoverflow.com/questions/24077428/how-do-i-declare-typedef-in-swift | |
*/ | |
//やりたかったこと | |
typealias FunctionClosure = (_ value: Int) -> Void | |
fileprivate var _closure: FunctionClosure? = nil |