GithubHelp home page GithubHelp logo

zoonooz / zfdragablemodaltransition Goto Github PK

View Code? Open in Web Editor NEW
2.5K 62.0 309.0 3.57 MB

Custom animation transition for present modal view controller

License: MIT License

Objective-C 86.70% Ruby 13.30%
ios transition animation objective-c

zfdragablemodaltransition's People

Contributors

albertschulz avatar alexpopov avatar bluezen avatar dimohamdy avatar ilidar avatar leviathan avatar zoonooz 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  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

zfdragablemodaltransition's Issues

Status bar missing in ios 8

In my case, a tab bar and navigation bar based app.
When dismissing a viewcontroller with the ZFDragableModalTransition, the status bar is removed from the toViewController which is the TabBarController during the transition, and will show when the transition is complete.
so you can see the navigationbar grows from 44pt to 64pt immediately.

Unbalanced calls to begin/end appearance transitions

Hi,

I am using the latest master branch with the fullsScreen transition implemented.

My view hierarchy is the following :

UITabBarController -> (the following number represents the tabs)
1 -> UINavigationController -> UIViewController (we will call it A)
2 -> ...
3 -> ...
4 -> ...

Inside the UIViewController A I am calling ZFDragableModalTransition with the following code to show another UIViewController B as modal

        var ctrl = self.storyboard?.instantiateViewControllerWithIdentifier("XXXXXXX") as! XXXXX

        ctrl.delegate = self
        ctrl.modalPresentationStyle = .FullScreen
        self.animator = ZFModalTransitionAnimator(modalViewController: ctrl)
        self.animator.dragable = false
        self.animator.bounces = false
        self.animator.direction = ZFModalTransitonDirection.Bottom;
        self.animator.transitionDuration = 0.66
        self.animator.behindViewAlpha = 0.5
        self.animator.behindViewScale = 0.5
        ctrl.transitioningDelegate = self.animator

        self.presentViewController(ctrl, animated: true, completion: nil)

Once the transition is done I am getting the following notice/warning in the console :

Unbalanced calls to begin/end appearance transitions for <UITabBarController: 0x155d48cd0>.

The same message appears when I called the following code inside the A UIViewController to dismiss the modal view B

        self.dismissViewControllerAnimated(true, completion: nil)

Any idea where it comes from ?

"bounces" property seems to have no effect.

Tested on: iOS 8.1

Changing bounces to NO results in the same presentation animation as if it were set to YES (presented from the bottom). Am I missing something or is that property intended for something else?

Presenting a page view controller

Hey,
my modal vc in this case is an horizontal page view controller.
If i set the draggable option as true(which i want) im not able to use any gestures that i used in my vc,
including the page view slide gesture.
Any ideas, or solutions?
Thanks

After dismiss the modalVC, the fromVC is disappeared?

When I present the modalVC from the fromVC, it looks perfect.
but when I dismiss the modalVC (use drag gesture or call dismiss method), as soon as the dismiss animation finished, my fromVC is also disappeared, just left a gray background color.

Did I do anything wrong about this? What's the problem?
Thank you very much.

Getting a blank view controller when performing segue

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        if segue.identifier == SEGUES.SegueLobbyToProfile {
            if let child = segue.destinationViewController.contentViewController as? ProfileViewController{
                self.animator = ZFModalTransitionAnimator(modalViewController: child)
                self.animator!.bounces = true
                self.animator!.transitionDuration = CGFloat(0.8)
                self.animator!.direction = .Right
                self.animator!.setContentScrollView(child.scrollView)

                self.animator!.dragable = true
                child.modalPresentationStyle = .Custom
                child.transitioningDelegate = self.animator

            }
        }

    }

Is this the correct way to attach the animator to the segue? My segue is "present modally" , with everything on default.

When the animator appears, it comes from Bottom (instead of Right), and the screen is completely white. I can drag the animator down to close it.

In-call status bar issue

Hi,

I'm having an issue when a phone call gets in and you are in the middle of a transition..

  1. Run the demo project on simulator
  2. Choose bottom modal style
  3. Toggle in-call status bar (command + Y )
  4. Toggle in-call status bar (command + Y ) - again
  5. Close the modal and watch the undesired effect

I'm still trying to find why this happen .

ModalViewController does not resize.

As seen in the gif, I was the model view controller to cover 75% of screen but the one in demo covers the entire screen. How can I modify that? I have tried setting the frame size but that didnt fix the issue.

thanks

Swift option

Please update this or create another repo with a swift version.

Dragging view if scrollview not at top

How can I set it so that the user can still drag the view controller even if scrollView isn't scrolled all the way to the top?
I'm using a tableView in the modal, and it only takes up the bottom half of the screen, so it seems rather tedious for the user to scroll all the way to the top of the scrollview just to push the controller down.

Disable bounce when appear

Hello, thank you for your transition.

Can you explain how I can disable bounce effect when modal view appears. As I understood bounce property for another thing.

Thank you.

ScrollView isnt scrolling

When pushing a NavigationView controller, with a view controller that has a scrollview

