Questions tagged [nsanimationcontext]

28 questions
1
vote
0 answers

NSAnimationContext On Several Views Simultaneously

I have two NSViews. I have a simple need, to slide one view off screen and another into view. I have been playing with NSAnimationContext and managed to achieve a good simple animation, however it won't animate both my views. Here is my…
Josh Kahane
  • 15,834
  • 40
  • 127
  • 241
1
vote
0 answers

NSAnimationContext misbehaving

I have a button that triggers the main window to animate it's height thus displaying some options in a pull-down-menu. The button (and it's sibling) are placed in the two bottom corners of the window, so i want them to animate down with the window -…
frdnrdb
  • 61
  • 8
1
vote
1 answer

NSAnimationContext for iOS

My questions are : Does NSAnimationContext work in iOS ? If the answer to question 1 is no, is CATransaction a good replacement ?
Stanley
  • 4,292
  • 6
  • 28
  • 47
0
votes
1 answer

MacOS Animation delay in swift

Is it possible to add a delay to an animation with Cocoa? In my current code it shows a window and hides it with fade animation. What I am trying to do is add a delay before the fade animation. @IBAction func doIt(_ sender: NSButton) { …
unknown
  • 111
  • 7
0
votes
1 answer

Swift MacOS NSAnimationContext not following its duration

I have a very simple animation which is moving a view throughout the main view like this: NSAnimationContext.runAnimationGroup({ (_) in NSAnimationContext.current.duration = 50.0 viewTOModify.frame.origin.x = -20 }) { …
0
votes
1 answer

Whats the best way in Swift to animate an array of NSViews to appear one after another in an NSStackView?

I'm able add a number of NSTextFields to an NSStackView using the following code: optionsStackView.addView(newOption, in: .center) The problem I'm encountering is getting each NSTextField (newOption) to appear one after another when the view appears…
0
votes
1 answer

How do I animate NSView with curve

I know how to animate NSView objects using +[NSAnimationContext runAnimationGroup:completionHandler:], but I can't see a way of setting the animation curve on this type of animation. I see that NSAnimation has an init method which includes a…
mashers
  • 939
  • 6
  • 20
0
votes
1 answer

Animation of Auto Layout Constraint Not Happening inside NSTableCellView

I'm trying to get an auto layout constraint to update with animation inside an NSTableCellView. The constraint is updating fine, but it's not happening with animation. The following code is executed inside tableView(_ tableView: NSTableView, viewFor…
Clifton Labrum
  • 9,827
  • 7
  • 45
  • 86
0
votes
1 answer

Incorrect animation with layout constraints and NSAnimationContext

I want to expand a view in response to a click on a disclosure triangle, but the animation isn't running the way I want. (Sorry if the gif isn't looping. The tool was supposed to create a looping animation but apparently didn't...) When it expands,…
Uncommon
  • 2,903
  • 2
  • 13
  • 31
0
votes
1 answer

NSAnimationContext completion parameter?

My animation can be performed on several different similar views (managed in an array), but the completion handler does not take a parameter. How then can I tell at completion time which animation I am completing? The following its used to animate…
Trygve
  • 1,123
  • 8
  • 22
0
votes
1 answer

Animating auto layout with NSAnimationContext works only inside dispatch_after block

I'm trying to animate constraints change in Mac app using NSAnimationContext runAnimationGroup... but animation works fine only if I embed it inside dispatch_after block. In result I have this code: __weak typeof(self) weakSelf =…
Bambuh
  • 11
  • 1
  • 3
0
votes
1 answer

Why NSView animator doesn't work in Cocoa

I have a NSView in my project that I want to move but the animation I usually use for other objects doesn't work with it... what should I do to make it move? Here is my code: [[NSAnimationContext currentContext] setDuration:1.0]; NSRect rect =…
Blue
  • 2,110
  • 3
  • 18
  • 30
0
votes
1 answer

Animate NSSplitview and window size

What I'm trying to achieve is that when the user press a button the window grows and the extra space is taken by a panel of NSSplitview that uncollapses and grows to fill the space. I can easily animate the window resize and the splitview growing…
Jacopo
  • 981
  • 1
  • 11
  • 24
1
2