-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
HandySwiftUI/Sources/HandySwiftUI/Modifiers/ViewExt.swift
Lines 234 to 245 in 47dc334
public func applyIf<M: View, A: View>( | |
_ condition: Bool, | |
modifier: (Self) -> M, | |
else alternativeModifier: (Self) -> A | |
) -> some View { | |
if condition { | |
return modifier(self).eraseToAnyView() | |
} | |
else { | |
return alternativeModifier(self).eraseToAnyView() | |
} | |
} |
Is there a specific reason? AnyView seems not good at performance.
Metadata
Metadata
Assignees
Labels
No labels