SLNPopupMenu 是一个用于创建弹出菜单的 iOS 简单类库
导入文件 方法 01
将 SLNPopupMenu 文件夹(
SLNPopupView.h
和SLNPopupView.m
)拖放到适当的目录在你要导入的文件中添加
#import "SLNPopupView.h"
方法 2: 使用 pod
pod 'SLNPopupMenu'
#import "SLNPopupView.h"
如何使用
NSArray *menu = @[
@["Title 1", "Description", [UIImage ImageWithName:@"img1.png"]],
@["Title 2", "Description", [UIImage ImageWithName:@"img2.png"]],
@["Title 3", "Description", [UIImage ImageWithName:@"img3.png"]],
@["Title 4", "Description", [UIImage ImageWithName:@"img4.png"]]
]
[PopupView showPopWithDescriptionImage:menu font:nil touchPoint:[recognizer locationInView:self.view] success:^(NSInteger selectedIndex) {
NSLog(@"Selected Index %li", (long)selectedIndex);
} dismiss:^{
NSLog(@"Disissed");
}];
NSArray *menu = @[
@["Title 1", "Description"],
@["Title 2", "Description"],
@["Title 3", "Description"],
@["Title 4", "Description"]
]
[PopupView showPopOnlyWithTitleAndDescription:menu font:nil touchPoint:[recognizer locationInView:self.view] success:^(NSInteger selectedIndex) {
NSLog(@"Selected Index %li", (long)selectedIndex);
} dismiss:^{
NSLog(@"Disissed");
}];
NSArray *menu = @[
@["Title 1", [UIImage ImageWithName:@"img1.png"]],
@["Title 2", [UIImage ImageWithName:@"img2.png"]],
@["Title 3", [UIImage ImageWithName:@"img3.png"]],
@["Title 4", [UIImage ImageWithName:@"img4.png"]]
]
[PopupView showPopOnlyWithTitleAndImage:menuArrayImage font:nil touchPoint:[recognizer locationInView:self.view] success:^(NSInteger selectedIndex) {
NSLog(@"Selected Index %li", (long)selectedIndex);
} dismiss:^{
NSLog(@"Disissed");
}];