Reputation: 40030
In Objective-C we have NSStringFromCGSize
method that converts CGSize
to NSString
. I want to make my code as Swifty as possible and I don't want to use this vintage method.
public func NSStringFromCGSize(_ size: CGSize) -> String
Is there a Swift 3 API for that? I know I could easily code a helper function but I might be reinventing the wheel, maybe there is already something like that built in into the framework.
Please help.
Upvotes: 1
Views: 572
Reputation: 182
Why not just encase your CGSize in \()
like
let string = "\(CGSize.zero)"
Upvotes: 1