swiftui-navigation-transitions icon indicating copy to clipboard operation
swiftui-navigation-transitions copied to clipboard

present animation

Open AhmetToma opened this issue 1 year ago • 1 comments

hello, i want to show view like present full screen view animation

i tried slide(axis: .vertical)) but animation not like present

AhmetToma avatar Feb 08 '24 12:02 AhmetToma

You can create a custom transition like this one:

import SwiftUI
import NavigationTransitions

extension AnyNavigationTransition {
    static var sheet: Self {
        .init(Sheet())
    }
}

struct Sheet: NavigationTransition {
    var body: some NavigationTransition {
        
        OnPush {
            OnInsertion {
                Move(edge: .bottom)
            }
        }
        
        OnPop {
            OnRemoval {
                Move(edge: .bottom)
            }
        }
    }
}

tiagocanto01 avatar Mar 12 '24 23:03 tiagocanto01