Is there a constant for the maximum CGFloat value?

前端 未结 8 765
滥情空心
滥情空心 2021-02-02 05:09

I need to create a CGSize to compute text height of an arbitrary text with arbitrary length. UIKit has this nice method -sizeWithFont:constrainedToSize: and my text is only cons

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-02 05:50

    In Swift 3.0, You can also use CGFloat(FLT_MAX), especially if you want to use it in other cases like zIndex, where CGFloat.greatestFiniteMagnitude will be out of range.

提交回复
热议问题