From 60c94b4eddde078da15f74a0b220d20fe3778bde Mon Sep 17 00:00:00 2001 From: Michal Svacha Date: Tue, 13 May 2014 22:48:27 +0200 Subject: [PATCH] Added method for moving close button This method should be called when custom view inside RNBlurModalView gets resized or moved with argument - point of the new top left corner, in order to keep the close button where it should be. --- RNBlurModalView.h | 3 ++- RNBlurModalView.m | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/RNBlurModalView.h b/RNBlurModalView.h index c339e23..d932c65 100644 --- a/RNBlurModalView.h +++ b/RNBlurModalView.h @@ -52,7 +52,8 @@ extern NSString * const kRNBlurDidHidewNotification; - (void)hide; - (void)hideWithDuration:(CGFloat)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options completion:(void (^)(void))completion; --(void)hideCloseButton:(BOOL)hide; +- (void)moveCloseButton:(CGPoint)point; +- (void)hideCloseButton:(BOOL)hide; @end \ No newline at end of file diff --git a/RNBlurModalView.m b/RNBlurModalView.m index f3d081a..aec8351 100644 --- a/RNBlurModalView.m +++ b/RNBlurModalView.m @@ -379,7 +379,11 @@ - (void)hideWithDuration:(CGFloat)duration delay:(NSTimeInterval)delay options:( } } --(void)hideCloseButton:(BOOL)hide { +- (void)moveCloseButton:(CGPoint)point { + _dismissButton.frame = CGRectMake(point.x, point.y, _dismissButton.frame.size.width, _dismissButton.frame.size.height); +} + +- (void)hideCloseButton:(BOOL)hide { [_dismissButton setHidden:hide]; }