Git Product home page Git Product logo

pulley's People

Contributors

albinekcom avatar amyleecodes avatar benjaminfischer avatar chaoscoder avatar connorpower avatar ddaddy avatar dentelezhkin avatar ethansinjin avatar florianbuerger avatar frederoni avatar grdsdev avatar hassaneldesouky avatar hyerra avatar ikenndac avatar iznv avatar jeehut avatar kiliankoe avatar lasha-ring avatar mattpolzin avatar mergesort avatar mmadjer avatar mredig avatar mrylmz avatar nick-potts avatar nixon506e avatar notohiro avatar patrick-remy avatar pschneider avatar ulmentflam avatar vortec4800 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

pulley's Issues

Bottom layout is not correct

If we render a view controller on the drawer content. The bottom layout is below the screen so the interface gets cut at the bottom of the controller's view.

It's hard to scroll down the PulleyViewController if there is a UITableView inside it

There are two use cases that cause it:

  1. Scroll down the UITableView slowly. When reaches the top of UITableView, it will cause over scroll until you release your finger. I expected it will scroll the PulleyViewController instead, just like Apple Map.
  2. Scroll down the UITableView quickly, it will cause UITableView bouncing, if you scroll down the UITableView again immediately, UITableView will bounce again, never scroll down the PulleyViewController.

May I know how to improve the nest scrolling behaviors?
For the case 2, I could improve it by setting UITableView.isScrollEnabled as false when contentOffset <= 0. I don't know if it is a good idea, but it just works like Apple Map.

Background dimming not working if setting -topInset

First of all, great library, thanks!

I wanted the drawer to open about half way and still make the background dim/darker. I tried using .partiallyRevealed state, but it didn't dim the background.
Then I tried using .open state and setting the -topInset value, so that the drawer would open only half way. But then the background dimming stopped working at certain values (topInset 200+) depending on device screen size.

What to do, to achieve my goal of opening the drawer to half screen and still dim the background?

Customize Drawer height

Hi,
sorry for these easy questions but im a bloody beginner :)
I want to customize the collapsed height of the drawer. So far i implemented the PulleyDrawerViewControllerDelegate protocol in the DrawerContentVC and added inside the class the three functions
func collapsedDrawerHeight() -> CGFloat {

}
func partialRevealDrawerHeight() -> CGFloat {
    
}
func supportedDrawerPositions() -> [PulleyPosition]{

}

what do i have to type inside these functions to set the collapsed Drawer Height twice as big as the height of my Tabbar ?

Thanks in advance :)

Problems conforming to delegates after update to 1.5.1 from 1.4

Hi,

I used updated to 1.5.1 and it broke my build.

screen shot 2017-08-17 at 10 01 00 am

This worked fine in 1.4. I've tried fixing by following it the XCode suggestions such as adding override or extending from PulleyPrimaryContentControllerDelegate instead but nothing I do works.

Thanks!

Bug with UIVisualEffectView (pre iOS 10)

So before getting into the meat of things, I dug through the old closed issues as I figured that I would find the reason as to why this seems to work on iOS 10 for iPad devices specifically.

Came across this closed issue where the UIVisualEffectView implementation had changed with iOS 10 where I came across the same issue as well myself. https://github.com/52inc/Pulley/issues/5

I noticed that on actual device testing and on simulator as well (testing against iOS 9.3), the UIVisualEffectView is broken on the UITableViewCells as the effect isn't being rendered.

Screenshots:

iOS 9
iOS 9

iOS 10
Imgur

Wondering if the pre iOS 10 solution that worked on 9 could be used here with a conditional #available(<iOS Version here>) would be a possible work around.

Bug with scrolling

Hi guys. Very good lib. But i just realized one strange situation. If we put tableview to pulley then during scrolling rows are updating.
Just change sample's code as following and you will see

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 15
}
var i = 0
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let row = tableView.dequeueReusableCell(withIdentifier: "SampleCell", for: indexPath)
row.detailTextLabel?.text = String(i)
i += 1
return row
}
if tableview row count is more than 10 or 15 then rows may be duplicated even 3 or 4 times.

Thank you for attention.

need to stop one gesture

The Apple Maps bottomView handles transitioning from the pan gesture to the scroll view scroll gesture in one smooth motion. the user doesn't need to stop one gesture and start a new one in order to start scrolling the view.

position drawer on top of view

