Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using AutoLayout for progressView since [UIScreen mainScreen].bounds … #224

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
d8cac26
Using AutoLayout for progressView since [UIScreen mainScreen].bounds …
jackie-li Jan 6, 2017
f9e1eaa
Set progressView translatesAutoresizingMaskIntoConstraints to NO;
jackie-li Jan 6, 2017
47d4cd1
added: custom image failure
oliveroneill Jan 8, 2017
d4f4018
fixed: custom image failure can now be overriden in IDMPhotoBrowserDe…
oliveroneill Jan 8, 2017
30a5cb8
added: imageview for better failure customisation
oliveroneill Jan 8, 2017
08fbdc7
Use actual interface orientation instead of the device one to fix mis…
kjen93 Jan 10, 2017
79e1157
Merge pull request #226 from kjen93/kjen93-progressview-misplaced-whe…
eduardocallado Jan 14, 2017
a903573
fixed: caption position is now correctly positioned at the bottom des…
oliveroneill Jan 19, 2017
6861568
Update SDWebImage method name
eduardocallado Jan 31, 2017
92b494b
Merge branch 'master' of https://github.com/ideaismobile/IDMPhotoBrowser
eduardocallado Jan 31, 2017
b5cf4f6
Fix SDWebImage dependency
eduardocallado Feb 3, 2017
aedb450
enable customize action button image
yukitoto Feb 10, 2017
79ebaff
Merge pull request #237 from yukitoto/enable_customize_action_button_…
eduardocallado Feb 12, 2017
83ba41f
Bump version
eduardocallado Feb 12, 2017
96a8de1
Fixed a bug that maxDoubleTapZoomScale is larger than maxScale, so th…
CocoaBob Feb 27, 2017
edfa071
Add support for overriding IDMCaptionView
leolobato Nov 11, 2013
6bd2733
Merge pull request #225 from oliveroneill/custom_image_failure
eduardocallado Apr 28, 2017
4b3ccf9
Issue 147 - Done button margin and size
May 3, 2017
4614640
fix using SDWebImageManager
w-i-n-s May 21, 2017
10e25de
Typo fix in Readme
jlnquere May 23, 2017
face4d3
Merge pull request #249 from juli1quere/master
eduardocallado May 23, 2017
e6fc73c
Merge pull request #248 from w-i-n-s/patch-1
eduardocallado May 23, 2017
519d803
Merge pull request #246 from ksnegov/DoneButtonMargin
eduardocallado May 23, 2017
bfb5433
Merge pull request #243 from leolobato/expose-caption-view
eduardocallado May 23, 2017
f03eb94
Merge pull request #241 from CocoaBob/master
eduardocallado May 23, 2017
202024f
Merge pull request #230 from oliveroneill/caption_position_fix
eduardocallado May 23, 2017
e9fa1cf
Update Podfile.lock
eduardocallado May 25, 2017
eaced5b
Fix SDWebImageManager method call
eduardocallado May 25, 2017
bfbfa03
Bump version
eduardocallado May 25, 2017
1ab16d6
fixed: incorrect done button position
oliveroneill May 25, 2017
4037cdb
Merge pull request #252 from oliveroneill/done_button_position_fix
eduardocallado May 25, 2017
9c1d745
Bump version
eduardocallado May 27, 2017
aafd79f
Fixed a typo in dutch translations
Jun 28, 2017
0f9a824
Merge pull request #259 from lenkaiser/master
eduardocallado Jun 28, 2017
ec5c46e
add turkish localization
Aug 25, 2017
825c5c4
typo fix
Aug 25, 2017
1f26c0b
Update IDMPhotoBrowser.podspec
Matsepura Sep 12, 2017
6ee9770
Add iOS11 Smart Invert Support
Sep 24, 2017
c57ca85
Add iOS11 Smart Invert Support
Sep 24, 2017
e9465c5
add access request
SenorSamuel Oct 25, 2017
265bb65
Update IDMPhotoBrowser.podspec
Matsepura Nov 10, 2017
2123703
Merge pull request #278 from SenorSamuel/samuel-branch
eduardocallado Nov 15, 2017
c280289
Add iPhone X support
oliveroneill Nov 27, 2017
520697a
chore: drag & drop photo
hhgz9527 Dec 13, 2017
e2a70e3
Merge pull request #286 from hhgz9527/Drag&Drop
thiagoperes Mar 5, 2018
8fdff1c
Merge pull request #282 from oliveroneill/iphone_x_support
thiagoperes Mar 5, 2018
2eb23aa
Merge pull request #264 from ahmetalsan/master
thiagoperes Mar 5, 2018
c677bc8
Merge pull request #267 from Matsepura/master
thiagoperes Mar 5, 2018
01fbba9
Merge pull request #270 from arnoldxt/master
thiagoperes Mar 5, 2018
33c704e
Merge branch 'master' of https://github.com/jackie-li/IDMPhotoBrowser
jackie-li Jul 27, 2020
e52cc2a
Update podspec
jackie-li Jul 27, 2020
48569c8
Callback to main thread to avoid crash issue due to use UI API in bac…
jackie-li Jul 27, 2020
1c7004d
Remove unused code
jackie-li Jul 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Classes/IDMCaptionView.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

