Yes, thanks. It works now. I had been staring at the dictionary type and was thinking that they (NSString & String) are equivalent. I’m curious though, in the documentation for the sizeWithAttributes the Swift version has it typed as taking [String : AnyObject] while Objective-C has NSDictionary<NSString *, id>. What I am wondering is if I am using Swift where is the cast between the String and NSString done and what is the overhead? Is a new NSDictionary created and populated from the Swift dictionary (iterating over each entry and casting each String element to NSString as the NSDictionary is populated) or is the dictionary as whole somehow just bridged between the two with no additional overhead.
Declaration
SWIFT
func sizeWithAttributes(_ attrs: [String : AnyObject]?) -> NSSize
OBJECTIVE-C
- (NSSize)sizeWithAttributes:(NSDictionary<NSString *,
id> * nullable)attributes