Is there any chance to put drawer on top of view (below navigation bar) and drag it down (instead of its initial bottom position)? and it it is, how?
thanks

Subclasses PulleyViewController

I'm implementing the controls from IB and subclassed PulleyViewController and set the VC to my subclass in IB. But when I navigate to the VC, I get a crash:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7f9991607900> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key drawerContentContainerView.

Things run perfectly if I don't set the class to my subclass, but I need to subclass it to customize the drawer height.

Navigation Controller Support

I am trying to set pulley view controller as a root view controller of navigation controller. I wish to manage the extra top 44 space of bar as Drawer Container VC flows on top of bar which i don't want. Could you please help me with this?

[Proposal] PulleyDrawerViewControllerDelegate methods should be all optional

Hi everyone!
Thank you for making this quite useful library.

I've played with it and I believe that any class that would like to conform to PulleyDrawerViewControllerDelegate should not have to implement all the protocol functions.

It's simple to look into the source code and find what the default implementation for each methods is:

extension MyClass: PulleyDrawerViewControllerDelegate {
  func collapsedDrawerHeight() -> CGFloat {
    let kPulleyDefaultCollapsedHeight: CGFloat = 68.0
    return kPulleyDefaultCollapsedHeight
  }
  
  func partialRevealDrawerHeight() -> CGFloat {
    let kPulleyDefaultPartialRevealHeight: CGFloat = 264.0
    return kPulleyDefaultPartialRevealHeight
  }
  
  func supportedDrawerPositions() -> [PulleyPosition] {
    return PulleyPosition.all
  }
}

Still, I believe that if I wanted to change only the behavior of collapsedDrawerHeight() for example, I should be able to do just that.

This is just my opinion/suggestion, please feel free to dismiss it if it's not in line with your library development. ๐Ÿ˜„

Cheers,
Federico

Top space bug in interface builder

Hi,

If you instantiate a pulley controller in interface builder there is an additional 8 height space between the vc top and the content drawer top. You can detect it by setting up a vc in storyboard and the replacing it by the same vc in code. The vc will then go down by 8.

If someone need a fix asap :
A workaround is to set again the content vc in viewWillAppear by code

How to overlay a view on top of BOTH drawer and primary containers?

Great work with Pulley!

I have a view that lies above both the primary and drawer container views in my Storyboard.

However, at run-time, the view appears underneath (in the view debugger) the containers, so I can't see them.

Is there any way to achieve this?

Thanks!

click on statusbar open drawer

Hello guys. Thanks for sach amazing tool. have got two questions.

  1. I have implemented PulleyDrawer and on app start i'm setting it to closed, but when i click to statusbar pulley becomes visible to collapsed position. What could be the reason for this.
  2. When i load results to Drawer tableview all results are duplicated in table view. So if my drawer should show, for ex ["apple", "ios", "ipad", "iphone"] then it shows drawer with result ["apple", "ios", "ipad", "iphone", "apple", "ios", "ipad", "iphone"]

Thank you for attention.

Cannot find protocol declaration for 'PulleyDrawerViewControllerDelegate'

I'm a bit new to iOS dev, I'm writing my program in objective c and I used pods to install Pulley using the use_frameworks! flag. I can find PulleyDelegate but I cannot find PulleyDrawerViewControllerDelegate. I'm trying to follow your instructions to change the drawer dimensions dynamically. I imported the framework using #import "Pulley-Swift.h"

Make height adjustments when loading contentDrawer

Hi,

I have two drawer that have different collapsed size and I have no way to move the button in my primaryDrawer when the other one is loaded. It works asap I move the drawer but It is not considered as moved when its resized. I don't know if i'm clear enough.

In images :
The first one is the starting state spacing :
screen shot 2016-09-23 at 20 15 16

The second one is when I load a bigger collapsed size drawer :
screen shot 2016-09-23 at 20 15 23

If I move the drawer my buttons move with the drawerChangedDistanceFromBottom but then if I load again the first one :
screen shot 2016-09-23 at 20 15 30

I think one solution would be that drawerChangedDistanceFromBottom(_:distance:) in the primaryDelegate should be called when the pulleyController is changing his content drawer. Or add methods to the delegate to respond to the contentDrawer collapsed size changes.

need help on pathing variables

I am trying to path a variable from my view controller to pulley.
I managed to pass it to PulleyViewController using prepareForSegue method.
but I cant understand how to pass it to PrimaryViewController and DrawerViewController.
Can you please help me? Thanks