and setting
[self.animator setContentScrollView:detailViewController.scrollview];

disables the scroll view scrolling

any ideas?

How only show "a part of" view

hi,thanks for this great lib.. and I am doing a project like your demo gif showing.

and How can show a view from bottom like your demo gif, only show "a part of" view

Disable Gesture Directions for modal

Is there any way to disable certain gesture directions when the modal has been presented

i.e. I only want to allow the user to drag the modal down to dismiss and not allow the pull up bounce gesture as it interferes with other things in my modal

Cheers

Bounce setting ignored

Setting bounces to NO doesn't appear to change anything - the modal view still bounces in.

semi transparent view with solid content

I would like to make a semi transparent view of background black (around 75% alpha), and put a webview on top of it, how can I make the content of webview to be solid? I tried to add html body style: rgba(0,0,0,1) for that web view content font color. However not works. The content text still in semi transparent... any idea?

Handle iPhone 6 with Xib

Hello,

First nice work, it's a pretty cool lib.
But I got an issue trying to make it work on iPhone 6. I was using Xib, and the view of the modal controller did not resize correctly (using AutoresizingMask or Auto-Layout). But it was able to make it work with a Storyboard.

I tried the exact same thing by converting your demo project and saw the exact same behavior.

is it compatible with swift?

I am working on an app with swift , I was trying to use this lib with Objective-C bridge , and after I present the view controller , whenever I drag to dismiss the viewcontroller it will crash ? what is wrong? do you have any idea ?
in my case Xcode6.2 , ios 8.2

ZFDragableModalTransition for uiscrollview not working

i use in swift without uiscrollview is working, but if got uiscrollview it would not working
below is my code

   modalView = cn_web()
    self.animator = ZFModalTransitionAnimator(modalViewController:modalView)
    self.animator.setContentScrollView(modalView!.sv)
    self.animator.dragable = true
    self.animator.direction = ZFModalTransitonDirection.Right
    self.animator.bounces = false

    self.animator.behindViewAlpha = 0.1;
    self.animator.behindViewScale = 0.93;
    self.animator.transitionDuration = 0.3;

    modalView!.modalPresentationStyle = UIModalPresentationStyle.FullScreen

    modalView!.transitioningDelegate = self.animator

when presenting a navigationController, the gesture will be conflict

Here is the detail:
A : fromViewController
B : toViewController, is a UINavigationController object
C : a viewController
When present B, i can use back gesture (A.Animator.dragable = YES) back to A, it works perfectly.

When present B, then push C to B, i can use back gesture on C too, it is supposed to back to B, but it bring me back to A. Only if i slide from the edge of the screen i can back to B.
I tried to change A.Animator.dragable property to NO after push C, but the C would not response anything.

DismissViewController fails after you start dragging

If you start dragging the window closed, release it so that it's back open, and then try and use anything that triggers

self.dismissViewControllerAnimated(true, completion: nil)

You get this error

Warning: Attempt to dismiss from view controller <UINavigationController: 
0x144510fa0> while a presentation or dismiss is in progress!

It appears as if the view has not been canceled form it's transition after the drag is released.

Error if you start dragging

I have a getting error if i start dragging the modalviewcontroller

My code to present modal view controller is like this

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    VideoModel* videoObj  =   [videos objectAtIndex:indexPath.row];
    self.selectedVideo = videoObj;
    [self performSegueWithIdentifier:@"home_to_video" sender:nil];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    VideoViewController *detailViewController = segue.destinationViewController;
    self.animator = [[ZFModalTransitionAnimator alloc] initWithModalViewController:detailViewController];
    self.animator.dragable = TRUE;
    self.animator.direction = ZFModalTransitonDirectionBottom;
    detailViewController.transitioningDelegate = self.animator;
    detailViewController.modalPresentationStyle = UIModalPresentationCustom;
}

The modal window is shown correctly with animation, just gives error on dragging.
I am testing it on ios7.

The error which I get is
Warning: Attempt to present <VideoViewController: 0xc0a69b0> on <UITabBarController: 0xc0676c0> while a presentation is in progress!

uncaught exception 'CALayerInvalidGeometry', 'CALayer position contains NaN: [nan inf]

Not sure if this could be a specific error to my app but I'm getting this full error message

"Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan inf]"

I am using the modal transition to a uitableview and adding uitableview to [self.animator setContentScrollView:detailViewController.tableView];

If there is any clue on how i might be able to change this i could push it as a fix. but if you think its a simple thing to change it would really help my app. I plan to release it soon!

Great job on this wonderful control!

How to detect and handle UIScrollView's over scroll at the top

First off, great library!
I've got this one particular issue - once my modal view controller opens up, and I scroll down (to see the end content), when I scroll back up, the transition does not kick in - instead, the UIScrollView "bounces" at the top.

How can I prevent that over scroll at the top and trigger the modal transition?

Example for partial coverage of View?

Can someone give me an example of how to do the exact animation shown in the GIF where the bottom view only covers like 80% of the view (more of a push segue, and less of a modal one).

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.