@interface IDMCaptionView : UIView

@property (nonatomic, strong) UILabel *label;
@property (nonatomic, strong, readonly) id<IDMPhoto> photo;

// Init
- (id)initWithPhoto:(id<IDMPhoto>)photo;

Expand Down
27 changes: 10 additions & 17 deletions Classes/IDMCaptionView.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@
static const CGFloat labelPadding = 10;

// Private
@interface IDMCaptionView () {
id<IDMPhoto> _photo;
UILabel *_label;
}
@interface IDMCaptionView ()

@property (nonatomic, strong, readwrite) id<IDMPhoto> photo;

@end

@implementation IDMCaptionView

@synthesize label = _label;
@synthesize photo = _photo;

- (id)initWithPhoto:(id<IDMPhoto>)photo {
CGRect screenBound = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenBound.size.width;
Expand Down Expand Up @@ -52,21 +55,11 @@ - (CGSize)sizeThatFits:(CGSize)size {
/*CGSize textSizeOLD = [_label.text sizeWithFont:_label.font
constrainedToSize:CGSizeMake(size.width - labelPadding*2, maxHeight)
lineBreakMode:_label.lineBreakMode];*/

NSString *text = _label.text;

CGFloat width = size.width - labelPadding*2;
UIFont *font = _label.font;

NSAttributedString *attributedText = [[NSAttributedString alloc] initWithString:text
attributes:@{NSFontAttributeName: font}];

CGRect rect = [attributedText boundingRectWithSize:(CGSize){width, maxHeight}
options:NSStringDrawingUsesLineFragmentOrigin
context:nil];

CGSize textSize = rect.size;

return CGSizeMake(size.width, textSize.height + labelPadding * 2);
CGFloat height = [_label sizeThatFits:CGSizeMake(width, CGFLOAT_MAX)].height;
return CGSizeMake(size.width, height + labelPadding * 2);
}

- (void)setupCaption {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Dismiss" = "Annuleer";

/* No comment provided by engineer. */
"Done" = "Klaae";
"Done" = "Klaar";

/* No comment provided by engineer. */
"Email" = "E-mail";
Expand Down
Binary file not shown.
27 changes: 14 additions & 13 deletions Classes/IDMPhoto.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,20 @@ - (void)loadUnderlyingImageAndNotify {
[self performSelectorInBackground:@selector(loadImageFromFileAsync) withObject:nil];
} else if (_photoURL) {
// Load async from web (using SDWebImageManager)
SDWebImageManager *manager = [SDWebImageManager sharedManager];
[manager downloadImageWithURL:_photoURL options:SDWebImageRetryFailed|SDWebImageHandleCookies progress:^(NSInteger receivedSize, NSInteger expectedSize) {
CGFloat progress = ((CGFloat)receivedSize)/((CGFloat)expectedSize);
if (self.progressUpdateBlock) {
self.progressUpdateBlock(progress);
}
} completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished, NSURL *imageURL) {
if (image) {
self.underlyingImage = image;
[self performSelectorOnMainThread:@selector(imageLoadingComplete) withObject:nil waitUntilDone:NO];
}
}];


[[SDWebImageManager sharedManager] loadImageWithURL:_photoURL options:SDWebImageRetryFailed progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
CGFloat progress = ((CGFloat)receivedSize)/((CGFloat)expectedSize);

if (self.progressUpdateBlock) {
self.progressUpdateBlock(progress);
}
} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
if (image) {
self.underlyingImage = image;
}

[self performSelectorOnMainThread:@selector(imageLoadingComplete) withObject:nil waitUntilDone:NO];
}];
} else {
// Failed - no source
self.underlyingImage = nil;
Expand Down
5 changes: 5 additions & 0 deletions Classes/IDMPhotoBrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#import "IDMPhoto.h"
#import "IDMPhotoProtocol.h"
#import "IDMCaptionView.h"
#import "IDMTapDetectingImageView.h"

// Delgate
@class IDMPhotoBrowser;
Expand All @@ -24,6 +25,7 @@
- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser willDismissAtPageIndex:(NSUInteger)index;
- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser didDismissActionSheetWithButtonIndex:(NSUInteger)buttonIndex photoIndex:(NSUInteger)photoIndex;
- (IDMCaptionView *)photoBrowser:(IDMPhotoBrowser *)photoBrowser captionViewForPhotoAtIndex:(NSUInteger)index;
- (void)photoBrowser:(IDMPhotoBrowser *)photoBrowser imageFailed:(NSUInteger)index imageView:(IDMTapDetectingImageView *)imageView;
@end

// IDMPhotoBrowser
Expand All @@ -40,12 +42,15 @@
@property (nonatomic, strong) NSArray *actionButtonTitles;
@property (nonatomic, weak) UIImage *leftArrowImage, *leftArrowSelectedImage;
@property (nonatomic, weak) UIImage *rightArrowImage, *rightArrowSelectedImage;
@property (nonatomic, weak) UIImage *actionButtonImage, *actionButtonSelectedImage;

// View customization
@property (nonatomic) BOOL displayDoneButton;
@property (nonatomic) BOOL useWhiteBackgroundColor;
@property (nonatomic, weak) UIImage *doneButtonImage;
@property (nonatomic, weak) UIColor *trackTintColor, *progressTintColor;
@property (nonatomic, assign) CGFloat doneButtonRightInset, doneButtonTopInset;
@property (nonatomic, assign) CGSize doneButtonSize;

@property (nonatomic, weak) UIImage *scaleImage;

Expand Down
81 changes: 70 additions & 11 deletions Classes/IDMPhotoBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import <QuartzCore/QuartzCore.h>
#import "IDMPhotoBrowser.h"
#import "IDMZoomingScrollView.h"
#import "IDMUtils.h"

#import "pop/POP.h"

Expand Down Expand Up @@ -62,6 +63,7 @@ @interface IDMPhotoBrowser () {
BOOL _viewIsActive; // active as in it's in the view heirarchy
BOOL _autoHide;
NSInteger _initalPageIndex;
CGFloat _statusBarHeight;

BOOL _isdraggingPhoto;

Expand Down Expand Up @@ -134,7 +136,7 @@ @implementation IDMPhotoBrowser

// Properties
@synthesize displayDoneButton = _displayDoneButton, displayToolbar = _displayToolbar, displayActionButton = _displayActionButton, displayCounterLabel = _displayCounterLabel, useWhiteBackgroundColor = _useWhiteBackgroundColor, doneButtonImage = _doneButtonImage;
@synthesize leftArrowImage = _leftArrowImage, rightArrowImage = _rightArrowImage, leftArrowSelectedImage = _leftArrowSelectedImage, rightArrowSelectedImage = _rightArrowSelectedImage;
@synthesize leftArrowImage = _leftArrowImage, rightArrowImage = _rightArrowImage, leftArrowSelectedImage = _leftArrowSelectedImage, rightArrowSelectedImage = _rightArrowSelectedImage, actionButtonImage = _actionButtonImage, actionButtonSelectedImage = _actionButtonSelectedImage;
@synthesize displayArrowButton = _displayArrowButton, actionButtonTitles = _actionButtonTitles;
@synthesize arrowButtonsChangePhotosAnimated = _arrowButtonsChangePhotosAnimated;
@synthesize forceHideStatusBar = _forceHideStatusBar;
Expand Down Expand Up @@ -189,6 +191,13 @@ - (id)init {
_scaleImage = nil;

_isdraggingPhoto = NO;

_statusBarHeight = 20.f;
_doneButtonRightInset = 20.f;
// relative to status bar and safeAreaInsets
_doneButtonTopInset = 10.f;

_doneButtonSize = CGSizeMake(55.f, 26.f);

if ([self respondsToSelector:@selector(automaticallyAdjustsScrollViewInsets)]) {
self.automaticallyAdjustsScrollViewInsets = NO;
Expand Down Expand Up @@ -371,6 +380,11 @@ - (void)performPresentAnimation {
resizableImageView.clipsToBounds = YES;
resizableImageView.contentMode = _senderViewForAnimation ? _senderViewForAnimation.contentMode : UIViewContentModeScaleAspectFill;
resizableImageView.backgroundColor = [UIColor clearColor];
if (@available(iOS 11.0, *)) {
resizableImageView.accessibilityIgnoresInvertColors = YES;
} else {
// Fallback on earlier versions
}
[_applicationWindow addSubview:resizableImageView];
_senderViewForAnimation.hidden = YES;

Expand Down Expand Up @@ -428,6 +442,11 @@ - (void)performCloseAnimationWithScrollView:(IDMZoomingScrollView*)scrollView {
resizableImageView.contentMode = _senderViewForAnimation ? _senderViewForAnimation.contentMode : UIViewContentModeScaleAspectFill;
resizableImageView.backgroundColor = [UIColor clearColor];
resizableImageView.clipsToBounds = YES;
if (@available(iOS 11.0, *)) {
resizableImageView.accessibilityIgnoresInvertColors = YES;
} else {
// Fallback on earlier versions
}
[_applicationWindow addSubview:resizableImageView];
self.view.hidden = YES;

Expand Down Expand Up @@ -474,8 +493,19 @@ - (CGRect)animationFrameForImage:(UIImage *)image presenting:(BOOL)presenting sc

CGSize imageSize = image.size;

CGFloat maxWidth = CGRectGetWidth(_applicationWindow.bounds);
CGFloat maxHeight = CGRectGetHeight(_applicationWindow.bounds);
CGRect bounds = _applicationWindow.bounds;
// adjust bounds as the photo browser does
if (@available(iOS 11.0, *)) {
// use the windows safe area inset
UIWindow *window = [UIApplication sharedApplication].keyWindow;
UIEdgeInsets insets = UIEdgeInsetsMake(_statusBarHeight, 0, 0, 0);
if (window != NULL) {
insets = window.safeAreaInsets;
}
bounds = [self adjustForSafeArea:bounds adjustForStatusBar:NO forInsets:insets];
}
CGFloat maxWidth = CGRectGetWidth(bounds);
CGFloat maxHeight = CGRectGetHeight(bounds);

CGRect animationFrame = CGRectZero;

Expand All @@ -493,7 +523,6 @@ - (CGRect)animationFrameForImage:(UIImage *)image presenting:(BOOL)presenting sc
if (!presenting) {
animationFrame.origin.y += scrollView.frame.origin.y;
}

return animationFrame;
}

Expand Down Expand Up @@ -611,6 +640,7 @@ - (void)viewDidLoad {
_doneButton.layer.cornerRadius = 3.0f;
_doneButton.layer.borderColor = [UIColor colorWithWhite:0.9 alpha:0.9].CGColor;
_doneButton.layer.borderWidth = 1.0f;
_doneButtonSize = _doneButton.frame.size;
}
else {
[_doneButton setImage:_doneButtonImage forState:UIControlStateNormal];
Expand Down Expand Up @@ -657,9 +687,16 @@ - (void)viewDidLoad {
_counterButton = [[UIBarButtonItem alloc] initWithCustomView:_counterLabel];

// Action Button
_actionButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction
if(_actionButtonImage != nil && _actionButtonSelectedImage != nil) {
_actionButton = [[UIBarButtonItem alloc] initWithCustomView:[self customToolbarButtonImage:_actionButtonImage
imageSelected:_actionButtonSelectedImage
action:@selector(actionButtonPressed:)]];
}
else {
_actionButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction
target:self
action:@selector(actionButtonPressed:)];
}

// Gesture
_panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)];
Expand Down Expand Up @@ -938,6 +975,12 @@ - (void)handleIDMPhotoLoadingDidEndNotification:(NSNotification *)notification {
} else {
// Failed to load
[page displayImageFailure];
if ([_delegate respondsToSelector:@selector(photoBrowser:imageFailed:imageView:)]) {
NSUInteger pageIndex = PAGE_INDEX(page);
[_delegate photoBrowser:self imageFailed:pageIndex imageView:page.photoImageView];
}
// make sure the page is completely updated
[page setNeedsLayout];
}
}
}
Expand Down Expand Up @@ -1028,7 +1071,9 @@ - (void)configurePage:(IDMZoomingScrollView *)page forIndex:(NSUInteger)index {
__block __weak IDMPhoto *photo = (IDMPhoto*)page.photo;
__weak IDMZoomingScrollView* weakPage = page;
photo.progressUpdateBlock = ^(CGFloat progress){
[weakPage setProgress:progress forPhoto:photo];
dispatch_async(dispatch_get_main_queue(), ^{
[weakPage setProgress:progress forPhoto:photo];
});
};
}

Expand Down Expand Up @@ -1060,6 +1105,7 @@ - (CGRect)frameForPagingScrollView {
CGRect frame = self.view.bounds;
frame.origin.x -= PADDING;
frame.size.width += (2 * PADDING);
frame = [self adjustForSafeArea:frame adjustForStatusBar:false];
return frame;
}

Expand Down Expand Up @@ -1098,16 +1144,18 @@ - (CGRect)frameForToolbarAtOrientation:(UIInterfaceOrientation)orientation {
if ([self isLandscape:orientation])
height = 32;

return CGRectMake(0, self.view.bounds.size.height - height, self.view.bounds.size.width, height);
CGRect rtn = CGRectMake(0, self.view.bounds.size.height - height, self.view.bounds.size.width, height);
rtn = [self adjustForSafeArea:rtn adjustForStatusBar:true];
return rtn;
}

- (CGRect)frameForDoneButtonAtOrientation:(UIInterfaceOrientation)orientation {
CGRect screenBound = self.view.bounds;
CGFloat screenWidth = screenBound.size.width;

// if ([self isLandscape:orientation]) screenWidth = screenBound.size.height;

return CGRectMake(screenWidth - 75, 30, 55, 26);
CGRect rtn = CGRectMake(screenWidth - self.doneButtonRightInset - self.doneButtonSize.width, self.doneButtonTopInset, self.doneButtonSize.width, self.doneButtonSize.height);
rtn = [self adjustForSafeArea:rtn adjustForStatusBar:true];
return rtn;
}

- (CGRect)frameForCaptionView:(IDMCaptionView *)captionView atIndex:(NSUInteger)index {
Expand All @@ -1119,6 +1167,18 @@ - (CGRect)frameForCaptionView:(IDMCaptionView *)captionView atIndex:(NSUInteger)
return captionFrame;
}

- (CGRect)adjustForSafeArea:(CGRect)rect adjustForStatusBar:(BOOL)adjust {
if (@available(iOS 11.0, *)) {
return [self adjustForSafeArea:rect adjustForStatusBar:adjust forInsets:self.view.safeAreaInsets];
}
UIEdgeInsets insets = UIEdgeInsetsMake(_statusBarHeight, 0, 0, 0);
return [self adjustForSafeArea:rect adjustForStatusBar:adjust forInsets:insets];
}

- (CGRect)adjustForSafeArea:(CGRect)rect adjustForStatusBar:(BOOL)adjust forInsets:(UIEdgeInsets) insets {
return [IDMUtils adjustRect:rect forSafeAreaInsets:insets forBounds:self.view.bounds adjustForStatusBar:adjust statusBarHeight:_statusBarHeight];
}

#pragma mark - UIScrollView Delegate

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
Expand Down Expand Up @@ -1379,5 +1439,4 @@ - (void)animateView:(UIView *)view toFrame:(CGRect)frame completion:(void (^)(vo
}];
}
}

