Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Created by https://www.gitignore.io/api/xcode

### Xcode ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,74 @@ userResizableView.delegate = self;
Then implement the following delegate methods.

``` objective-c
/**
* Called when the resizable view receives touchesBegan: and activates the editing handles.
*
* @param userResizableView
*/
- (void)userResizableViewDidBeginEditing:(SPUserResizableView *)userResizableView;

/**
* Called when the resizable view receives touchesEnded: or touchesCancelled:
*
* @param userResizableView
*/
- (void)userResizableViewDidEndEditing:(SPUserResizableView *)userResizableView;

/**
* Called when new frame was set.
*
* @param userResizableView
*/
- (void)userResizableViewNewRealFrame:(SPUserResizableView *)userResizableView;
```

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.

The SPUserResizableView is customizable using the following properties:

``` objective-c
/**
* Minimum width to let user resize
* @default Default is 48.0 for each.
*/
@property (nonatomic) CGFloat minWidth;
/**
* Minimum height that will let user to resize
*/
@property (nonatomic) CGFloat minHeight;

/**
* Disables resize of the view
* @default NO
*/
@property (nonatomic) BOOL disable;

/**
* Disables resize of the view if user use more than 1 finger.
* @default NO
*/
@property (nonatomic) BOOL disableOnMultiTouch;
/**
* Defaults to YES. Disables the user from dragging the view outside the parent view's bounds.
*/
@property (nonatomic) BOOL preventsPositionOutsideSuperview;

/**
* Defines if pan is disabled.
* @default NO
*/
@property (nonatomic) BOOL disablePan;

/**
* Defines the insent of the content.
* Larger == better detection
*/
@property (nonatomic) float resizableInset;
/**
* Interactive border size
*/
@property (nonatomic) float interactiveBorderSize;
```

For an example of how to use SPUserResizableView, please see the included example project.
Expand Down
17 changes: 17 additions & 0 deletions SPUserResizableView+Pion.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Pod::Spec.new do |s|
s.name = 'SPUserResizableView+Pion'
s.version = '0.5.4'
s.license = 'MIT'
s.homepage = 'https://github.com/pionl/SPUserResizableView'
s.authors = 'Stephen Poletto'
s.summary = 'A forked (originaly from STephen Poletto) SPUserResizableView is a user-resizable, user-repositionable UIView subclass. '

# Source Info
s.platform = :ios, '5.0'
s.source = {:git => 'https://github.com/pionl/SPUserResizableView.git', :tag => '0.5.4'}
s.source_files = 'SPUserResizableView/SPUserResizableView.{h,m}'
s.requires_arc = true

# Pod Dependencies

end
19 changes: 13 additions & 6 deletions SPUserResizableView.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
9C36DD441494491A00D3035F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9C36DD421494491A00D3035F /* InfoPlist.strings */; };
9C36DD461494491B00D3035F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C36DD451494491B00D3035F /* main.m */; };
9C36DD4A1494491B00D3035F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C36DD491494491B00D3035F /* AppDelegate.m */; };
9C36DD5414944A8F00D3035F /* SPUserResizableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C36DD5114944A8F00D3035F /* SPUserResizableView.m */; };
9C36DD5514944A8F00D3035F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C36DD5314944A8F00D3035F /* ViewController.m */; };
9C36DD5714944F1600D3035F /* milky_way.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 9C36DD5614944F1600D3035F /* milky_way.jpg */; };
B09F23FA199EA6C100A10972 /* SPUserResizableView.m in Sources */ = {isa = PBXBuildFile; fileRef = B09F23F9199EA6C100A10972 /* SPUserResizableView.m */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -29,11 +29,11 @@
9C36DD471494491B00D3035F /* SPUserResizableView-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SPUserResizableView-Prefix.pch"; sourceTree = "<group>"; };
9C36DD481494491B00D3035F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
9C36DD491494491B00D3035F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
9C36DD5014944A8F00D3035F /* SPUserResizableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUserResizableView.h; sourceTree = "<group>"; };
9C36DD5114944A8F00D3035F /* SPUserResizableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUserResizableView.m; sourceTree = "<group>"; };
9C36DD5214944A8F00D3035F /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
9C36DD5314944A8F00D3035F /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
9C36DD5614944F1600D3035F /* milky_way.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = milky_way.jpg; sourceTree = "<group>"; };
B09F23F8199EA6C100A10972 /* SPUserResizableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SPUserResizableView.h; sourceTree = "<group>"; };
B09F23F9199EA6C100A10972 /* SPUserResizableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SPUserResizableView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -80,8 +80,8 @@
9C36DD3F1494491A00D3035F /* SPUserResizableView */ = {
isa = PBXGroup;
children = (
9C36DD5014944A8F00D3035F /* SPUserResizableView.h */,
9C36DD5114944A8F00D3035F /* SPUserResizableView.m */,
B09F23F8199EA6C100A10972 /* SPUserResizableView.h */,
B09F23F9199EA6C100A10972 /* SPUserResizableView.m */,
9C36DD5214944A8F00D3035F /* ViewController.h */,
9C36DD5314944A8F00D3035F /* ViewController.m */,
9C36DD481494491B00D3035F /* AppDelegate.h */,
Expand Down Expand Up @@ -168,7 +168,7 @@
files = (
9C36DD461494491B00D3035F /* main.m in Sources */,
9C36DD4A1494491B00D3035F /* AppDelegate.m in Sources */,
9C36DD5414944A8F00D3035F /* SPUserResizableView.m in Sources */,
B09F23FA199EA6C100A10972 /* SPUserResizableView.m in Sources */,
9C36DD5514944A8F00D3035F /* ViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -192,8 +192,10 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_WEAK = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
ENABLE_BITCODE = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -216,8 +218,10 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
CLANG_ENABLE_OBJC_WEAK = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = YES;
ENABLE_BITCODE = NO;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
Expand All @@ -237,6 +241,7 @@
GCC_PREFIX_HEADER = "SPUserResizableView/SPUserResizableView-Prefix.pch";
INFOPLIST_FILE = "SPUserResizableView/SPUserResizableView-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
};
name = Debug;
Expand All @@ -248,6 +253,7 @@
GCC_PREFIX_HEADER = "SPUserResizableView/SPUserResizableView-Prefix.pch";
INFOPLIST_FILE = "SPUserResizableView/SPUserResizableView-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
};
name = Release;
Expand All @@ -271,6 +277,7 @@
9C36DD4F1494491B00D3035F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>FEFFC6DF-8462-42E6-AAA1-3BD8896B7261</string>
<key>IDESourceControlProjectName</key>
<string>SPUserResizableView</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>4519E06DE028306E8037FDB194956AEBC0491ED8</key>
<string>https://github.com/pionl/SPUserResizableView.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>SPUserResizableView.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>4519E06DE028306E8037FDB194956AEBC0491ED8</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/pionl/SPUserResizableView.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>4519E06DE028306E8037FDB194956AEBC0491ED8</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>4519E06DE028306E8037FDB194956AEBC0491ED8</string>
<key>IDESourceControlWCCName</key>
<string>SPUserResizableView</string>
</dict>
</array>
</dict>
</plist>
Binary file not shown.
7 changes: 1 addition & 6 deletions SPUserResizableView/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ @implementation AppDelegate
@synthesize window, viewController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[ViewController alloc] initWithNibName:nil bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}

- (void)dealloc {
[viewController release];
[window release];
[super dealloc];
}

@end
Loading