Skip to content

Commit

Permalink
cleaned up for release
Browse files Browse the repository at this point in the history
  • Loading branch information
mlilback committed Jul 20, 2012
1 parent f2de2d7 commit 1357da6
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 10 deletions.
10 changes: 10 additions & 0 deletions .gitignore
@@ -0,0 +1,10 @@
xcuserdata/
build/*
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspective3
*.pbxuser
*.xcworkspace
.DS_Store
16 changes: 8 additions & 8 deletions CustomSplitView.xcodeproj/project.pbxproj
Expand Up @@ -16,10 +16,10 @@
08DF3D2415B898C5000A339D /* AMResizableSplitViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08DF3D2315B898C5000A339D /* AMResizableSplitViewController.m */; };
08DF3D3015B898F3000A339D /* ImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 08DF3D2E15B898F3000A339D /* ImageViewController.m */; };
08DF3D3115B898F3000A339D /* ImageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 08DF3D2F15B898F3000A339D /* ImageViewController.xib */; };
08DF3D3315B89D32000A339D /* pdolls.png in Resources */ = {isa = PBXBuildFile; fileRef = 08DF3D3215B89D32000A339D /* pdolls.png */; };
08DF3D3515B89D7B000A339D /* background.png in Resources */ = {isa = PBXBuildFile; fileRef = 08DF3D3415B89D7B000A339D /* background.png */; };
08DF3D3815B8A112000A339D /* AMResizableSplitterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 08DF3D3715B8A112000A339D /* AMResizableSplitterView.m */; };
08DF3D3F15B9F095000A339D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08DF3D3E15B9F095000A339D /* QuartzCore.framework */; };
08DF3D4215B9FD0C000A339D /* image1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 08DF3D4015B9FD0C000A339D /* image1.jpg */; };
08DF3D4315B9FD0C000A339D /* image2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 08DF3D4115B9FD0C000A339D /* image2.jpg */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -38,11 +38,11 @@
08DF3D2D15B898F3000A339D /* ImageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageViewController.h; sourceTree = "<group>"; };
08DF3D2E15B898F3000A339D /* ImageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageViewController.m; sourceTree = "<group>"; };
08DF3D2F15B898F3000A339D /* ImageViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ImageViewController.xib; sourceTree = "<group>"; };
08DF3D3215B89D32000A339D /* pdolls.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pdolls.png; sourceTree = "<group>"; };
08DF3D3415B89D7B000A339D /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background.png; sourceTree = "<group>"; };
08DF3D3615B8A112000A339D /* AMResizableSplitterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMResizableSplitterView.h; sourceTree = "<group>"; };
08DF3D3715B8A112000A339D /* AMResizableSplitterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AMResizableSplitterView.m; sourceTree = "<group>"; };
08DF3D3E15B9F095000A339D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
08DF3D4015B9FD0C000A339D /* image1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image1.jpg; sourceTree = "<group>"; };
08DF3D4115B9FD0C000A339D /* image2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = image2.jpg; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -112,8 +112,8 @@
08DF3D1915B898C5000A339D /* InfoPlist.strings */,
08DF3D1C15B898C5000A339D /* main.m */,
08DF3D1E15B898C5000A339D /* CustomSplitView-Prefix.pch */,
08DF3D3215B89D32000A339D /* pdolls.png */,
08DF3D3415B89D7B000A339D /* background.png */,
08DF3D4015B9FD0C000A339D /* image1.jpg */,
08DF3D4115B9FD0C000A339D /* image2.jpg */,
);
name = "Supporting Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -171,8 +171,8 @@
files = (
08DF3D1B15B898C5000A339D /* InfoPlist.strings in Resources */,
08DF3D3115B898F3000A339D /* ImageViewController.xib in Resources */,
08DF3D3315B89D32000A339D /* pdolls.png in Resources */,
08DF3D3515B89D7B000A339D /* background.png in Resources */,
08DF3D4215B9FD0C000A339D /* image1.jpg in Resources */,
08DF3D4315B9FD0C000A339D /* image2.jpg in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions CustomSplitView/AppDelegate.m
Expand Up @@ -24,8 +24,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
ImageViewController *i2 = [[ImageViewController alloc] init];
[i1 view];
[i2 view];
i1.imageView.image = [UIImage imageNamed:@"pdolls"];
i2.imageView.image = [UIImage imageNamed:@"background"];
i1.imageView.image = [UIImage imageNamed:@"image1.jpg"];
i2.imageView.image = [UIImage imageNamed:@"image2.jpg"];
self.viewController.controller1 = i1;
self.viewController.controller2 = i2;
return YES;
Expand Down
Binary file removed CustomSplitView/background.png
Binary file not shown.
Binary file added CustomSplitView/image1.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added CustomSplitView/image2.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed CustomSplitView/pdolls.png
Binary file not shown.
64 changes: 64 additions & 0 deletions README.md
@@ -0,0 +1,64 @@
# AMResizableSplitterView

AMResizableSplitterView is a replacement for UISplitViewController that allows the user to drag a splitter to resize the split views. This project is actively under development, but I decided to make it public from the get-go.

I had been using Matt Gemmell's [MGSplitViewController](https://github.com/mattgemmell/MGSplitViewController/) for one of my current projects, but I have a had a number of issues with it and found the code unnecessarily complex. (I started iOS development with 4.0 and switched to 5.0 as a minimum version after WWDC 2011, so most code older than that seems too complex to me.) AMResizableSplitterView is much simpler since it uses the container view controllers added with iOS 5.

## Features

- User-draggable splitter
- Allows setting different minimum sizes for each view and landscape/portrait orientation
- Splitter is simple UIView with the background color set to a default color. Customize to your hearts desire.

## Usage

Take a look at the AppDelegate class for sample usage. Here's the snippet that setups the split view.

self.viewController = [[AMResizableSplitViewController alloc] init];
self.window.rootViewController = self.viewController;
self.viewController.minimumView2Size = CGSizeMake(200, 200);
[self.window makeKeyAndVisible];
ImageViewController *i1 = [[ImageViewController alloc] init];
ImageViewController *i2 = [[ImageViewController alloc] init];
[i1 view];
[i2 view];
i1.imageView.image = [UIImage imageNamed:@"image1.jpg"];
i2.imageView.image = [UIImage imageNamed:@"image2.jpg"];
self.viewController.controller1 = i1;
self.viewController.controller2 = i2;


## Requirements

- iOS 5.1 (might work with 5.0, but only tested with 5.1)
- Xcode 4.3 or greater (only tested with 4.5)
- ARC enabled

## To Do

- get rid of magic numbers
- use superview's size instead of fixed fullscreen sizes
- support nesting

## License

Copyright (c) 2012 Agile Monks, LLC.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 comments on commit 1357da6

Please sign in to comment.