Post

Replies

Boosts

Views

Activity

Comment on Animate sizeToFit
I get: When I change the text of a label, that label, and all the stack change abruptly. I expect: When I change the text of a label, that label and all the stack changes the width slowly (in my example, in 4 seconds). (If I knew what text the user put I could change the width of the elements? But I cannot know that). On the other side, I am in macOS. I tried transform to see what happens but it says: Value of type NSTextField does not have transform. In any case, I do not know the size of the label. So, I do not think transform is the way to go?
Aug ’21
Comment on Presentation single with code
Thank you for reformulating my question more clearly. Your assumptions are right. Your solution works well. I have some doubts about the var controller. I understand what you say that I must put the var to nil when I close the window. But if the close button is in another view controller, that is in another class, should I make var controller global in the first place?. But if I understand global vars are not recommended? I am not sure if I explain well my problem.
Aug ’21
Comment on How to stop an animation
As I said in my question I already have done that. I am asking how to "pause" or stop the animation not how to "remove". When I use removeAllAnimations, view1 goes to alphaValue = 1 (in your example) I want to click stop/pause and the animation stop at that point, at some % between 0 and 1 alphaValue. Perhaps at 0.3 or 0.5 or whatever it is when the user click to stop/pause
Aug ’21
Comment on Usable screen space in a Mac
It works very well. Thank you! Can you explain this line? Where can I learn more about it?: let usableHight = NSMenu.menuBarVisible() ? totalHight - 23 : totalHight I would like to learn more. I understand what it does, but I do not know what it is or how to reproduce in another circumstance.
Aug ’21
Comment on Open a View from the menu
There must be something I do wrong or do not understand in point 2: I select the Window Controller > Identity Inspector > Class > I cannot change it. I write MyWindowController and when I make intro or go away, it disappears. What am I missing? (in point 1 I have created File > New > Cocoa Class > Class: MyWindowController, Subclass of NSViewController, no XIP selected)
Sep ’21