From 39b5b91a41e8fdc8f3d0f0cda404ce45f821994f Mon Sep 17 00:00:00 2001 From: Adonis Peralta Date: Thu, 12 Apr 2018 21:19:59 -0400 Subject: [PATCH 1/6] Update disableSpringAnimationPadding property description --- CustomDesignFilePropertySpecs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CustomDesignFilePropertySpecs.md b/CustomDesignFilePropertySpecs.md index b93c0b2..ff3892d 100644 --- a/CustomDesignFilePropertySpecs.md +++ b/CustomDesignFilePropertySpecs.md @@ -32,7 +32,7 @@ * **buttonTitleShadowOffsetY**: Amount of pt to offset in y direction the button title text shadow. Numeric. * **blurBackground**: Enable/disable blurring of the background behind the RMessage. Use in conjunction with backgroundColorAlpha. Numeric boolean [0, 1]. **Does nothing on devices running iOS7 and below.** -* **disableSpringAnimationPadding**: Enable/disable an extra padding added to the view so as to prevent a visual gap from being displayed when the message is presented with the default spring animation. You most likely want to disable the extra padding when using the following properties: { cornerRadius }. +* **disableSpringAnimationPadding**: Enable/disable an extra padding added to the view so as to prevent a visual gap from being displayed when the message is presented with the default spring animation. You most likely want to disable the extra padding when using the following properties: { cornerRadius }. Numeric boolean [0, 1]. **By default set to 0.** Property keys are always strings, values can be string or numeric. If specifying a numeric value don't encapsulate the numeric value in a string. [x,y] Signifies the range of values x to y that are allowed for the field. From 71f890bf6a2e4281e52267724217942b3360ce3a Mon Sep 17 00:00:00 2001 From: baspellis Date: Tue, 15 May 2018 18:01:23 +0200 Subject: [PATCH 2/6] If a custom image is not found try to load it from the app bundle. (#48) * If a custom image is not found try to load it from the app bundle. * Update RMessageView.m * Removed unneeded code --- RMessage/RMessageView.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/RMessage/RMessageView.m b/RMessage/RMessageView.m index 82a41b2..d301c01 100644 --- a/RMessage/RMessageView.m +++ b/RMessage/RMessageView.m @@ -199,7 +199,11 @@ + (UIColor *)colorForString:(NSString *)string alpha:(CGFloat)alpha + (UIImage *)bundledImageNamed:(NSString *)name { NSString *imagePath = [[NSBundle bundleForClass:[self class]] pathForResource:name ofType:nil]; - return [[UIImage alloc] initWithContentsOfFile:imagePath]; + UIImage *image = [[UIImage alloc] initWithContentsOfFile:imagePath]; + if (!image) { + image = [UIImage imageNamed:name]; + } + return image; } + (void)activateConstraints:(NSArray *)constraints inSuperview:(UIView *)superview @@ -700,9 +704,6 @@ - (void)setupImagesAndBackground if (!_iconImage && ([_designDictionary[@"iconImage"] length] > 0)) { _iconImage = [[self class] bundledImageNamed:_designDictionary[@"iconImage"]]; - if (!_iconImage) { - _iconImage = [UIImage imageNamed:_designDictionary[@"iconImage"]]; - } } if (_iconImage) { From ea08b87d96293e2f19d7f40560f7eb4416a410f8 Mon Sep 17 00:00:00 2001 From: Adonis Peralta Date: Mon, 18 Jun 2018 21:05:27 -0400 Subject: [PATCH 3/6] Add timed message button option in demo Add timed (message displayed after 3s) button to demo and modal view controllers for testing purposes. --- Example/DemoViewController.m | 5 ++++ .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++++++ Example/RMessage/Base.lproj/Main.storyboard | 24 +++++++++++++++---- 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 Example/RMessage.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Example/DemoViewController.m b/Example/DemoViewController.m index 2ec3adb..f928e77 100644 --- a/Example/DemoViewController.m +++ b/Example/DemoViewController.m @@ -265,6 +265,11 @@ - (IBAction)didTapNavbarHidden:(id)sender self.navigationController.navigationBarHidden = !self.navigationController.navigationBarHidden; } +- (IBAction)didTapTimedMessage:(id)sender +{ + [self performSelector:@selector(didTapMessage:) withObject:nil afterDelay:3.0]; +} + /*- (CGFloat)customVerticalOffsetForMessageView:(RMessageView *)messageView { return 88.f; // specify an additional offset here. diff --git a/Example/RMessage.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/RMessage.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/RMessage.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/RMessage/Base.lproj/Main.storyboard b/Example/RMessage/Base.lproj/Main.storyboard index 34997a8..278c2be 100644 --- a/Example/RMessage/Base.lproj/Main.storyboard +++ b/Example/RMessage/Base.lproj/Main.storyboard @@ -1,11 +1,11 @@ - + - + @@ -18,7 +18,7 @@ - + @@ -236,7 +244,7 @@ - + @@ -417,6 +425,14 @@ + From e7af7d936f44936d51ee6b6141204b609c4a7b26 Mon Sep 17 00:00:00 2001 From: Adonis Peralta Date: Mon, 18 Jun 2018 21:07:28 -0400 Subject: [PATCH 4/6] Setup view layout right before animation Previous to this commit RMessageView would setup various layout info (constraints etc..) and store this layout information in its instance. So for example when queueing 10 messages to be displayed layout information would be stored in the RMessageView class instances for displaying/manipulating/animating later. This behavior (obviously) would lead to crashes if layout information changed between when the RMessageView would be instantiated and when it was presented. This commit changes the above behavior so that RMessageView no longer stores layout information relating its superview (which can change between instantiation and presentation) on instantiation. Instead this layout information is delayed to be processed until right before the instance of the RMessageView is told to animate which is the best time for layout information NOT to change and hence lead to crashes. --- RMessage/RMessageView.m | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/RMessage/RMessageView.m b/RMessage/RMessageView.m index d301c01..0c198f1 100644 --- a/RMessage/RMessageView.m +++ b/RMessage/RMessageView.m @@ -330,7 +330,6 @@ - (instancetype)initWithDelegate:(id)delegate if (designError) return nil; [self setupDesign]; - [self setupLayout]; [self setupGestureRecognizers]; } return self; @@ -610,7 +609,6 @@ - (void)setButton:(UIButton *)button if (_button.superview) [_button removeFromSuperview]; _button = button; [self setupButtonConstraints]; - [self setupFinalAnimationConstraints]; } - (void)executeMessageViewButtonCallBack @@ -1221,6 +1219,7 @@ - (void)accommodateLayoutForSpringAnimationPadding - (void)animateMessage { + [self setupLayout]; [self.superview layoutIfNeeded]; dispatch_async(dispatch_get_main_queue(), ^{ if (!self.shouldBlurBackground) self.alpha = 0.f; @@ -1303,11 +1302,13 @@ - (void)buttonTapped - (void)interfaceDidRotate { - if (self.isPresenting) [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(dismiss) object:self]; - - // On completion of UI rotation recalculate positioning - [self layoutMessageForPresentation]; - [self setupFinalAnimationConstraints]; + if (self.isPresenting && self.dismissingEnabled) { + // Cancel the previous dismissal restart dismissal clock + dispatch_async(dispatch_get_main_queue(), ^{ + [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(dismiss) object:self]; + [self performSelector:@selector(dismiss) withObject:self afterDelay:self.duration]; + }); + } } /** From 375810c98286dbd0fa51d01fbdaee0f26a6dbdff Mon Sep 17 00:00:00 2001 From: Adonis Peralta Date: Mon, 18 Jun 2018 23:09:23 -0400 Subject: [PATCH 5/6] Fix UITests to factor in springAnimationPadding Allow UITests to factor in springAnimationPadding when calculating expected message positions. --- .../RootNavigationControllerTests.m | 60 ++++++++++++------- Example/RMessageUITests/ViewControllerTests.m | 39 ++++++++---- 2 files changed, 63 insertions(+), 36 deletions(-) diff --git a/Example/RMessageUITests/RootNavigationControllerTests.m b/Example/RMessageUITests/RootNavigationControllerTests.m index 65bafe5..e52dc95 100644 --- a/Example/RMessageUITests/RootNavigationControllerTests.m +++ b/Example/RMessageUITests/RootNavigationControllerTests.m @@ -40,6 +40,11 @@ - (void)setUp hittablePredicate = [NSPredicate predicateWithFormat:@"hittable == TRUE"]; } +- (CGFloat)springAnimationPaddingForHeight:(CGFloat)height +{ + return ceilf(height / 120) * -10.f; +} + - (void)showMessageFromTopByPressingButtonWithName:(NSString *)buttonName hidingNavBar:(BOOL)hideNavBar timeToShow:(NSTimeInterval)displayTimeout @@ -52,7 +57,8 @@ - (void)showMessageFromTopByPressingButtonWithName:(NSString *)buttonName [app.buttons[buttonName] tap]; XCUIElement *displayedMessage = app.otherElements[@"RMessageView"]; - CGFloat expectedMsgYPosition = hideNavBar ? 0 : navBarFrame.size.height + navBarFrame.origin.y; + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; + CGFloat expectedMsgYPosition = hideNavBar ? springAnimationPadding : navBarFrame.size.height + navBarFrame.origin.y + springAnimationPadding; BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:displayTimeout]; XCTAssert(messageDisplayed, @"%@ message failed to display", buttonName); @@ -78,7 +84,8 @@ - (void)showBottomMessageHidingNavBar:(BOOL)hideNavBar [app.buttons[@"Bottom"] tap]; XCUIElement *displayedMessage = app.otherElements[@"RMessageView"]; - CGFloat expectedMsgYPosition = mainWindowFrame.size.height - displayedMessage.frame.size.height; + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; + CGFloat expectedMsgYPosition = mainWindowFrame.size.height - displayedMessage.frame.size.height - springAnimationPadding; BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:displayTimeout]; XCTAssert(messageDisplayed, @"Bottom message failed to display"); @@ -101,7 +108,9 @@ - (void)showEndlessMessageHidingNavBar:(BOOL)hideNavBar timeToShow:(NSTimeInterv [app.buttons[@"Endless"] tap]; XCUIElement *displayedMessage = app.otherElements[@"RMessageView"]; - int expectedMsgYPosition = hideNavBar ? 0 : navBarFrame.size.height + navBarFrame.origin.y; + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; + CGFloat expectedMsgYPosition = hideNavBar ? springAnimationPadding : navBarFrame.size.height + navBarFrame.origin.y + springAnimationPadding; + BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:displayTimeout]; XCTAssert(messageDisplayed, @"Endless message failed to display"); @@ -114,47 +123,47 @@ - (void)showEndlessMessageHidingNavBar:(BOOL)hideNavBar timeToShow:(NSTimeInterv - (void)testErrorMessageNoNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Error" hidingNavBar:YES timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Error" hidingNavBar:YES timeToShow:3.f timeToHide:8.f]; } - (void)testNormalMessageNoNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Message" hidingNavBar:YES timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Message" hidingNavBar:YES timeToShow:3.f timeToHide:8.f]; } - (void)testWarningMessageNoNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Warning" hidingNavBar:YES timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Warning" hidingNavBar:YES timeToShow:3.f timeToHide:8.f]; } - (void)testSuccessMessageNoNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Success" hidingNavBar:YES timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Success" hidingNavBar:YES timeToShow:3.f timeToHide:8.f]; } - (void)testLongMessageNoNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Text" hidingNavBar:YES timeToShow:3.f timeToHide:15.f]; + [self showMessageFromTopByPressingButtonWithName:@"Text" hidingNavBar:YES timeToShow:3.f timeToHide:20.f]; } - (void)testButtonMessageNoNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Button" hidingNavBar:YES timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Button" hidingNavBar:YES timeToShow:3.f timeToHide:8.f]; } - (void)testBottomMessageNoNavBar { - [self showBottomMessageHidingNavBar:YES timeToShow:3.f timeToHide:5.f]; + [self showBottomMessageHidingNavBar:YES timeToShow:3.f timeToHide:8.f]; } - (void)testCustomMessageNoNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Custom design" hidingNavBar:YES timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Custom design" hidingNavBar:YES timeToShow:3.f timeToHide:8.f]; } - (void)testImageMessageNoNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Custom image" hidingNavBar:YES timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Custom image" hidingNavBar:YES timeToShow:3.f timeToHide:8.f]; } - (void)testEndlessMessageNoNavBar @@ -164,22 +173,22 @@ - (void)testEndlessMessageNoNavBar - (void)testErrorMessageWithNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Error" hidingNavBar:NO timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Error" hidingNavBar:NO timeToShow:3.f timeToHide:8.f]; } - (void)testNormalMessageWithNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Message" hidingNavBar:NO timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Message" hidingNavBar:NO timeToShow:3.f timeToHide:8.f]; } - (void)testWarningMessageWithNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Warning" hidingNavBar:NO timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Warning" hidingNavBar:NO timeToShow:3.f timeToHide:8.f]; } - (void)testSuccessMessageWithNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Success" hidingNavBar:NO timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Success" hidingNavBar:NO timeToShow:3.f timeToHide:8.f]; } - (void)testLongMessageWithNavBar @@ -189,22 +198,22 @@ - (void)testLongMessageWithNavBar - (void)testButtonMessageWithNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Button" hidingNavBar:NO timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Button" hidingNavBar:NO timeToShow:3.f timeToHide:8.f]; } - (void)testBottomMessageWithNavBar { - [self showBottomMessageHidingNavBar:NO timeToShow:3.f timeToHide:5.f]; + [self showBottomMessageHidingNavBar:NO timeToShow:3.f timeToHide:8.f]; } - (void)testCustomMessageWithNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Custom design" hidingNavBar:NO timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Custom design" hidingNavBar:NO timeToShow:3.f timeToHide:8.f]; } - (void)testImageMessageWithNavBar { - [self showMessageFromTopByPressingButtonWithName:@"Custom image" hidingNavBar:NO timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Custom image" hidingNavBar:NO timeToShow:3.f timeToHide:8.f]; } - (void)testEndlessMessageWithNavBar @@ -220,8 +229,9 @@ - (void)testMessageOverNavBar BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:3.f]; XCTAssert(messageDisplayed, @"Over navBar message failed to display"); + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; BOOL expectedMessagePositionValid = validateFloatsToScale(displayedMessage.frame.origin.y, - 0.f, kMsgYPositionScale); + springAnimationPadding, kMsgYPositionScale); XCTAssert(expectedMessagePositionValid, "Over navBar message displayed in the wrong position"); XCTestExpectation *expectation = [self expectationForPredicate:notHittablePredicate @@ -260,7 +270,9 @@ - (void)testEndlessMessageDismiss XCUIElement *displayedMessage = app.otherElements[@"RMessageView"]; - int expectedMsgYPosition = navBarFrame.size.height + navBarFrame.origin.y; + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; + CGFloat expectedMsgYPosition = navBarFrame.size.height + navBarFrame.origin.y + springAnimationPadding; + BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:3.f]; XCTAssert(messageDisplayed, @"Endless message failed to display"); @@ -287,7 +299,9 @@ - (void)testTapToDismiss [app.buttons[@"Error"] tap]; XCUIElement *displayedMessage = app.otherElements[@"RMessageView"]; - int expectedMsgYPosition = navBarFrame.size.height + navBarFrame.origin.y; + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; + CGFloat expectedMsgYPosition = navBarFrame.size.height + navBarFrame.origin.y + springAnimationPadding; + BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:3.f]; XCTAssert(messageDisplayed, @"Error message failed to display"); diff --git a/Example/RMessageUITests/ViewControllerTests.m b/Example/RMessageUITests/ViewControllerTests.m index 87f74f7..5d995b1 100644 --- a/Example/RMessageUITests/ViewControllerTests.m +++ b/Example/RMessageUITests/ViewControllerTests.m @@ -39,6 +39,11 @@ - (void)setUp hittablePredicate = [NSPredicate predicateWithFormat:@"hittable == TRUE"]; } +- (CGFloat)springAnimationPaddingForHeight:(CGFloat)height +{ + return ceilf(height / 120) * -10.f; +} + - (void)showMessageFromTopByPressingButtonWithName:(NSString *)buttonName timeToShow:(NSTimeInterval)displayTimeout timeToHide:(NSTimeInterval)dismissTimeout @@ -47,7 +52,8 @@ - (void)showMessageFromTopByPressingButtonWithName:(NSString *)buttonName [app.buttons[buttonName] tap]; XCUIElement *displayedMessage = app.otherElements[@"RMessageView"]; - CGFloat expectedMsgYPosition = 0.f; + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; + CGFloat expectedMsgYPosition = springAnimationPadding; BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:displayTimeout]; XCTAssert(messageDisplayed, @"%@ message failed to display", buttonName); @@ -69,7 +75,8 @@ - (void)showBottomMessageWithTimeout:(NSTimeInterval)displayTimeout [app.buttons[@"Bottom"] tap]; XCUIElement *displayedMessage = app.otherElements[@"RMessageView"]; - CGFloat expectedMsgYPosition = mainWindowFrame.size.height - displayedMessage.frame.size.height; + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; + CGFloat expectedMsgYPosition = mainWindowFrame.size.height - displayedMessage.frame.size.height - springAnimationPadding; BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:displayTimeout]; XCTAssert(messageDisplayed, @"Bottom message failed to display"); @@ -90,7 +97,9 @@ - (void)showEndlessMessageWithTimeout:(NSTimeInterval)displayTimeout [app.buttons[@"Endless"] tap]; XCUIElement *displayedMessage = app.otherElements[@"RMessageView"]; - int expectedMsgYPosition = 0.f; + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; + CGFloat expectedMsgYPosition = springAnimationPadding; + BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:displayTimeout]; XCTAssert(messageDisplayed, @"Endless message failed to display"); @@ -103,22 +112,22 @@ - (void)showEndlessMessageWithTimeout:(NSTimeInterval)displayTimeout - (void)testErrorMessage { - [self showMessageFromTopByPressingButtonWithName:@"Error" timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Error" timeToShow:3.f timeToHide:8.f]; } - (void)testNormalMessage { - [self showMessageFromTopByPressingButtonWithName:@"Message" timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Message" timeToShow:3.f timeToHide:8.f]; } - (void)testWarningMessage { - [self showMessageFromTopByPressingButtonWithName:@"Warning" timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Warning" timeToShow:3.f timeToHide:8.f]; } - (void)testSuccessMessage { - [self showMessageFromTopByPressingButtonWithName:@"Success" timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Success" timeToShow:3.f timeToHide:8.f]; } - (void)testLongMessage @@ -128,22 +137,22 @@ - (void)testLongMessage - (void)testButtonMessage { - [self showMessageFromTopByPressingButtonWithName:@"Button" timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Button" timeToShow:3.f timeToHide:8.f]; } - (void)testBottomMessage { - [self showBottomMessageWithTimeout:3.f timeToHide:5.f]; + [self showBottomMessageWithTimeout:3.f timeToHide:8.f]; } - (void)testCustomMessage { - [self showMessageFromTopByPressingButtonWithName:@"Custom design" timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Custom design" timeToShow:3.f timeToHide:8.f]; } - (void)testImageMessage { - [self showMessageFromTopByPressingButtonWithName:@"Custom image" timeToShow:3.f timeToHide:5.f]; + [self showMessageFromTopByPressingButtonWithName:@"Custom image" timeToShow:3.f timeToHide:8.f]; } - (void)testEndlessMessage @@ -183,7 +192,9 @@ - (void)testEndlessMessageDismiss XCUIElement *displayedMessage = app.otherElements[@"RMessageView"]; - int expectedMsgYPosition = 0.f; + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; + CGFloat expectedMsgYPosition = springAnimationPadding; + BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:3.f]; XCTAssert(messageDisplayed, @"Endless message failed to display"); @@ -211,7 +222,9 @@ - (void)testTapToDismiss [app.buttons[@"Error"] tap]; XCUIElement *displayedMessage = app.otherElements[@"RMessageView"]; - int expectedMsgYPosition = 0.f; + CGFloat springAnimationPadding = [self springAnimationPaddingForHeight:displayedMessage.frame.size.height]; + CGFloat expectedMsgYPosition = springAnimationPadding; + BOOL messageDisplayed = [displayedMessage waitForExistenceWithTimeout:3.f]; XCTAssert(messageDisplayed, @"Error message failed to display"); From c063a6b3e559e8646c81e9f80e27bb082ff45c2e Mon Sep 17 00:00:00 2001 From: Adonis Peralta Date: Tue, 3 Jul 2018 14:21:40 -0400 Subject: [PATCH 6/6] Release 2.3.1 --- RMessage.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RMessage.podspec b/RMessage.podspec index 16d5ace..9e34ad1 100644 --- a/RMessage.podspec +++ b/RMessage.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |s| s.name = "RMessage" - s.version = "2.3.0" + s.version = "2.3.1" s.summary = "Easy to use and customizable messages/notifications for iOS" s.description = <<-DESC This framework provides an easy to use class to show little notification views on the top of the screen.