YHPopupView 0.3.0

YHPopupView 0.3.0

测试测试过
语言语言 Obj-CObjective C
授权 MIT
发布最新发布2017年6月

DengYonghao 维护。



  • DengYonghao

中文介绍

在 iOS 上提供了一个公开的弹出视图 YHPopupView,可以使用并方便地自定义。然后您可以通过您想显示的上下文来关注视图。

demo

demo

安装

通过 CocoaPods 安装是首选方式。只需添加

pod 'YHPopupView'

然后运行 pod install。它将安装 YHPopupView 的最新版本。

如果您想使用 YHPopupView 的最新代码,请使用

pod 'YHPopupView', :head

用法

###YHPopupView

#import "ViewController.h"
#import "YHPopupView.h"

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    YHPopupView *popupView = [[YHPopupView alloc] initWithFrame:CGRectMake(50, 50, 200, 200)];
    popupView.clickBlankSpaceDismiss = YES;
    // You can add subview in need
    popupView.backgroundColor = [UIColor blueColor];
    [self presentPopupView:popupView];
}

@end

###YHMessageView

- (IBAction)showMessageView:(id)sender {
    YHMessageView *messageView = [[YHMessageView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 80)];
    messageView.showTime = 3;
    messageView.backgroundColor = [[UIColor alloc] initWithWhite:0 alpha:0.5];
    messageView.delegate = self;
    [messageView addSubview:label];
    [self presentMessageView:messageView];
}

#pragma mark - YHMessageView Delegate
- (void)tapMessageView:(YHMessageView *)messageView {
    NSLog(@"tap messageView");
}

@end

更新日志

v0.2.0 添加 YHMessageView

v0.1.0 第一个版本