Access primaryContentViewController on prepare(for segue: UIStoryboardSegue, sender: Any?)

Hey! I would like to access the primaryContentViewController of the PulleyViewController because I would like to pass some data over to the view. This should be done on the prepare(for segue: UIStoryboardSegue, sender: Any?) method of the viewcontroller class, which presents Pulley modally (set up on storyboard).

I am facing the problem that the primaryContentViewController object on the appearing segue destination is nil and therefore I cannot pass data to it. Is there a way to get over this issue? I tried the same thing programmatically as well with no success. Here is my code (of the former attempt):

class MyVC: UIViewController {
    @IBOutlet weak var textfield: UITextField!
    
    @IBAction func tapped(_ sender: Any) {
        performSegue(withIdentifier: "toPulley", sender: textfield.text)
    }
    
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        if let primaryContentVC = ((segue.destination as? PulleyViewController)?.primaryContentViewController as? PrimaryContentViewController), let data = sender as? String {
            primaryContentVC.data = data
        }
    }
}

Display Over UITabBar

What would be the ideal way to display the drawer content over that tabBar of a UITabBarController?

Fully expended size api

I think it would be better to set the full size the way we set collapsed and partial size to be more consistent. Tho, You may still keep the inset as a minimum distance or something like this.

Strange behavior when tapping the status bar

First of all thank you for sharing this amazing library!

I've noticed a strange behavior that is probably unwanted in most cases; if you tap the status bar while the drawer is open, the scroll view scrolls to the top, effectively closing the drawer without getting rid of the dimming view, meaning that you have to tap once more to interact with the content view.

This can be solved by setting drawerScrollView.scrollsToTop = false

drawer content stations bellow lowest stop

Summary:

The drawer is dropping and staying below where it is supposed to go.
When I start the app, the drawer is in the right position, but when I move the pulley up, let go, and then down all the way, it shows less than when it started.

What it should do:

The pulley should get back to the original position.

Details:

collapsedDrawerHeight = partialRevealDrawerHeight
and
supportedDrawerPositions = PulleyPosition.all

Set PulleyDrawerViewController scrolling enable.

Hallo first of all Thank you so much for this example it is very nice. So to the question how can i set the PullyDrawerView to enable for scrolling so the user must click a button too get back to normal mode ?
So i have it in open mode and have set a view in the PullyDrawerView (scrolling must be enable) then user must select more things and must click done and then drawer view get back to the normal mode with scrolling.
Thank you for your answer.

NavController issue and switching to normal VC

Hello, in the picture below you can see how I build up the drawer content in the storyboard. What you can't see is that the pulleyVC is also embed in a tabbarcontroller.

bildschirmfoto 2017-08-19 um 00 26 55

I have now 2 problems with the results of this, I don't know how to fix.

  1. When i embed the DrawerContentVC in a NavigationController, the collapsedDrawerHight function doesn't work anymore. I did set the value for the collapsed Hight to 120. Without the NavController it works like it should.
  2. By clicking a cell from the Table View of the DrawerContentVC the second View (BarDetailVC) is opening up inside the drawer. But I want the other VC to be not presented inside the pulleyVC but as a normal View. At the same time it's important that the tabbar at the bottom doesn't disappear when going to the second VC.

Multiple drawer

Is it possible to add a drawer over the first drawer? This is the behaviour of the Map-App in iOS, which I want to implement.

UIViewController not key value coding-compliant

I'm getting an exception when I try to switch to a pulleyViewController

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x143d485f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key drawerContentContainerView.

As per instructions, I added two container views in the pulleyviewcontroller and linked the outlet drawerContentContainer to a container view. And, I also linked the outlet primaryContentContainer to the other container view. These two container views segue to ordinary UIViewControllers.

I did not do any customization but I am getting this exception. My project is primilary objective-c but I don't think this has much to do with it. I even tried to use a forked project https://github.com/tadelv/Pulley/tree/objc_friendly but the exception still arises.

TLDR: followed insturctions to setup PulleyViewController in interface builder, NSUnknownKeyException arises

Open drawer on button

I have button on Primary Content View Controller . How can we open drawer content view controller on touch of the button.

setNeedsSupportedDrawerPositionsUpdate bug

I am currently writing an app where the drawerViewController is an UINavigationController. Based on in which screen I am in the UINavigationController the drawerHeight should adjust and the positions should only support a certain one.

