> Been playing around with NSAttributedString and cannot decide on the best way > to implement the (attributesAtIndex: effectiveRange) and other methods with > similar functionality. > > In the ObjC world I would expect an empty NSDictionary even in cases where > the location is greater than the length of the string.
Personally, if I indexed past the end of an attributed string, I would expect a precondition to fail and (since Swift can't catch assertion failures) my app to crash. (And from what I can tell, the Apple Foundation versions of these APIs do not return an optional.) (Sorry about the duplicate, James—didn’t hit Reply All when I should have.) -- Brent Royal-Gordon Architechies _______________________________________________ swift-corelibs-dev mailing list swift-corelibs-dev@swift.org https://lists.swift.org/mailman/listinfo/swift-corelibs-dev