SFDraggableDialogView 1.1.5

SFDraggableDialogView 1.1.5

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布最后发布2016年9月

[Jakub]维护。




展示具有真实物理行为(归功于UIkit Dynamics)的美丽对话框视图,具有拖拽关闭功能。

Example

安装

从版本1.1.4开始,pod不再破损!资产和xib已生成。

有两种方法可以将SFDraggableDialogView库添加到您的项目中。将其作为常规库添加,或通过CocoaPods进行安装。

pod 'SFDraggableDialogView'

您也可以使用以下命令快速尝试示例项目:

pod try SFDraggableDialogView

库需要iOS 8及以上版本的目标

用法 (请注意示例代码中的一些部分可能是从我的其他库等中来的)

    SFDraggableDialogView *dialogView = [[[NSBundle mainBundle] loadNibNamed:@"SFDraggableDialogView" owner:self options:nil] firstObject];
    dialogView.frame = self.view.bounds;
    dialogView.photo = [UIImage imageNamed:@"face"];
    dialogView.delegate = self;
    dialogView.titleText = [[NSMutableAttributedString alloc] initWithString:@"Round is over"];
    dialogView.messageText = [self exampleAttributeString];
    dialogView.firstBtnText = [@"See results" uppercaseString];
    dialogView.dialogBackgroundColor = [UIColor whiteColor];
    dialogView.cornerRadius = 8.0;
    dialogView.backgroundShadowOpacity = 0.2;
    dialogView.hideCloseButton = true;
    dialogView.showSecondBtn = false;
    dialogView.contentViewType = SFContentViewTypeDefault;
    dialogView.firstBtnBackgroundColor = [UIColor colorWithRed:0.230 green:0.777 blue:0.316 alpha:1.000];
    [dialogView createBlurBackgroundWithImage:[self jt_imageWithView:self.view] tintColor:[[UIColor blackColor] colorWithAlphaComponent:0.35] blurRadius:60.0];

    [self.view addSubview:dialogView];

SFDraggableDialogViewDelegate

- (void)draggableDialogView:(SFDraggableDialogView *)dialogView didPressFirstButton:(UIButton *)firstButton;
- (void)draggableDialogView:(SFDraggableDialogView *)dialogView didPressSecondButton:(UIButton *)secondButton;
- (void)draggingDidBegin:(SFDraggableDialogView *)dialogView;
- (void)draggingDidEnd:(SFDraggableDialogView *)dialogView;
- (void)draggableDialogViewWillDismiss:(SFDraggableDialogView *)dialogView;
- (void)draggableDialogViewDismissed:(SFDraggableDialogView *)dialogView;

自定义内容视图

SFContentViewType属性接受两个值 - 默认和自定义。默认视图包含两个标签和一个示例中的图片。使用自定义视图作为可访问customView属性的子视图的容器。

还有一个showSecondBtn属性。

库使用资源中的Apple的UIImage模糊分类。

作者

此库由Jakub Truhlar开源。

许可

MIT许可(MIT)版权所有 © 2015 Jakub Truhlar