Posts

Post not yet marked as solved
2 Replies
2.3k Views
Application runs fine on iOS 12. But crashed on iOS 13.1. I think the issue is in the setting root view controller.let storyboard = UIStoryboard(name: storyBoard, bundle: nil)let desiredViewController = storyboard.instantiateViewController(withIdentifier: identifier);self.window?.switchRootViewController(desiredViewController,animated: animate,options:options)and the extension is:extension UIWindow {func switchRootViewController(_ viewController: UIViewController, animated: Bool = true, duration: TimeInterval = 0.3, options: UIView.AnimationOptions = .transitionFlipFromRight, completion: (() -> Void)? = nil) { guard animated else { rootViewController = viewController return } UIView.transition(with: self, duration: duration, options: options, animations: { let oldState = UIView.areAnimationsEnabled UIView.setAnimationsEnabled(false) self.rootViewController = viewController UIView.setAnimationsEnabled(oldState) }) { _ in completion?() } }}
Posted Last updated
.
Post not yet marked as solved
4 Replies
2.5k Views
let dispatchGroup = DispatchGroup() for _ in 1...views.count { dispatchGroup.enter() } DispatchQueue.main.asyncAfter(deadline: .now() + delay) { for (index, view) in views.enumerated() { view.alpha = initialAlpha view.animate(animations: animations, reversed: reversed, initialAlpha: initialAlpha, finalAlpha: finalAlpha, delay: Double(index) * animationInterval, duration: duration, usingSpringWithDamping: dampingRatio, initialSpringVelocity: velocity, options: options, completion: { dispatchGroup.leave() }) } } dispatchGroup.notify(queue: .main) { completion?() }
Posted Last updated
.