Coder Social home page Coder Social logo

wangguibin / wgbcustompopupview Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 500 KB

通用的弹窗组件,三行代码搞定一个弹窗,支持多种弹出样式

License: MIT License

Ruby 2.98% Objective-C 89.91% Shell 7.11%
pop-up popup popover popup-window alert custom-view objective-c common animation

wgbcustompopupview's Introduction

WGBCustomPopUpView

Example

图片仅供参考,具体还是看代码比较好 pic is cheap , show the code


效果 预览图
示例1打赏弹窗 1
示例2引导弹窗 2
示例3提示消息 3
示例4系统Alert封装 4
示例5系统AlertSheet封装 5

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

//实例化	
  	WGBCustomPopUpView *popUpView = [[WGBCustomPopUpView alloc] init];
  	
	UIView *bgView = [[UIView alloc] initWithFrame:[UIScreen mainScreen].bounds];
	bgView.userInteractionEnabled = YES;
	bgView.backgroundColor = [UIColor clearColor] ;

  	UIView *redView = [[UIView alloc] init];
  	redView.frame = CGRectMake(0,kScreenHeight-200,375,200);
  	redView.backgroundColor =[UIColor redColor];
	redView.center = CGPointMake(bgView.frame.size.width/2, bgView.frame.size.height/2);
	[bgView addSubview: redView];


	/// 以下三行才是关键代码 
  	popUpView.contentView = redView;  //设置内容视图
  	popUpView.animationType = arc4random()%6;  //设置弹窗动画类型  随机枚举值  
  	[popUpView show]; // 弹出来瞧瞧

  	// 必要的时候消除弹窗
  		popUpView.touchDismiss = YES;
  		[popUpView dismiss];

Requirements

Installation

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

pod 'WGBCustomPopUpView',~>1.0.1

Author

Wangguibin, [email protected]

License

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

wgbcustompopupview's People

Contributors

wangguibin avatar ygc-byte avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.