Category "cocoa"

Using INotifyPropertyChanged view models with Cocoa/AppKit bindings

I know this is pretty esoteric but hoping someone has a solution for me. I have an application that started life as WPF, moved to UWP and now lives primarily as

Read and write permission for user selected folder in Mac OS app?

I am developing MAC OS app which have functionality to create file on the behalf of your. First user select folder for storing file (One time at start of app) a

How to move NSImageView inside NSView in Cocoa?

In my Mac OS app I need a functionality to be able to move NSImageView around inside an NSView after mouseDown event (triggered by user) happen in this NSImageV

NSDocumentController.openDocument not allowing selection of custom file type

I suspect this is a finicky configuration issue that I'm getting wrong with Document Type / UTI declarations in my Info.plist, but have tried several things and

Detect if the active keyboard has a physical `Fn` key in Swift

I want to use the Fn modifier key if available, and if not, offer the user a different modifier. But only offer it to users without a Fn key. Some external keyb

How to get a swift enum's associated value regardless of the enum case

I have an object FormField which has two properties: a String name, and a value which can accept any type--hence I've made it Any!. However, I've been told in a

CGDisplayIOServicePort is deprecated in OS X >= 10.9, how to replace?

I did small app to allow quickly change screen resolutions on multiple monitors. I want to show product name as title of the monitor, and it's very simple to fi

CGDisplayIOServicePort is deprecated in OS X >= 10.9, how to replace?

I did small app to allow quickly change screen resolutions on multiple monitors. I want to show product name as title of the monitor, and it's very simple to fi

How to zoom the screen programmatically with private coregraphic methods (how to find function arguments)

as you may know Mac OS X has a pretty nice screen zooming functionality built in, which can be enabled in System Preferences => Universal Access. Now I'm tr

Simulate run on older OS X version

How can simulate a run on a older OS X version ? Right now my app works on 10.7 and 10.8 but I want to make it compatible with 10.6. Since I'm using some new

How to disable Click through to a NSView behind another NSView

I have two NSViews on top of each other. One NSView presents a table with rows. On clicking a row another view is shown on top of that view. Now the problem i

CrashReporter dialog doesn't show when mac app crashes

I have a Mac app store app that just silently disappears when it crashes. It doesn't show the CrashReporter dialog to give the user a chance to report the crash

Get Image from CALayer or NSView (swift 3)

I was looking for a way to render a CALayer or NSView and get NSImage back. I have a custom class, which is a subclass of NSView. At the beginning I simply make

Drag-to-resize NSView (or other object)

I'm trying to build an app that will allow the user to specify multiple areas of an image using rectangular bounding boxes that they can resize. So far, I've g

how to move NSWindow to a particular screen?

In my app I need to be able to move my app's windows between the screens programmatically. I'm working on my MacBookPro and I'm connected to DELL monitor. So wh