Reputation: 670
how can i achieve user-resizable views like in interface builder, so that the user can adjust some images by their own
Do i have to manage all this manually with a view that watches mouse movement and so on?
Upvotes: 5
Views: 1084
Reputation: 46020
You have to do all the work yourself. You will need to keep track of the objects in your view, their positions and do all the mouse tracking and view updating.
However, this is not actually very difficult, and Apple has provided a very complete example in its Sketch sample code.
Upvotes: 2
Reputation: 3054
I suggest drawing some buttons where you want the view to be resizable. Then start tracking mouse events in the view. Now, when a user drags its mouse while clicking on when of your spots, just change the view's frame accordingly. All of that should be possible to implement in a subclass of NSView
.
Upvotes: 0