SRMModalViewController 0.0.3

SRMModalViewController 0.0.3

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Nov 2016

Maintained by Mark.



  • By
  • SongRanMark

SRMModalViewController support a easy way to display a view with modal style.

Installation

SRMModalViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SRMModalViewController"

Usage

UIViewController *viewController = [UIViewController new];
viewController.view.frame = CGRectMake(0, 0, 200, 200);
viewController.view.backgroundColor = [UIColor whiteColor];
[[SRMModalViewController sharedInstance] showViewWithController:viewController];

or

UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
view.backgroundColor = [UIColor whiteColor];
[[SRMModalViewController sharedInstance] showView:view];

Custom color and opacity of background mask.

[SRMModalViewController sharedInstance].backgroundColor = [UIColor blackColor];

[SRMModalViewController sharedInstance].backgroundOpacity = 0.5;

Show another one in a modal view diplayed already.

// Hide first one
[[SRMModalViewController sharedInstance] showView:self.contentView];
// Do not hide first one
SRMModalViewController *modalViewController = [SRMModalViewController new];
[modalViewController showView:self.contentView];

You can download example project to get more info.

Author

S.R, [email protected]

License

SRMModalViewController is available under the MIT license. See the LICENSE file for more info.