0

It is possible to animate the alpha with a duration like so:

[UIView animateWithDuration:0.5 animations:^{
    [self.navController setNeedsStatusBarAppearanceUpdate];
}];

But would it be possible through CoreAnimation and UIKit to control the alpha with display link or gestures as a driver instead? I'm talking about brief moments while doing a gesture driver transition from one controller to another.

Sometimes a plain animateWithDuration just isn't what I want.

hfossli
  • 22,616
  • 10
  • 116
  • 130

1 Answers1

-1

Since the code below works, you can change the alpha at will.

@IBAction func sliderValueChanged(sender: UISlider) {
    if let navigationController = self.navigationController {
        navigationController.navigationBar.alpha = CGFloat(sender.value)
    }
}

If the question is about animating during a transition, and the timing is the issue, you then want to control that transition with the UIPresentationController, which provides timing information.

SwiftArchitect
  • 47,376
  • 28
  • 140
  • 179