I’m trying to pass multiple options for NSLineBreakMode in Swift. In Objective C this works:
label.lineBreakMode = NSLineBreakByWordWrapping | NSLineBreakByTruncatingTail;
Referring to this, I’ve tried setting options in a constant like this:
var lineBreakOptions: NSLineBreakMode = [.ByWordWrapping,.ByTruncatingTail]
passageExcerpt.lineBreakMode = lineBreakOptions
But I’m getting an error back that says:
Contextual type 'NSLineBreakMode' cannot be used with array literal.
Is there a way to pass multiple options for NSLineBreakMode’s enum?