You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've converted my app to Swift 2.0, which hasn't gone very successfully so far! I'm getting one issue with SCLAlertView with boundingRectWithSize in the following code:
// Subtitle
if !subTitle.isEmpty {
viewText.text = subtitle
// Adjust text view size, if necessary
let str = subTitle as NSString
let attr = [NSFontAttributeName:viewText.font]
let sz = CGSize(width: kWindowWidth - 24, height:90)
let r = str.boundingRectWithSize(sz, options: NSStringDrawingOptions.UsesLineFragmentOrigin, attributes:attr, context:nil)
let ht = ceil(r.size.height)
if ht < kTextHeight {
kWindowHeight -= (kTextHeight - ht)
kTextHeight = ht
}
}
The error reads:
Cannot invoke 'boundingRectWithSize' with an argument list of type '(CGSize, options: NSStringDrawingOptions, attributes: [String : UIFont?], context: nil)'
Is this just me, or have others found this?
The text was updated successfully, but these errors were encountered:
I came across this too. You need to unwrap viewText.font. The argument attributes for boundingRectWithSize method should be of type [String : UIFont]. Since viewText.font is not unwrapped, attr is currently of type [String : UIFont?].
I've converted my app to Swift 2.0, which hasn't gone very successfully so far! I'm getting one issue with SCLAlertView with boundingRectWithSize in the following code:
The error reads:
Is this just me, or have others found this?
The text was updated successfully, but these errors were encountered: