Sebastian Faltoni Software Architect. Passionate about Clean Code, Tech, Web, AI, .NET, Python, IOT, Swift, SwiftUI and also Blazor

Remove view controllers from history iOS

10 sec read

To remove unwanted controller from your iOS navigation history you can use the following example.

extension UIViewController { 
    public func cleanUnwatedPreviousViewControllers() {
        guard let navigation =  self.navigationController else {
            return
        }
        let viewControllers = navigation.viewControllers
            .filter { !($0 is NewCustomerViewController) }
        
        navigation.viewControllers = viewControllers
    }
}

This will remove NewCustomerViewController from history, you can add more in a or condition.

Sebastian Faltoni Software Architect. Passionate about Clean Code, Tech, Web, AI, .NET, Python, IOT, Swift, SwiftUI and also Blazor

A simple extension to use Combine with PromiseKit and…

Because ServiceStack use PromiseKit for it’s async calls on Swift, i made this little extension that convert a PromiseKit request into a Combine publisher....
Sebastian Faltoni
39 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *