orderFront
orderFront is a method used in Apple’s AppKit frameworks to adjust the stacking order of windows or views, bringing them to the front of their respective front-most layer.
In NSWindow, orderFront: moves the window to the front of the screen’s window list at its current
In NSView, orderFront: reorders the view among its sibling subviews within the same superview, placing the specified
Usage in Objective-C and Swift:
- Objective-C NSWindow: [window orderFront:self]; [window orderFrontRegardless:self]; [window makeKeyAndOrderFront:self];
- Swift NSWindow: window.orderFront(self); window.orderFrontRegardless(self); window.makeKeyAndOrderFront(self)
- Objective-C NSView: [view orderFront:self];
- Swift NSView: view.orderFront(self)
- orderFront affects z-order within the same app’s UI and windowing context.
- orderFrontRegardless can bypass certain activation rules, useful for utility windows or auxiliary panels.