Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nathantannar4 committed Nov 16, 2023
1 parent 1bb214a commit 0cc2472
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/nathantannar4/Engine",
"state" : {
"revision" : "8455bd0aba963d6a181480d5e61040181b29b785",
"revision" : "7f781a82725d72e51377a2ee4e167904fab501f9",
"version" : "1.0.0"
}
},
Expand Down
3 changes: 2 additions & 1 deletion Example/Example/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct ContentView: View {
@State var isEnabled = true

var body: some View {
VStack(spacing: 24) {
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 48) {
VStack(spacing: 48) {
Text("Ignition")
Expand Down Expand Up @@ -95,6 +95,7 @@ struct ContentView: View {
)
.foregroundColor(.red)
}
.padding(24)
}
}

Expand Down
11 changes: 9 additions & 2 deletions Sources/Ignition/OnChangeViewEffectModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ private struct OnChangeViewEffectModifierBody<
set { progress = newValue }
}

private struct OnChangeValue: Equatable {
var isComplete: Bool
var id: UInt
}

init(
effect: Effect,
isActive: Binding<Bool>,
Expand All @@ -157,8 +162,10 @@ private struct OnChangeViewEffectModifierBody<
)
.transaction { $0.disablesAnimations = true }
)
.onChange(of: progress >= 1) { isComplete in
if isComplete {
.onChange(
of: OnChangeValue(isComplete: progress >= 1, id: id)
) { value in
if value.isComplete {
isActive.wrappedValue = false
}
}
Expand Down

0 comments on commit 0cc2472

Please sign in to comment.