|
@@ -25,6 +25,8 @@ import Foundation
|
|
|
|
|
|
class NCMainNavigationController: UINavigationController {
|
|
class NCMainNavigationController: UINavigationController {
|
|
|
|
|
|
|
|
+ var isPushing = false
|
|
|
|
+
|
|
required init?(coder: NSCoder) {
|
|
required init?(coder: NSCoder) {
|
|
super.init(coder: coder)
|
|
super.init(coder: coder)
|
|
|
|
|
|
@@ -33,6 +35,20 @@ class NCMainNavigationController: UINavigationController {
|
|
changeTheming()
|
|
changeTheming()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // https://stackoverflow.com/questions/37829721/pushing-view-controller-twice
|
|
|
|
+ override func pushViewController(_ viewController: UIViewController, animated: Bool) {
|
|
|
|
+
|
|
|
|
+ if !isPushing {
|
|
|
|
+ isPushing = true
|
|
|
|
+ CATransaction.begin()
|
|
|
|
+ CATransaction.setCompletionBlock {
|
|
|
|
+ self.isPushing = false
|
|
|
|
+ }
|
|
|
|
+ super.pushViewController(viewController, animated: animated)
|
|
|
|
+ CATransaction.commit()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
@objc func changeTheming() {
|
|
@objc func changeTheming() {
|
|
|
|
|
|
if #available(iOS 13.0, *) {
|
|
if #available(iOS 13.0, *) {
|