Skip to content

Commit

Permalink
Merge branch 'develop' for v 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaspard Viot committed Feb 6, 2014
2 parents 32f75a2 + 34f55f0 commit 80a612b
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 161 deletions.
6 changes: 3 additions & 3 deletions MaryPopin.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "MaryPopin"
s.version = "1.1.1"
s.version = "1.2"
s.summary = "Category to display modal-like view controllers with more options"

s.description = <<-DESC
MaryPopin is a category to present view controllers in a supercalifragilisticexpialidocious way.
More precisely, it allows you to present modal-like view controllers with a custom size and a larger choice of transition.
More precisely, it allows you to present modal-like view controllers with a custom size and a larger choice of transitions.
On iOS 7, it can use motion effects and UIKit Dynamics for even better looking popins.
DESC

Expand All @@ -17,7 +17,7 @@ Pod::Spec.new do |s|

s.platform = :ios, '5.0'

s.source = { :git => "https://github.com/Backelite/MaryPopin.git", :tag => "1.1.1" }
s.source = { :git => "https://github.com/Backelite/MaryPopin.git", :tag => "1.2" }

s.source_files = 'MaryPopin/**/*.{h,m}'

Expand Down
6 changes: 5 additions & 1 deletion MaryPopin/UIViewController+MaryPopin.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ typedef NS_OPTIONS(NSUInteger, BKTPopinOption) {
/**
* Disable auto dismiss when touching outside of the popin view
*/
BKTPopinDisableAutoDismiss = 1 << 1
BKTPopinDisableAutoDismiss = 1 << 1,
/**
* Set a background dimming view with a clear color. Default is a semi-transparent black background
*/
BKTPopinDimmingViewStyleNone = 1 << 16,
};

