ios - What does this kind of declaration of parameters signal (swift)? -


i beginner programmer , reading book on ios programming.

enter image description here

what mean? takes parameter of cgsize, returns cgfloat, , uiimage? point of that?

the following declaration more readable when that:

func makeroundedrectanglemaker(_ sz:cgsize) -> ((cgfloat) -> uiimage?) {     return nil } 

this function takes cgsize parameter method , returns closure kind of function type. here at link can read more it.

also, can create typealias closures, function that:

typealias customnameofclosure = (cgfloat) -> (uiimage?)  func makeroundedrectanglemaker(_ sz:cgsize) -> customnameofclouse {     return nil } 

hope helps :)


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

Command prompt result in label. Python 2.7 -