Posts

Showing posts with the label NSTextView

Taming Nsdocument Too Agreement Who's Boss: Creating A Unproblematic Macos Text Editor (Swift 3, Xcode Viii Beta 6)

Image
Looking at Apple's diagrams inward their documentation nosotros meet that NSDocumentController is boss of NSDocument, which inward plough is boss of NSWindowController together with this leads to the document window beingness displayed. Yup, but what is actually happening together with what does this hateful inward price of code? Creating the project As with other apps, create a novel projection together with choose macOS Cocoa every bit the type: And having clicked next, brand certain you lot choose the "Create Document-Based Application" checkbox: Navigating the Files When a document-based app is created amongst the familiar AppDelegate together with ViewController files nosotros convey Document.swift every bit well. This concluding shape file providing a subclass of NSDocument. The most of import matter to banknote origin of all is that: the ViewController shape does not ain or create an instance of our NSDocument subclass (i.e. Document) the...

My Favourite Macos Evolution Bugs

1. Changing the Background Colour Influenza A virus subtype H5N1 elementary matter to create inwards iOS is to alter the background colouring cloth of a sentiment simply inwards macOS you lot necessitate to showtime tell the sentiment you lot desire the layer together with and hence reference the layer. And in conclusion you lot necessitate to overstep away it a CGColor rather than an NSColor. 2. NSTextView NSTextView together with the means it interacts alongside NSScrollView is a whole tin of worms that I'm working on getting my caput around. But 1 of the showtime hurdles is that if you lot are working alongside the element parts: NSLayoutManager, NSTextContainer together with NSTextStorage – together with hence you lot must retain a reference to the text store for it to survive equally expected. Follow @sketchytech