I hereby claim:
- I am ohitsshaun on github.
- I am shaunamerchant (https://keybase.io/shaunamerchant) on keybase.
- I have a public key whose fingerprint is F550 610A C16A 919D 209A 4C87 D5C1 BE20 A58A 640A
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import UIKit | |
extension NSNotification.Name { | |
static let didResignKey = Self.init("UISBHSMainHostWindowDidResignKeyNotification") | |
static let didBecomeKey = Self.init("UISBHSMainHostWindowDidBecomeKeyNotification") | |
} | |
extension Notification { |
// You may want to present a UIKit popover from an NSToolbarItem, e.g. Maps.app uses | |
// a popover to select between viewing modes of default, Transit and Satlite. | |
// | |
// In UIKit land, set the popover controller's source view as the containing UIWindow, | |
// and use the following to grab the source rect from the NSToolbarItem in an AppKit | |
// bundle. | |
// | |
// Uses private APIs so mileage varies. | |
func position(for toolbarItem: NSToolbarItem) -> CGRect? { | |
guard let view = toolbarItem.value(forKey: "_view") as? NSView, |