Skip to content

Cannot use 'font' modifier #1

@andreybuksha

Description

@andreybuksha

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions