Esqarrouth / EZSwiftExtensions

:smirk: How Swift standard types and classes were supposed to work.
MIT License
3k stars 381 forks source link

Lose "public" #421

Closed taogeyijiu closed 7 years ago

taogeyijiu commented 7 years ago

UIAlertControllerExtensions: extension UIAlertController { /// EZSE: Easy way to present UIAlertController func show() { UIApplication.shared.keyWindow?.rootViewController?.present(self, animated: true, completion: nil) } } And StringExtensions: ///EZSE: Returns hight of rendered string func height(_ width: CGFloat, font: UIFont, lineBreakMode: NSLineBreakMode?) -> CGFloat { var attrib: [String: AnyObject] = [NSFontAttributeName: font] if lineBreakMode != nil { let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.lineBreakMode = lineBreakMode! attrib.updateValue(paragraphStyle, forKey: NSParagraphStyleAttributeName) } let size = CGSize(width: width, height: CGFloat(DBL_MAX)) return ceil((self as NSString).boundingRect(with: size, options: NSStringDrawingOptions.usesLineFragmentOrigin, attributes:attrib, context: nil).height) }

This two method is do not work, why?

Khalian commented 7 years ago

Not sure I understand the premise of this question. Is it that these methods are not accessible to callers ? Or is there a runtime failure of some sorts?

taogeyijiu commented 7 years ago

methods are not accessible to callers ,I use cocoapods

taogeyijiu commented 7 years ago

wx20170515-103716 2x
Khalian commented 7 years ago

gotcha. I will fix that oversight.

taogeyijiu commented 7 years ago

ok

Khalian commented 7 years ago

So string height has been recently fixed in https://github.com/goktugyil/EZSwiftExtensions/commit/2395fa54

I will put out a PR for the other one.

taogeyijiu commented 7 years ago
wx20170515-110808 2x