SwiftRichString icon indicating copy to clipboard operation
SwiftRichString copied to clipboard

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

Open zhangfurun opened this issue 3 years ago β€’ 2 comments

'AttributedString' is ambiguous for type lookup in this context ζˆͺ屏2021-09-22 δΈ‹εˆ1 21 50

zhangfurun avatar Sep 22 '21 05:09 zhangfurun

One workaround is to change NSAttributedString to NSMutableAttributedString.

fredericoamsb avatar Sep 23 '21 16:09 fredericoamsb

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?

aornano avatar Oct 05 '21 09:10 aornano