ios - What does this kind of declaration of parameters signal (swift)? -
i beginner programmer , reading book on ios programming.
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
Post a Comment