Should conditional compilation be used to cope with difference in CGFloat on different architectures?

前端 未结 3 1634
南方客
南方客 2020-12-02 02:34

In answering this earlier question about getting a use of ceil() on a CGFloat to compile for all architectures, I suggested a solution along these lines:

<
3条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 02:38

        var f : CGFloat = 0.5
        var result : CGFloat
        result = CGFloat(ceil(Double(f)))
    

    Tell me what I'm missing, but that seems pretty simple to me.

提交回复
热议问题