Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
rnystrom committed Oct 19, 2012
1 parent c89a311 commit bbd33b1
Show file tree
Hide file tree
Showing 14 changed files with 1,028 additions and 35 deletions.
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
RNBlueModalView
====

RNBlurModal adds *depth* to the traditional modal/alert view. Calling the view is incredibly similar to setting up and showing a UIAlertView. You can also setup your own custom views and display them with a blurry background. The goal is to truly draw the user's focus directly to your alert using natural effects.

## Installation

Super simple. Just drag & drop RNBlurModalView.h/.m into your project. In your Project, find the Build Phases tab and expand Link Binary With Libraries. Add the following frameworks to your project:

* QuartzCore.framework
* Accelerate.framework

## Usage

The simplest way to get up and running with RNBlurModalView is to display a default view. Inside of your view controller, write the following code:

``` objective-c
RNBlurModalView *modal = [[RNBlurModalView alloc] initWithViewController:self title:@"Hello world!" message:@"Pur your message here."];
[modal show];
```
You can also create a modal view with your own custom UIViews:
``` objective-c
RNBlurModalView *modal = [[RNBlurModalView alloc] initWithViewController:self view:view];
[modal show];
```

## Configuration

Set a couple of different properties of your modal view to change how it appears:

``` objective-c
@property (assign) CGFloat animationDuration;
@property (assign) CGFloat animationDelay;
@property (assign) UIViewAnimationOptions animationOptions;
```

For brevity, you can instead set these properties in the <code>show:</code> and <code>hide:</code> methods.

``` objective-c
// show
- (void)show;
- (void)showWithDuration:(CGFloat)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options completion:(void (^)(void))completion;
// hide
- (void)hide;
- (void)hideWithDuration:(CGFloat)duration delay:(NSTimeInterval)delay options:(UIViewAnimationOptions)options completion:(void (^)(void))completion;
```

## Contact

