“Expression is not assignable” — Problem assigning float as sum of two other floats in Xcode?

后端 未结 5 887
北恋
北恋 2020-11-30 04:47

In a piano app, I\'m assigning the coordinates of the black keys. Here is the line of code causing the error.

\'blackKey\' and \'whiteKey\' are both customViews

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-30 05:08

    blackKey.center = CGPointMake ( whiteKey.frame.origin.x + whiteKey.frame.size.width, blackKey.center.y);
    

    One way of doing it.

提交回复
热议问题