AttributedStringBuilder icon indicating copy to clipboard operation
AttributedStringBuilder copied to clipboard

Cannot use 'font' modifier

Open andreybuksha opened this issue 6 years ago • 0 comments

Hey! Thank you for the library! I tried to understand function builders following examples but stuck with some strange error when adding font modifier.

Here is all the code I have (it is a clean project, Xcode 10.3):

NSAttributedString {
          "Hello "
            .foregroundColor(.black)
//            .font(UIFont.systemFont(ofSize: 10.0))
            .background(.red)
            .underline(.blue)
          "World"
            .foregroundColor(.green)
            .underline(.orange, style: .thick)
        }

If I comment "font" it compiles and all is good, but if I try ti uncomment I get the error: Expression type 'NSAttributedString' is ambiguous without more context.

andreybuksha avatar Jan 08 '20 11:01 andreybuksha