Git Product home page Git Product logo

sfdraggabledialogview's Introduction

Version License Platform

SFDraggableDialogView

Display the beautiful dialog view with realistic physics behavior (thanks to UIkit Dynamics) with drag to dismiss feature.

Example

Installation

Since pod version 1.1.4 the pod is not broken anymore! Assets and xib are generated.

There are two ways to add the SFDraggableDialogView library to your project. Add it as a regular library or install it through CocoaPods.

pod 'SFDraggableDialogView'

You may also quick try the example project with

pod try SFDraggableDialogView

Library requires target iOS 8 and above

Usage (Mind that some parts of the example code could be from my other libraries etc.)

    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;

Custom content view

There is SFContentViewType property that takes two values - Default and Custom. Default view has two labels and image from example. Use custom view for as a container for your subviews accessible through customView property.

There is also showSecondBtn property.

Library uses Apple’s category for UIImage blur located in resources.

Author

This library is open-sourced by Jakub Truhlar.

License

The MIT License (MIT) Copyright © 2015 Jakub Truhlar

sfdraggabledialogview's People

Contributors

alexruperez avatar kubatruhlar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sfdraggabledialogview's Issues

Dragging issue in iOS 10

Hi @kubatru, SFDraggableDialogView.xib have an auto layout issue in shadowView that cause dragging start from the top with iOS 10.

Dialog view showing bug

I'm using SFDraggableDialogView into a UIViewController. It doesn't matter if I add it as a subview in viewDidLoad() or viewWillAppear(). After presenting VC, dialog view gets stuck on top for 1 second (or something like that), then drops down. If I present VC animated, dialog view does not get stuck on top, but it has a flicker in middle of the screen (I cannot describe exactly). All of this happens after updating from version 1.0.4 to 1.1.4. I've used iPhone 6 (iOS 9.3). On simulator I cannot reproduce stuck, only flicker.
Thanks !

No button

Hi,

It is possible to have the choice to hide/remove the first button ? I don't need it for my case.

Thank you,

dialog view of screen

I am displaying several table views using MXsegmentedpager. On double tap of a cell, the dialog view pops up. However, recently, the dialog is appearing off screen. The blur and cancel button appear correctly. You can see the dialog view dropping across the view from the top of the screen. It works properly on the first table view only.

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.