The following code works as expected: But do you know what “expected” means in this case? As a reader, you assume the author had an intention. You look for the mens auctoris and are an overall benevolent reader, I hope. Presupposing said intention, you may assume that it does something special if you put the call to items.removeAll()
in a defer
block.
Continue reading …
NSTextView
(and UITextView
for that matter) have a defaultParagraphStyle
attribute where you can set the text’s line height. That works swell – if you display text statically. Once the user can enter something, you can run into trouble: Update 2017-07: I posted a better version without paragraph style attributes that hooks into the NSLayoutManager
delegate callbacks for a more consistent and speedy experience!
Continue reading …
I wrote about using NSUndoManager
+ ReSwift with a Middleware. You could think of the resulting UndoMiddleware
as some kind of observer of events that pass the ReSwift.Store
and which puts the opposites of incoming actions on the undo stack. Why a Middleware? Because making an action undoable is a side effect.
Continue reading …