Is AppKit causing you frustration? Instead of just complaining about it, lets try to make it better by compiling a list of specific problems with AppKit. Leave a comment below, and I'll include it in the list.
##NSView##
NSView
does not have the ability to set an affine transform (rdar://15608609)- Controls that have cells (such as
NSTextField
) do not respond properly when layer-backed. TakeNSButton
as an example. When not layer-backed, it will animate properly using the animator proxy. When layer-backed, using the animator proxy breaks focus rings (they jump to destination immediately). Currently, directly manipulating the layer of a cell-based control is not supported (and will lead to a broken interface), but is much needed. (rdar://15608822)
##NSViewController##
NSViewController
could be more useful. It has-loadView
but no other lifecycle methods. (rdar://15608948)
##NSClipView##
. Improved under 10.9.NSClipView
has performance issuesRBLClipView
attempts to fix this.
NSClipView
has a poor animation when using-scrollRectToVisible:
. (rdar://15609175)JNWClipView
attempts to fix this.
##NSTableView##
NSTableView
has odd animation artifacts when scrolling with the keyboard with a fast key repeat.- Due to the clip view issue mentioned above. (rdar://15609175)
NSTableView
does not fully support sections – all rows in the table are numbered sequentially, rather than as (section #, row #) asUITableView
does. This makes it difficult to alter sections independently. (rdar://15609306)
##NSCollectionView##
NSCollectionView
is not performant. It loads every single cell all at once, and it keeps them all in memory. It does not reuse cells. (rdar://15609666)
##NSBrowser##
NSBrowser
is not view-based likeNSTableView
andNSOutlineView
.
##NSSlider##
NSSlider
requires use of private method-_usesCustomTrackImage
in order to completely customize appearance.NSSlider
needs a "rounded textured" style for use in window frames (like in Finder).
##NSSearchField##
NSSearchField
does not support tokens.
##NSTextField##
NSTextField
does not support a custom context menu when the text is selectable and/or editable. It requires hacking around with the field editor to implement this functionality.
##NSSplitView##
NSSplitView
makes simple customization like setting priorities and min/max sizes for views is unnecessarily complex.
##NSProgressIndicator##
NSProgressIndicator
still draws the original progress bar even if drawing is overridden. (rdar://15609817)NSProgressIndicator
's color cannot be changed without workarounds such as Core Image filters. (rdar://15609817)
##NSPopover##
NSPopover
does not offer a way to customize its appearance apart from the two default styles.RBLPopover
attempts to fix this.
NSPopover
steals keyboard focus.
##NSWindow##
NSWindow
animation is poor without the use of some not-so-nice hacks.- Borderless
NSWindows
(NSBorderlessWindowMask
) do not have the ability to round their corners. - Borderless
NSWindows
with a layer-backed content view do not get a shadow. NSWindow
is really difficult to customize.INAppStoreWindow
attempts to fix this.
##NSDocument##
NSDocument
has very bad support for documents that aren't fully loaded into memory. Nearly all of the API assumes that you can generate a singularNSData
object to store your document in, which isn't true if half of your document is on disk only and the other half in memory only.NSPersistentDocument
doesn't support file wrappers (bundles), even though that's a requirement for the sqlite data storage with sandboxing enabled. All workarounds at this point are huge hacks.
##NSObjectController##
- While
NSObjectController
and its subclasses (e.g.NSArrayController
) support retrieving objects from a Core Data managed object context, they do not offer a way to receive per-change notifications. This means that you need to reload your entire view vs. inserting/removing/moving the cells that were updated. Ideally, we would want a port ofNSFetchedResultsController
.
##NSDrawer##
NSDrawer
should either be deprecated or have its API fully updated to support customization.
##NSImage##
NSImage
does not support drawing stretchable images with caps.RBLResizableImage
attempts to fix this.
##Field Editors##
- Field editors are conceptually unusual and confusing.
##Cells & Controls##
- The use of cells in specific controls such as
NSTextField
andNSButton
make them difficult to customize. NSButtonCell
is poorly thought out.bezelStyle
,gradientType
,buttonType
,isHighlighted
,state
and a few more make for a really really confusing subclassing experience.NSTextFieldCell
does not have vertically-centered text. A subclass is required.- Template images and window-style engraved text should be useable without the use of captive cells.
- AppKit controls need image-based customization properties like their UIKit counterparts.
- AppKit does not provide HUD-styled controls.
SNRHUDKit
attempts to fix this.
- Interface Builder does not support bindings for custom controls.
##Misc. (not necessarily AppKit)###
- There is no Cocoa wrapper for the Carbon hotkeys API.
DGGHotKey
attempts to fix this.
- There is no Cocoa wrapper for
FSEvents
. The Spotlight stuff doesn't really work for sandboxed Applications. - There is no API for AirPlay.
NSPopover
steals keyboard focus and there's no good way to prevent it.NSSearchField
doesn't have a tokenizing option.NSTextField
s, as in my browser's location bar.