malcommac / SwiftRichString

πŸ‘©β€πŸŽ¨ Elegant Attributed String composition in Swift sauce
MIT License
3.1k stars 211 forks source link

Xcode 13 run bugs: 'AttributedString' is ambiguous for type lookup in this context #135

Open zhangfurun opened 2 years ago

zhangfurun commented 2 years ago

'AttributedString' is ambiguous for type lookup in this context

ζˆͺ屏2021-09-22 δΈ‹εˆ1 21 50
fredericoamsb commented 2 years ago

One workaround is to change NSAttributedString to NSMutableAttributedString.

aornano commented 2 years ago

That happened 'cause iOS 15 contains Foundation.AttributedString, to avoid this misunderstanding from the compiler you can make an alias to your code like this: typealias AttributedString = SwiftRichString.AttributedString

just before your var declarations like this example:

typealias AttributedString = SwiftRichString.AttributedString
var appointmentDate : AttributedString?