- Completed forget username flow with hindi language - Completed app update functionality, need the api to be updated as the version will not be a double, its going to be string
23 lines
626 B
Swift
23 lines
626 B
Swift
//
|
|
// PopViewControllerGeneric.swift
|
|
// WOKA
|
|
//
|
|
// Created by MacBook Pro on 20/08/24.
|
|
//
|
|
|
|
import UIKit
|
|
|
|
/*
|
|
this helps in navigation back or pop the viewcontroller as generic type
|
|
*/
|
|
extension UINavigationController {
|
|
func getViewController<T: UIViewController>(of type: T.Type) -> UIViewController? {
|
|
return self.viewControllers.first(where: { $0 is T })
|
|
}
|
|
|
|
func popToViewController<T: UIViewController>(of type: T.Type, animated: Bool) {
|
|
guard let viewController = self.getViewController(of: type) else { return }
|
|
self.popToViewController(viewController, animated: animated)
|
|
}
|
|
}
|