Giter VIP home page Giter VIP logo

wgbcustomalertview's Introduction

WGBCustomAlertView

自定义弹窗视图

支持pod私有库的引入

source "https://github.com/CoderWGB/WGBSpec.git" 
#以上这句必须填写 不然找不到这个库是从哪里加载过来的
platform :ios,'8.0'
target "WGB_MyDemoApp" do 
pod 'WGBCustomAlertPopupView','0.0.1'
end

当然也要支持cocopods啦!

pod 'WGBCustomAlertPopupView','~>0.0.1'

三行代码 搞定一个弹窗

"Talk is cheap show me your code !"

首先引入头文件 #import "WGBCustomPopUpView.h"

	//实例化	
  	WGBCustomPopUpView *popUpView = [[WGBCustomPopUpView alloc] init];
  	self.popUpView = popUpView; //持有对象,以便于dismiss 这里真正使用时再另行封装利用block转发更加优雅些

  	//创建个按钮试试水
  	UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
	button.frame = CGRectMake(0, 0, 300, 300);
	button.backgroundColor = [UIColor magentaColor];
	[button setTitle:@"你放马过来啊!!!" forState:UIControlStateNormal];
	[button addTarget:self action:@selector(dismiss) forControlEvents:UIControlEventTouchUpInside];

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


 - (void)dismiss{
	[self.popUpView dismiss];
}
以上, 结合Demo源码配合食用效果更佳...

wgbcustomalertview's People

Contributors

coderwgb avatar

Watchers

 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.