Skip to content

Commit 1b5b6d0

Browse files
author
Martin Kluska
committed
- structure improvments in code
- added change detection to ensure that didEnd will be fired even if its disabled, \d updated readme
1 parent 61368d6 commit 1b5b6d0

2 files changed

Lines changed: 58 additions & 1 deletion

File tree

README.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,74 @@ userResizableView.delegate = self;
4444
Then implement the following delegate methods.
4545

4646
``` objective-c
47+
/**
48+
* Called when the resizable view receives touchesBegan: and activates the editing handles.
49+
*
50+
* @param userResizableView
51+
*/
4752
- (void)userResizableViewDidBeginEditing:(SPUserResizableView *)userResizableView;
53+
54+
/**
55+
* Called when the resizable view receives touchesEnded: or touchesCancelled:
56+
*
57+
* @param userResizableView
58+
*/
4859
- (void)userResizableViewDidEndEditing:(SPUserResizableView *)userResizableView;
60+
61+
/**
62+
* Called when new frame was set.
63+
*
64+
* @param userResizableView
65+
*/
66+
- (void)userResizableViewNewRealFrame:(SPUserResizableView *)userResizableView;
4967
```
5068

5169
By default, SPUserResizableView will show the editing handles (as seen in the screenshot above) whenever it receives a touch event. The editing handles will remain visible even after the userResizableViewDidEndEditing: message is sent. This is to provide visual feedback to the user that the view is indeed moveable and resizable. If you'd like to dismiss the editing handles, you must explicitly call -hideEditingHandles.
5270

5371
The SPUserResizableView is customizable using the following properties:
5472

5573
``` objective-c
74+
/**
75+
* Minimum width to let user resize
76+
* @default Default is 48.0 for each.
77+
*/
5678
@property (nonatomic) CGFloat minWidth;
79+
/**
80+
* Minimum height that will let user to resize
81+
*/
5782
@property (nonatomic) CGFloat minHeight;
83+
84+
/**
85+
* Disables resize of the view
86+
* @default NO
87+
*/
88+
@property (nonatomic) BOOL disable;
89+
90+
/**
91+
* Disables resize of the view if user use more than 1 finger.
92+
* @default NO
93+
*/
94+
@property (nonatomic) BOOL disableOnMultiTouch;
95+
/**
96+
* Defaults to YES. Disables the user from dragging the view outside the parent view's bounds.
97+
*/
5898
@property (nonatomic) BOOL preventsPositionOutsideSuperview;
99+
100+
/**
101+
* Defines if pan is disabled.
102+
* @default NO
103+
*/
104+
@property (nonatomic) BOOL disablePan;
105+
106+
/**
107+
* Defines the insent of the content.
108+
* Larger == better detection
109+
*/
110+
@property (nonatomic) float resizableInset;
111+
/**
112+
* Interactive border size
113+
*/
114+
@property (nonatomic) float interactiveBorderSize;
59115
```
60116

61117
For an example of how to use SPUserResizableView, please see the included example project.

SPUserResizableView/SPUserResizableView.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ typedef struct SPUserResizableViewAnchorPoint {
5656
*/
5757
@property (nonatomic, weak) UIView *contentView;
5858

59+
#pragma mark - Setup properties
5960
/**
6061
* Minimum width to let user resize
6162
* @default Default is 48.0 for each.
@@ -139,6 +140,6 @@ typedef struct SPUserResizableViewAnchorPoint {
139140
*
140141
* @param userResizableView
141142
*/
142-
- (void)userResizableViewNewRealFrame:(SPUserResizableView *)userResizableView;;
143+
- (void)userResizableViewNewRealFrame:(SPUserResizableView *)userResizableView;
143144

144145
@end

0 commit comments

Comments
 (0)