@end
12 changes: 12 additions & 0 deletions Classes/IDMUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// IDMUtils.h
// PhotoBrowserDemo
//
// Created by Oliver ONeill on 2/12/17.
//

#import <Foundation/Foundation.h>

@interface IDMUtils : NSObject
+ (CGRect)adjustRect:(CGRect)rect forSafeAreaInsets:(UIEdgeInsets)insets forBounds:(CGRect)bounds adjustForStatusBar:(BOOL)adjust statusBarHeight:(int)statusBarHeight;
@end
52 changes: 52 additions & 0 deletions Classes/IDMUtils.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// IDMUtils.m
// PhotoBrowserDemo
//
// Created by Oliver ONeill on 2/12/17.
//

#import "IDMUtils.h"

@implementation IDMUtils
/**
* Adjust a rect to be moved into a safe area specified by `insets`.
*
* NOTE: this does not cover all cases. Given a rect it will reposition it if it
* falls into an unsafe area according to `insets` and `bounds`. When
* `adjustForStatusBar` is true, the rect y position will be based from the edge
* of the safe area, otherwise it will be based from zero. This allows views to
* sit behind the status bar. Status bar height is also used
* to keep positioning consistent when toggling the status bar on and off
*/
+ (CGRect)adjustRect:(CGRect)rect forSafeAreaInsets:(UIEdgeInsets)insets forBounds:(CGRect)bounds adjustForStatusBar:(BOOL)adjust statusBarHeight:(int)statusBarHeight {
BOOL isLeft = rect.origin.x <= insets.left;
// If the safe area is not specified via insets we should fall back to the
// status bar height
CGFloat insetTop = insets.top > 0 ? insets.top : statusBarHeight;
// Don't adjust for y positioning when adjustForStatusBar is false
BOOL isAtTop = (rect.origin.y <= insetTop);
BOOL isRight = rect.origin.x + rect.size.width >= bounds.size.width - insets.right;
BOOL isAtBottom = rect.origin.y + rect.size.height >= bounds.size.height - insets.bottom;
if ((isLeft) && (isRight)) {
rect.origin.x += insets.left;
rect.size.width -= insets.right + insets.left;
} else if (isLeft) {
rect.origin.x += insets.left;
} else if (isRight) {
rect.origin.x -= insets.right;
}
// if we're adjusting for status bar then we should move the view out of
// the inset
if ((adjust) && (isAtTop) && (isAtBottom)) {
rect.origin.y += insetTop;
rect.size.height -= insets.bottom + insetTop;
} else if ((adjust) && (isAtTop)) {
rect.origin.y += insetTop;
} else if ((isAtTop) && (isAtBottom)) {
rect.size.height -= insets.bottom;
} else if (isAtBottom) {
rect.origin.y -= insets.bottom;
}
return rect;
}
@end
Loading