* [@nystrorm](https://twitter.com/nystrorm) on Twitter
* [@rnystrom](https://github.com/rnystrom) on Github
* <a href="mailTo:[email protected]">rnystrom [at] whoisryannystrom [dot] com</a>

## License

Copyright (c) 2012 Ryan Nystrom (http://whoisryannystrom.com)

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.
43 changes: 43 additions & 0 deletions RNBlurModalExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
866E0B56162F2F2D00DE51B9 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 866E0B55162F2F2D00DE51B9 /* [email protected] */; };
866E0B59162F2F2D00DE51B9 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 866E0B57162F2F2D00DE51B9 /* MainStoryboard.storyboard */; };
866E0B5C162F2F2D00DE51B9 /* RNViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 866E0B5B162F2F2D00DE51B9 /* RNViewController.m */; };
866E0B64162F30AF00DE51B9 /* Profile.png in Resources */ = {isa = PBXBuildFile; fileRef = 866E0B62162F30AF00DE51B9 /* Profile.png */; };
866E0B65162F30AF00DE51B9 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 866E0B63162F30AF00DE51B9 /* [email protected] */; };
866E0B68162F31BE00DE51B9 /* RNBlurModalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 866E0B67162F31BE00DE51B9 /* RNBlurModalView.m */; };
866E0B6A162F323300DE51B9 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 866E0B69162F323300DE51B9 /* QuartzCore.framework */; };
866E0B75162F44D400DE51B9 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 866E0B74162F44D400DE51B9 /* Accelerate.framework */; };
867FFEB31631E18500EE9936 /* MainStoryboard_ipad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 867FFEB11631E18500EE9936 /* MainStoryboard_ipad.storyboard */; };
86A650D9163080D5001DD552 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86A650D8163080D5001DD552 /* CoreImage.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -37,13 +44,24 @@
866E0B58162F2F2D00DE51B9 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard.storyboard; sourceTree = "<group>"; };
866E0B5A162F2F2D00DE51B9 /* RNViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNViewController.h; sourceTree = "<group>"; };
866E0B5B162F2F2D00DE51B9 /* RNViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNViewController.m; sourceTree = "<group>"; };
866E0B62162F30AF00DE51B9 /* Profile.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Profile.png; sourceTree = "<group>"; };
866E0B63162F30AF00DE51B9 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
866E0B66162F31BE00DE51B9 /* RNBlurModalView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBlurModalView.h; sourceTree = SOURCE_ROOT; };
866E0B67162F31BE00DE51B9 /* RNBlurModalView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNBlurModalView.m; sourceTree = SOURCE_ROOT; };
866E0B69162F323300DE51B9 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
866E0B74162F44D400DE51B9 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
867FFEB21631E18500EE9936 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = en.lproj/MainStoryboard_ipad.storyboard; sourceTree = "<group>"; };
86A650D8163080D5001DD552 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
866E0B38162F2F2D00DE51B9 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
86A650D9163080D5001DD552 /* CoreImage.framework in Frameworks */,
866E0B75162F44D400DE51B9 /* Accelerate.framework in Frameworks */,
866E0B6A162F323300DE51B9 /* QuartzCore.framework in Frameworks */,
866E0B40162F2F2D00DE51B9 /* UIKit.framework in Frameworks */,
866E0B42162F2F2D00DE51B9 /* Foundation.framework in Frameworks */,
866E0B44162F2F2D00DE51B9 /* CoreGraphics.framework in Frameworks */,
Expand All @@ -56,6 +74,8 @@
866E0B30162F2F2D00DE51B9 = {
isa = PBXGroup;
children = (
866E0B66162F31BE00DE51B9 /* RNBlurModalView.h */,
866E0B67162F31BE00DE51B9 /* RNBlurModalView.m */,
866E0B45162F2F2D00DE51B9 /* RNBlurModalExample */,
866E0B3E162F2F2D00DE51B9 /* Frameworks */,
866E0B3C162F2F2D00DE51B9 /* Products */,
Expand All @@ -73,6 +93,9 @@
866E0B3E162F2F2D00DE51B9 /* Frameworks */ = {
isa = PBXGroup;
children = (
86A650D8163080D5001DD552 /* CoreImage.framework */,
866E0B74162F44D400DE51B9 /* Accelerate.framework */,
866E0B69162F323300DE51B9 /* QuartzCore.framework */,
866E0B3F162F2F2D00DE51B9 /* UIKit.framework */,
866E0B41162F2F2D00DE51B9 /* Foundation.framework */,
866E0B43162F2F2D00DE51B9 /* CoreGraphics.framework */,
Expand All @@ -83,6 +106,9 @@
866E0B45162F2F2D00DE51B9 /* RNBlurModalExample */ = {
isa = PBXGroup;
children = (
867FFEB11631E18500EE9936 /* MainStoryboard_ipad.storyboard */,
866E0B62162F30AF00DE51B9 /* Profile.png */,
866E0B63162F30AF00DE51B9 /* [email protected] */,
866E0B4E162F2F2D00DE51B9 /* RNAppDelegate.h */,
866E0B4F162F2F2D00DE51B9 /* RNAppDelegate.m */,
866E0B57162F2F2D00DE51B9 /* MainStoryboard.storyboard */,
Expand Down Expand Up @@ -164,6 +190,9 @@
866E0B54162F2F2D00DE51B9 /* [email protected] in Resources */,
866E0B56162F2F2D00DE51B9 /* [email protected] in Resources */,
866E0B59162F2F2D00DE51B9 /* MainStoryboard.storyboard in Resources */,
866E0B64162F30AF00DE51B9 /* Profile.png in Resources */,
866E0B65162F30AF00DE51B9 /* [email protected] in Resources */,
867FFEB31631E18500EE9936 /* MainStoryboard_ipad.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -177,6 +206,7 @@
866E0B4C162F2F2D00DE51B9 /* main.m in Sources */,
866E0B50162F2F2D00DE51B9 /* RNAppDelegate.m in Sources */,
866E0B5C162F2F2D00DE51B9 /* RNViewController.m in Sources */,
866E0B68162F31BE00DE51B9 /* RNBlurModalView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -199,6 +229,14 @@
name = MainStoryboard.storyboard;
sourceTree = "<group>";
};
867FFEB11631E18500EE9936 /* MainStoryboard_ipad.storyboard */ = {
isa = PBXVariantGroup;
children = (
867FFEB21631E18500EE9936 /* en */,
);
name = MainStoryboard_ipad.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
Expand Down Expand Up @@ -258,7 +296,9 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RNBlurModalExample/RNBlurModalExample-Prefix.pch";
INFOPLIST_FILE = "RNBlurModalExample/RNBlurModalExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
};
name = Debug;
Expand All @@ -269,7 +309,9 @@
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "RNBlurModalExample/RNBlurModalExample-Prefix.pch";
INFOPLIST_FILE = "RNBlurModalExample/RNBlurModalExample-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
WRAPPER_EXTENSION = app;
};
name = Release;
Expand All @@ -293,6 +335,7 @@
866E0B61162F2F2D00DE51B9 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Expand Down
Binary file added RNBlurModalExample/Profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added RNBlurModalExample/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 24 additions & 7 deletions RNBlurModalExample/RNAppDelegate.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
//
// RNAppDelegate.h
// RNBlurModalExample
//
// Created by Ryan Nystrom on 10/17/12.
// Copyright (c) 2012 Ryan Nystrom. All rights reserved.
//
/*
* RNBlurModal
*
* Created by Ryan Nystrom on 10/2/12.
* Copyright (c) 2012 Ryan Nystrom. All rights reserved.
*
* 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.
*/

#import <UIKit/UIKit.h>

Expand Down
31 changes: 24 additions & 7 deletions RNBlurModalExample/RNAppDelegate.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
//
// RNAppDelegate.m
// RNBlurModalExample
//
// Created by Ryan Nystrom on 10/17/12.
// Copyright (c) 2012 Ryan Nystrom. All rights reserved.
//
/*
* RNBlurModal
*
* Created by Ryan Nystrom on 10/2/12.
* Copyright (c) 2012 Ryan Nystrom. All rights reserved.
*
* 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.
*/

#import "RNAppDelegate.h"

Expand Down
8 changes: 6 additions & 2 deletions RNBlurModalExample/RNBlurModalExample-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@
<true/>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard</string>
<key>UIMainStoryboardFile~ipad</key>
<string>MainStoryboard_ipad</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
31 changes: 24 additions & 7 deletions RNBlurModalExample/RNViewController.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
//
// RNViewController.h
// RNBlurModalExample
//
// Created by Ryan Nystrom on 10/17/12.
// Copyright (c) 2012 Ryan Nystrom. All rights reserved.
//
/*
* RNBlurModal
*
* Created by Ryan Nystrom on 10/2/12.
* Copyright (c) 2012 Ryan Nystrom. All rights reserved.
*
* 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.
*/

#import <UIKit/UIKit.h>

Expand Down
Loading

0 comments on commit bbd33b1

Please sign in to comment.