#This snippet shows how to get the string size rect in interface Notice the target string must be NSString type not String type in swift
Created
January 17, 2018 02:26
-
-
Save Lancewer/53f835db38e06fbc42b01bda4bd69a62 to your computer and use it in GitHub Desktop.
[GetStringSize] how to get the string size rect in iOS #String #Swift #iOS #size #UI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let cellTitle:NSString = "string to calculate" | |
var autoSize = cellTitle.size(withAttributes: [NSAttributedStringKey.font:UIFont.systemFont(ofSize: 17.0)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment