-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from fermoya/fix/issue-69
Fix/issue 69 Gesture state not resetting if canceled
- Loading branch information
Showing
65 changed files
with
337 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// OnDeactivateModifier.swift | ||
// SwiftUIPagerExample | ||
// | ||
// Created by Fernando Moya de Rivas on 07/07/2020. | ||
// Copyright © 2020 Fernando Moya de Rivas. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) | ||
struct OnDeactivateView<Content: View>: View { | ||
|
||
var content: Content | ||
var perform: () -> Void | ||
|
||
var body: some View { | ||
#if os(iOS) | ||
return content | ||
.onReceive(NotificationCenter.default.publisher(for: UIScene.didActivateNotification), perform: { _ in | ||
self.perform() | ||
}) | ||
#else | ||
return content | ||
#endif | ||
} | ||
|
||
} | ||
|
||
@available(iOS 13.0, OSX 10.15, tvOS 13.0, watchOS 6.0, *) | ||
extension View { | ||
|
||
func onDeactivate(perform: @escaping () -> Void) -> some View { | ||
return OnDeactivateView(content: self, perform: perform) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
SwiftUIPager.xcframework/ios-arm64/SwiftUIPager.framework/Info.plist
Binary file not shown.
Binary file modified
BIN
+1.31 KB
(110%)
...os-arm64/SwiftUIPager.framework/Modules/SwiftUIPager.swiftmodule/arm64-apple-ios.swiftdoc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1.31 KB
(110%)
...ramework/ios-arm64/SwiftUIPager.framework/Modules/SwiftUIPager.swiftmodule/arm64.swiftdoc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+50.4 KB
(110%)
SwiftUIPager.xcframework/ios-arm64/SwiftUIPager.framework/SwiftUIPager
Binary file not shown.
Binary file modified
BIN
+1.31 KB
(110%)
...er.framework/Versions/A/Modules/SwiftUIPager.swiftmodule/x86_64-apple-ios-macabi.swiftdoc
Binary file not shown.
Oops, something went wrong.