/**
Expand Down
13 changes: 10 additions & 3 deletions MaryPopin/UIViewController+MaryPopin.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,16 @@ - (void)presentPopinController:(UIViewController *)popinController fromRect:(CGR

BKTPopinOption options = [popinController popinOptions];
if (! (options & BKTPopinDisableAutoDismiss)) {
[dimmingView setBackgroundColor:[UIColor colorWithWhite:0.0f alpha:0.1f]];
UIGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissCurrentPopinController)];
[dimmingView addGestureRecognizer:tapGesture];
}

if (options & BKTPopinDimmingViewStyleNone) {
[dimmingView setBackgroundColor:[UIColor clearColor]];
} else {
[dimmingView setBackgroundColor:[UIColor colorWithWhite:0.0f alpha:0.1f]];
}

[self setDimmingView:dimmingView];

CGRect popinFrame = [self computePopinFrame:popinController inRect:rect];
Expand Down Expand Up @@ -146,8 +151,10 @@ - (void)dismissCurrentPopinControllerAnimated:(BOOL)animated completion:(void(^)
self.dimmingView.alpha = 0.0f;
} completion:^(BOOL finished) {
//Removing background
[self.dimmingView removeFromSuperview];
[self setDimmingView:nil];
if (self.presentedPopinViewController == nil) {
[self.dimmingView removeFromSuperview];
[self setDimmingView:nil];
}
}];

if ([presentedPopin popinTransitionUsesDynamics]) {
Expand Down
122 changes: 0 additions & 122 deletions MaryPopinDemo/MaryPopinDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
2BDC27E7185F0DE900627E9A /* Main_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2BDC27E5185F0DE900627E9A /* Main_iPhone.storyboard */; };
2BDC27EA185F0DE900627E9A /* BKTViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BDC27E9185F0DE900627E9A /* BKTViewController.m */; };
2BDC27EC185F0DE900627E9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2BDC27EB185F0DE900627E9A /* Images.xcassets */; };
2BDC27F3185F0DE900627E9A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDC27F2185F0DE900627E9A /* XCTest.framework */; };
2BDC27F4185F0DE900627E9A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDC27D3185F0DE900627E9A /* Foundation.framework */; };
2BDC27F5185F0DE900627E9A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BDC27D7185F0DE900627E9A /* UIKit.framework */; };
2BDC280B185F0E2600627E9A /* UIViewController+MaryPopin.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BDC280A185F0E2600627E9A /* UIViewController+MaryPopin.m */; };
2BDC280F185F106300627E9A /* BKTPopinControllerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2BDC280D185F106300627E9A /* BKTPopinControllerViewController.m */; };
2BDC2810185F106300627E9A /* BKTPopinControllerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2BDC280E185F106300627E9A /* BKTPopinControllerViewController.xib */; };
Expand All @@ -30,16 +27,6 @@
C2ADB227188DC52D009EABDB /* Main_iPad.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C2ADB229188DC52D009EABDB /* Main_iPad.storyboard */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
2BDC27F6185F0DE900627E9A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 2BDC27C8185F0DE900627E9A /* Project object */;
proxyType = 1;
remoteGlobalIDString = 2BDC27CF185F0DE900627E9A;
remoteInfo = MaryPopinDemo;
};
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
2B88EF26186F3D0300922387 /* BKTOptionCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BKTOptionCell.h; sourceTree = "<group>"; };
2B88EF27186F3D0300922387 /* BKTOptionCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BKTOptionCell.m; sourceTree = "<group>"; };
Expand All @@ -56,7 +43,6 @@
2BDC27E8185F0DE900627E9A /* BKTViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BKTViewController.h; sourceTree = "<group>"; };
2BDC27E9185F0DE900627E9A /* BKTViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BKTViewController.m; sourceTree = "<group>"; };
2BDC27EB185F0DE900627E9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
2BDC27F1185F0DE900627E9A /* MaryPopinDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MaryPopinDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2BDC27F2185F0DE900627E9A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
2BDC2809185F0E2600627E9A /* UIViewController+MaryPopin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIViewController+MaryPopin.h"; path = "../MaryPopin/UIViewController+MaryPopin.h"; sourceTree = SOURCE_ROOT; };
2BDC280A185F0E2600627E9A /* UIViewController+MaryPopin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIViewController+MaryPopin.m"; path = "../MaryPopin/UIViewController+MaryPopin.m"; sourceTree = SOURCE_ROOT; };
Expand Down Expand Up @@ -85,16 +71,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
2BDC27EE185F0DE900627E9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2BDC27F3185F0DE900627E9A /* XCTest.framework in Frameworks */,
2BDC27F5185F0DE900627E9A /* UIKit.framework in Frameworks */,
2BDC27F4185F0DE900627E9A /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
Expand All @@ -111,7 +87,6 @@
isa = PBXGroup;
children = (
2BDC27D0185F0DE900627E9A /* MaryPopinDemo.app */,
2BDC27F1185F0DE900627E9A /* MaryPopinDemoTests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -211,24 +186,6 @@
productReference = 2BDC27D0185F0DE900627E9A /* MaryPopinDemo.app */;
productType = "com.apple.product-type.application";
};
2BDC27F0185F0DE900627E9A /* MaryPopinDemoTests */ = {
isa = PBXNativeTarget;
buildConfigurationList = 2BDC2805185F0DE900627E9A /* Build configuration list for PBXNativeTarget "MaryPopinDemoTests" */;
buildPhases = (
2BDC27ED185F0DE900627E9A /* Sources */,
2BDC27EE185F0DE900627E9A /* Frameworks */,
2BDC27EF185F0DE900627E9A /* Resources */,
);
buildRules = (
);
dependencies = (
2BDC27F7185F0DE900627E9A /* PBXTargetDependency */,
);
name = MaryPopinDemoTests;
productName = MaryPopinDemoTests;
productReference = 2BDC27F1185F0DE900627E9A /* MaryPopinDemoTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
Expand All @@ -238,11 +195,6 @@
CLASSPREFIX = BKT;
LastUpgradeCheck = 0500;
ORGANIZATIONNAME = Backelite;
TargetAttributes = {
2BDC27F0185F0DE900627E9A = {
TestTargetID = 2BDC27CF185F0DE900627E9A;
};
};
};
buildConfigurationList = 2BDC27CB185F0DE900627E9A /* Build configuration list for PBXProject "MaryPopinDemo" */;
compatibilityVersion = "Xcode 3.2";
Expand All @@ -258,7 +210,6 @@
projectRoot = "";
targets = (
2BDC27CF185F0DE900627E9A /* MaryPopinDemo */,
2BDC27F0185F0DE900627E9A /* MaryPopinDemoTests */,
);
};
/* End PBXProject section */
Expand All @@ -277,13 +228,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
2BDC27EF185F0DE900627E9A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand All @@ -303,23 +247,8 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
2BDC27ED185F0DE900627E9A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
2BDC27F7185F0DE900627E9A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 2BDC27CF185F0DE900627E9A /* MaryPopinDemo */;
targetProxy = 2BDC27F6185F0DE900627E9A /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
2BDC27DC185F0DE900627E9A /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
Expand Down Expand Up @@ -450,48 +379,6 @@
};
name = Release;
};
2BDC2806185F0DE900627E9A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MaryPopinDemo.app/MaryPopinDemo";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MaryPopinDemo/MaryPopinDemo-Prefix.pch";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = "MaryPopinDemoTests/MaryPopinDemoTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
};
name = Debug;
};
2BDC2807185F0DE900627E9A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_INCLUDING_64_BIT)";
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MaryPopinDemo.app/MaryPopinDemo";
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
"$(DEVELOPER_FRAMEWORKS_DIR)",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "MaryPopinDemo/MaryPopinDemo-Prefix.pch";
INFOPLIST_FILE = "MaryPopinDemoTests/MaryPopinDemoTests-Info.plist";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUNDLE_LOADER)";
WRAPPER_EXTENSION = xctest;
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
Expand All @@ -513,15 +400,6 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
2BDC2805185F0DE900627E9A /* Build configuration list for PBXNativeTarget "MaryPopinDemoTests" */ = {
isa = XCConfigurationList;
buildConfigurations = (
2BDC2806185F0DE900627E9A /* Debug */,
2BDC2807185F0DE900627E9A /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 2BDC27C8185F0DE900627E9A /* Project object */;
Expand Down
1 change: 0 additions & 1 deletion MaryPopinDemo/MaryPopinDemo/BKTiPadDetailsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfa
- (IBAction)presentPopinPressed:(id)sender
{
BKTPopinControllerViewController *popin = [[BKTPopinControllerViewController alloc] init];
[popin setPopinOptions:BKTPopinDefault];
[popin setPopinTransitionDirection:BKTPopinTransitionDirectionTop];
[self presentPopinController:popin animated:YES completion:^{
NSLog(@"Popin presented !");
Expand Down
29 changes: 4 additions & 25 deletions MaryPopinDemo/MaryPopinDemo/BKTiPadViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,13 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfa
return YES;
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 0;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return 0;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

// Configure the cell...

return cell;
}

- (IBAction)presentPopinPressed:(id)sender
{
BKTPopin2ControllerViewController *popin = [[BKTPopin2ControllerViewController alloc] init];
[popin setPopinOptions:BKTPopinDefault];
//Disable auto dismiss and removed semi-transparent background
[popin setPopinOptions:BKTPopinDisableAutoDismiss|BKTPopinDimmingViewStyleNone];

//Configure transition direction
[popin setPopinTransitionDirection:BKTPopinTransitionDirectionTop];
[self presentPopinController:popin animated:YES completion:^{
NSLog(@"Popin presented !");
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,22 @@ that is why we name it a popin controller. And as it is implemented as a categor

## Changes

v 1.0
v 1.2

* First public release
* Added an option to remove coupling between background view and auto-dismiss option
* Fixed an issue causing background view to disappear when chaining multiple popins

v 1.1.1

* Code refactoring

v 1.1

* Support for iOS 5 & 6

v 1.1.1

* Code refactoring
v 1.0

* First public release

## Getting started
### The Pod way
Expand Down Expand Up @@ -120,4 +124,4 @@ Contributions for bug fixing or improvements are welcomed. Feel free to submit a
## Licence
MaryPopin is available under the MIT license. See the LICENSE file for more info.
[![Analytics](https://ga-beacon.appspot.com/UA-44164731-2/mary-popin/readme)](https://github.com/igrigorik/ga-beacon?pixel)
[![Analytics](https://ga-beacon.appspot.com/UA-44164731-2/mary-popin/readme?pixel)](https://github.com/igrigorik/ga-beacon)

0 comments on commit 80a612b

Please sign in to comment.