In my PulleyViewController I implemented the delegate: PulleyViewController and for each method I return a variable that represents the active 'state'. This state is given by the NSNoificationCenter and it looks like this:

@objc func setPulleyPossibilities(notification:NSNotification){
        if let positions = notification.object as? [Int] {
            if positions.isEmpty {
                self.drawerPositions = PulleyPosition.all
                return
            }
            var newPositions:[PulleyPosition] = []
            for position in positions{
                newPositions.append(self.determinePositionBy(position: position))
            }
            self.drawerPositions = newPositions
        }
        self.setNeedsSupportedDrawerPositionsUpdate()
    }

The thing is, that I red in the usage that I need to call self.setNeedsSupportedDrawerPositionsUpdate() after doing this but this does not happen unfortunately. I also set the delegate and I see it actually updating in the debugger of xcode.

Another strange thing is that I've set a breakpoint in the delegate methods but they don't fire for somer eason but, the variables in the PulleyViewController is updated!

Bug with modals

Hi this time It's a more important bug :)

After dismissing a modal displayed over the pulley, the content drawer bugs.
I've managed to use only modal segues over full screen so it keeps my drawer so problem solved but when I don't manage my self the segue (Facebook login for ex) the bug stays. Think there is something to do with define context or something like this but I'm not expert with those.

supportedDrawerPositions issue

Hi, thanks for sharing such useful library.

I have found that when the I set the supported position without '.open', then the drawer UI will break and can not be dragged. Is this an issue?

How to enable scrolling in UITableView table when the content fits on the screen

Please help with the question.
This situation, when I open the DrawerViewController in the state .open, then scrolling is disabled, if the number of cells can fit into the screen sizes. And accordingly I can not catch the event here:

func scrollViewDidScroll(_ scrollView: UIScrollView) {
self.searchBar.setShowsCancelButton(false, animated: false)
}

Can't access container.drawerContentViewController

Hi the content and primary drawers are set to internal so we can't access it from outside of your project. Can you make these public or at least provide some getters ?

Is there another way to get reference to the primary from content or to the content from the primary ?

this is what i tried so far :

screen shot 2016-09-23 at 00 48 10

Wrong drawer frame animation when switching drawer content view controller

I have an issue with the animations when I call the
setDrawerContentViewController(controller:animated:)
method to switch drawer content view controllers.

The new content view controller has a initial frame of size .zero in the transition animation and is scaling up to the target layout.

Could it be possible that the PulleyViewController is accidentally animating the relayout of the view controller?

Animation for changing drawers

First of all thank you for sharing this amazing library!

Would it be possible to more accurately imitate the animation in the iOS 10 Maps app when calling setDrawerContentViewController?

passing array data

what's the best way to pass an array into pulley so that both drawer and primary can see it...

-Thanks

Custom UIControl gesture in Drawer

Here is my hierarchy:

PulleyDrawerViewController
  |
  --- MyController
           |
           --- UIScollview
                   |
                   ---UIStackView
                          |
                          --- custom UIControl listening for vertical gesture

The issue is that whenever I try to start the UIControl gesture, my ScrollView scroll is triggered. So I excluded my UIcontrols by overriding touchesShouldCancelfor my UIScrollView. Now it works great when my scrollview is scrolled, but when not, the gesture is passed to Pulley's internal scrollview (that is private as you said in an other issue).
Do I have to fork / manual import the project to be able to modify the internal scrollview behavior or do you see anything else I can do to manage this case?

Can't install Cocoapod v1.1.0

[!] Error installing Pulley
[!] /usr/bin/git clone https://github.com/52inc/Pulley.git /var/folders/z6/y50mnb4s17n2wbtssvm0v9lr0000gn/T/d20160910-41184-h37c3q --template= --single-branch --depth 1 --branch 1.1.0

Cloning into '/var/folders/z6/y50mnb4s17n2wbtssvm0v9lr0000gn/T/d20160910-41184-h37c3q'...
warning: Could not find remote branch 1.1.0 to clone.
fatal: Remote branch 1.1.0 not found in upstream origin

UIVisualEffectView in drawer not working

Hi!

Neither in the demo, nor in my own app I can get the blurry drawer background to work. It's just transparent. Any ideas? I'm using the latest beta.

Also thanks for making this!

img_0342

Support for navigationController

Hi,

As you recommended to not inherit from pulleyViewController directly how should we react for navigation controller bar button items ?

I'm gonna start by using buttons but I think its something useful

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.