Impressia/Vernissage/Extensions/View+Transition.swift
Marcin Czachursk 43affaa868 Fixes
2023-01-13 21:11:30 +01:00

18 lines
403 B
Swift

//
// https://mczachurski.dev
// Copyright © 2023 Marcin Czachurski and the repository contributors.
// Licensed under the MIT License.
//
import SwiftUI
extension View {
func withoutAnimation(action: @escaping () -> Void) {
var transaction = Transaction()
transaction.disablesAnimations = true
withTransaction(transaction) {
action()
}
}
}