Swift return type clarification

后端 未结 4 1843
既然无缘
既然无缘 2021-01-29 13:05

I see a Swift function written as follows:

func calculation(imageRef: CGImage) -> (red: [UInt], green: [UInt], blue: [UInt]) {

 ...
 ...
}

4条回答
  •  深忆病人
    2021-01-29 13:35

    This called Tuple learn here

    it allows to group multiple values under single variable.

    Objective c don't support tuple . in objc you have to use dictionary and you have to use key red , green and 'blue with array as value

提交回复
热议问题