Swift
private extension UILabel { func countLines() -> Int { guard let text = self.text as NSString? else { return 0 } let rect = CGSize(width: self.bounds.width, height: CGFloat.greatestFiniteMagnitude) let labelSize = text.boundingRect(with: r…
if UIDevice.current.orientation.isPortraint { print("縦向き") } if UIDevice.current.orientation.isLandscape { print("横向き") }