Skip to content

Michael-jie/JJPopoverTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

示例效果

CoderJJWei

Installation

Using CocoaPods

  1. Add the pod JJPopoverTool to your Podfile.
platform :ios, "7.0"
target 'TargetName' do
pod 'JJPopoverTool'
end
  1. Run pod install from Terminal, then open your app's .xcworkspace file to launch Xcode.
  2. Import the JJPopoverTool.h header.
  • With use_frameworks! in your Podfile
  • Swift: import JJPopoverTool
  • Objective-C: #import <JJPopoverTool/JJPopoverTool.h> (or with Modules enabled: @import JJPopoverTool;)
  • Without use_frameworks! in your Podfile
  • Swift: Add #import "JJPopoverTool.h" to your bridging header.
  • Objective-C: #import "JJPopoverTool.h"

使用说明

JJPopoverTool导入到工程中 #####Here's an example:

// 内容的View
UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 140, 44 * 3)];
tableView.dataSource =self;
tableView.delegate = self;
// 使用类方法弹出popover
// tableView : 弹出的内容
// sender : 指向的控件
// @[self.a, self.b] : 过滤的控件(不受popover影响的)
[JJPopoverTool presentContentView:tableView
pointToItem:sender
passThroughViews:@[self.a, self.b]];

// 退出popover
// 判断如果弹出了popover则退出
if ([JJPopoverTool isShowPopover]) {
[JJPopoverTool dismiss];
}

接口说明

/**
*  弹出popver
*
*  @param contentView 内容
*  @param item        指向的控件
*  @param passthroughViews 设置不受popover影响的控件
*/
+ (void)presentContentView:(UIView *)contentView
pointToItem:(UIView *)item
passThroughViews:(NSArray *)passthroughViews;

/**
*  退出popover
*/
+ (void)dismiss;

/**
*  是否弹出了popover
*/
+ (BOOL)isShowPopover;

About

一行代码实现iPad中popover效果

Resources

License

Stars

Watchers

Forks

Packages

No packages published