Skip to content

Commit 856f4da

Browse files
committed
Revert "Adjust edge animation timing"
This reverts commit e7d7e00. # Conflicts: # SwiftMessages.xcodeproj/project.pbxproj
1 parent c79f3b4 commit 856f4da

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

SwiftMessages.xcodeproj/project.pbxproj

+4-6
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@
5555
2290958125D9D407002E8111 /* UILayoutPriority+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2290958025D9D407002E8111 /* UILayoutPriority+Extensions.swift */; };
5656
2298C2051EE47DC900E2DDC1 /* Weak.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2298C2041EE47DC900E2DDC1 /* Weak.swift */; };
5757
2298C2071EE480D000E2DDC1 /* Animator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2298C2061EE480D000E2DDC1 /* Animator.swift */; };
58-
2298C2091EE486E300E2DDC1 /* EdgeAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2298C2081EE486E300E2DDC1 /* EdgeAnimation.swift */; };
59-
229F778125FAB1E9008C2ACB /* UIWindow+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 229F778025FAB1E9008C2ACB /* UIWindow+Extensions.swift */; };
58+
2298C2091EE486E300E2DDC1 /* TopBottomAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2298C2081EE486E300E2DDC1 /* TopBottomAnimation.swift */; };
6059
22DFC9161EFF30F6001B1CA1 /* CenteredView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22DFC9151EFF30F6001B1CA1 /* CenteredView.xib */; };
6160
22DFC9181F00674E001B1CA1 /* PhysicsPanHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22DFC9171F00674E001B1CA1 /* PhysicsPanHandler.swift */; };
6261
22E01F641E74EC8B00ACE19A /* MaskingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22E01F631E74EC8B00ACE19A /* MaskingView.swift */; };
@@ -144,8 +143,7 @@
144143
2290958025D9D407002E8111 /* UILayoutPriority+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UILayoutPriority+Extensions.swift"; sourceTree = "<group>"; };
145144
2298C2041EE47DC900E2DDC1 /* Weak.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Weak.swift; sourceTree = "<group>"; };
146145
2298C2061EE480D000E2DDC1 /* Animator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Animator.swift; sourceTree = "<group>"; };
147-
2298C2081EE486E300E2DDC1 /* EdgeAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EdgeAnimation.swift; sourceTree = "<group>"; };
148-
229F778025FAB1E9008C2ACB /* UIWindow+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIWindow+Extensions.swift"; sourceTree = "<group>"; };
146+
2298C2081EE486E300E2DDC1 /* TopBottomAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TopBottomAnimation.swift; sourceTree = "<group>"; };
149147
22A2EA6E24EC6CFA00BB2540 /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
150148
22DFC9151EFF30F6001B1CA1 /* CenteredView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = CenteredView.xib; path = Resources/CenteredView.xib; sourceTree = "<group>"; };
151149
22DFC9171F00674E001B1CA1 /* PhysicsPanHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhysicsPanHandler.swift; sourceTree = "<group>"; };
@@ -224,7 +222,7 @@
224222
2244656C1EF1D62700C50413 /* Animations */ = {
225223
isa = PBXGroup;
226224
children = (
227-
2298C2081EE486E300E2DDC1 /* EdgeAnimation.swift */,
225+
2298C2081EE486E300E2DDC1 /* TopBottomAnimation.swift */,
228226
2270044A1FAFA6DD0045DDC3 /* PhysicsAnimation.swift */,
229227
22DFC9171F00674E001B1CA1 /* PhysicsPanHandler.swift */,
230228
);
@@ -560,7 +558,7 @@
560558
86BBA8FF1D5E040600FE8F16 /* Presenter.swift in Sources */,
561559
86BBA9051D5E040C00FE8F16 /* Theme.swift in Sources */,
562560
86BBA9081D5E040C00FE8F16 /* Error.swift in Sources */,
563-
2298C2091EE486E300E2DDC1 /* EdgeAnimation.swift in Sources */,
561+
2298C2091EE486E300E2DDC1 /* TopBottomAnimation.swift in Sources */,
564562
86589D471D64B6E40041676C /* BaseView.swift in Sources */,
565563
225304622290C76E00A03ACF /* NSLayoutConstraint+Extensions.swift in Sources */,
566564
86BBA9071D5E040C00FE8F16 /* MarginAdjustable.swift in Sources */,

SwiftMessages/EdgeAnimation.swift SwiftMessages/TopBottomAnimation.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// EdgeAnimation.swift
2+
// TopBottomAnimation.swift
33
// SwiftMessages
44
//
55
// Created by Timothy Moose on 6/4/17.
@@ -24,9 +24,9 @@ public class EdgeAnimation: NSObject, Animator {
2424

2525
public let style: Style
2626

27-
open var showDuration: TimeInterval = 0.35
27+
open var showDuration: TimeInterval = 0.4
2828

29-
open var hideDuration: TimeInterval = 0.25
29+
open var hideDuration: TimeInterval = 0.2
3030

3131
open var springDamping: CGFloat = 0.8
3232

@@ -65,7 +65,7 @@ public class EdgeAnimation: NSObject, Animator {
6565
NotificationCenter.default.removeObserver(self)
6666
let view = context.messageView
6767
self.context = context
68-
UIView.animate(withDuration: hideDuration, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: [.beginFromCurrentState]) {
68+
UIView.animate(withDuration: hideDuration, delay: 0, options: [.beginFromCurrentState, .curveEaseIn], animations: {
6969
switch self.style {
7070
case .top:
7171
view.transform = CGAffineTransform(translationX: 0, y: -view.frame.height)
@@ -76,14 +76,14 @@ public class EdgeAnimation: NSObject, Animator {
7676
case .trailing:
7777
view.transform = CGAffineTransform(translationX: view.frame.maxX + view.frame.width, y: 0)
7878
}
79-
} completion: { completed in
79+
}, completion: { completed in
8080
#if SWIFTMESSAGES_APP_EXTENSIONS
8181
completion(completed)
8282
#else
8383
// Fix #131 by always completing if application isn't active.
8484
completion(completed || UIApplication.shared.applicationState != .active)
8585
#endif
86-
}
86+
})
8787
}
8888

8989
func install(context: AnimationContext) {

0 commit comments

Comments
 (0)