I went through the Text Kit Tutorial on raywenderlich.com and the line
edited(.EditedCharacters | .EditedAttributes, range: range, changeInLength: (str as NSString).length - range.length)
produces the following error:
No '|' candidates produce the expected contextual result type 'NSTextStorageEditActions'
The error goes away when I change the first argument to:
edited(.EditedCharacters, range: range, changeInLength: (str as NSString).length - range.length)
I also tried using "OR" and "||" without any success.
Swift 2.2 and iOS 9.2
@dfri is correct. To illustrate another example of using the pipe, "|", is when doing the autoResizingMask for UIImageView as follows:
imageView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight, ...]
Of course you'd replace the ...
with other UIViewAutoresizing
options.
Good luck!
Put them all in an array like below:
instead of pipe
let timeDateComponents = calendar.components(NSCalendarUnit.Hour| NSCalendarUnit.Minute| NSCalendarUnit.Second, fromDate: NSDate())
try this
let timeDateComponents = calendar.components([NSCalendarUnit.Hour, NSCalendarUnit.Minute, NSCalendarUnit.Second], fromDate: NSDate())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With