Giter Site home page Giter Site logo

jriosdev / iosdropdown Goto Github PK

View Code? Open in Web Editor NEW
651.0 10.0 146.0 7.86 MB

Drop Down Menu for iOS With Search And Other Awesome Customisation

Home Page: https://cocoapods.org/pods/iOSDropDown

License: MIT License

Ruby 3.23% Swift 96.77%
swift dropdown-menus dropdown ios-swift xcode cocoapods search dropdownlist podfile dropdown-menu

iosdropdown's People

Contributors

abdullakh35 avatar alireza12t avatar arunvalluthadam avatar awaismubeen avatar ibinh avatar jriosdev avatar mbrufatto avatar quantum2 avatar rafaelfrancisco-dev avatar rahul-surendran avatar rizwan95 avatar roy0anonymous avatar svlaev avatar ttub-nii avatar zerorendan 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

iosdropdown's Issues

dropdown within scrollview

my dropdown menu is inside scrollview. issue i'm facing is that scrollview stops scrolling if dropdown list is appeared. any idea how to fix that?

Non Editable

How do you make the field non editable. I only want to allow options from the dropdown

Changing text color of rows

How can I change the text color of the rows? I tried using interface builder, as well as programmatically, but the text color stays black.

Item list shows behind other elements

I use dropdown inside a vertical stack and when i tap dropdown its list shows behind other textfields. I tried to use bringSubview() but it didn't work.
Any solution?

DropDown list is not tapable

For the visibility on the bottom view i reversed the order in the storyboard and as a result the dropdown is visible on the below view but as a side effect the drop down is now unselectable. How can i fix this.

search is not working

Hi bro i try Search self.Category.isSearchEnable = true but search result not filter ?

screenshot 2018-12-09 at 12 24 39 am
screen shot 2018-12-09 at 12 23 54 am
screen shot 2018-12-09 at 12 23 38 am

How to set width?

My data for the option array have many characters. I would like to increase the width for the dropdown. I see you have property for List Height. How can i control List width?

ArrowColor not working

I am trying to change the color of the arrow from default (black) to white. In the interface builder, I set it to white but it stays black. I set it in code, but it stays black. I even go into the iOSDropDown.swift file and manually set the color to UIColor.white.cgColor but that doesn't do anything either. I have read that apparently the frame needs to be set but the Path has that already. Any thoughts on what is wrong?

Here is the draw code from iOS DropDown with the change:
`
override func draw(_ rect: CGRect) {

    // Get size
    let size = self.layer.frame.width

    // Create path
    let bezierPath = UIBezierPath()

    // Draw points
    let qSize = size/4

    bezierPath.move(to: CGPoint(x: 0, y: qSize))
    bezierPath.addLine(to: CGPoint(x: size, y: qSize))
    bezierPath.addLine(to: CGPoint(x: size/2, y: qSize*3))
    bezierPath.addLine(to: CGPoint(x: 0, y: qSize))
    bezierPath.close()

    // Mask to path
    let shapeLayer = CAShapeLayer()
    shapeLayer.path = bezierPath.cgPath
    shapeLayer.fillColor = UIColor.white.cgColor //arrowColor.cgColor
    shapeLayer.strokeColor = UIColor.white.cgColor
    if #available(iOS 12.0, *) {
        self.layer.addSublayer (shapeLayer)
    } else {
        self.layer.mask = shapeLayer
    }
}`

Option list layout not correct after rotation

Hi,

when the option list is displayed and then rotating the device you face that option list is not positioned correctly below the DropDown text field.

Simulator Screen Shot - iPhone Xs - 2019-08-07 at 16 39 46

Any idea how to fix this? What shall I call on UIViewController's willTransition callback?

Thanks for your help,
cheers,
Thomas

`selectedIndex` is not reset when `optionArray` is changed

Here the steps to reproduce the issue:

  1. Set optionArray with ["One", "Two", "Three"]
  2. Select the "One", the selectedIndex is now 0
  3. Change optionArray to ["Three", "Two", "One"], the selectedIndex is still 0. When open the list of dropdown, it show "Three" as selected text

Images list

Is it possible to add images to the list? Or is there is some way to customize each row?

I am trying to achieve something like this:

whatsapp image 2019-02-13 at 11 29 42 pm

Thank you!

detect focusChanges

I am just a beginner in swift. and have following query

I have 3 iosDropDown field and 3 uitextfield. all i want is to focus only 1 textfield/iosdropdown at a time. like when i search on 1st dropdown i want 2nd dropdown list to hide. how can i do that?

Arrow bug

Arrow is missing when the size of dropdown decreases.

DidSelect of table not calling

i have a view inside which i have placed a textfield. My drop down have 3 items, when drop down is visible only 1st item calls didselect method other two don't call the didselect method. My assumption is that the other two methods are out of the bound of parent view because when i increased the height of parent view for testing the didselect method called for all three items.

any quick fix for the issue?

Multiples

What is meant by (if using storyboard):

"1.If you are using Multiple Drop Downs in a Single ViewController, Must Kept reverse order on StoryBoard or addSubview() to avoid Overlaying"

OverLap with the parentView Context

Hello, I have an issue like for example I have an button below the Textfield(iOS drop down) when I click textfield my drop down will be opened and let us assume that I have 3 Contents inside the Dropdown and when I click the first content the button which is beneath the textfield is being selected so how to overcome this issue and one more when I have a content below my textfield when I click textfield (dropdown) my dropdown opens but it is not displaying over it (It means I was able to see my content and dropdown content mixed ) how to resolve these 2 issues please clear about it

Preselect a row

If I have 7 elements and I want the 3rd one pre-selected, I'm not seeing that method call. I see Select and Select! but if I pass the exact text string in the drop down it does not appear?

Memory leak

Please note that iOSDropDown's parentController holds a strong reference to VC that contains it, causes strong retain cycle.

I am new to GitHub and don't know how to submit change. The change I made was
Original: fileprivate var parentController:UIViewController?
Updated: fileprivate weak var parentController:UIViewController?

Cannot support constraints added by code

iOSDropDown is the most useful dropDownView that I have never found on Internet, but if some points below can be improved, I believe it will be a famous repository on Github.

1.When I add constraints to the DropDown instance,I found that it couldn't adapt the changes of it's superView's bounds. Then I found dropDown's subViews's frame were fixed in it's function named setupUI() in the initialization method.
2.It's hard to modify the time of it's appearing animation in cocapods way. It's a little bit long for me when I want to tap the option quikly, do not want the annimation to take away too much time.

Dropdown is behind

What am I missing that when the drop down appears it goes behind other controls that are on the view. Doing this all with Storyboard ios11

DropDown.selectedIndex is not working as expected

When I am setting the dropDown.selectedIndex the value is getting set, but when the drop down shows up in my app the actual dropDown itself is not showing the selectedText value, it is just empty box. Once I click on the down area then it shows my selected item in the list (as checked).

How do I get the selectedIndexs, selectedText to actual show up in the dropDown without having to click on the downarrow to see which one is checked?

Animation

How can i remove the bounce animation? it is slow when is closing the table after choose the option.

optionIds Array

optionIds array should be String array for uuid based databases.

underline how to remove

i have used button for dropdown it's working fine but i'm getting underline how to remove it, Please find the image
Screenshot 2019-06-15 at 15 43 20

Failde to build with carthage

Skipped building iOSDropDown due to the error:
Dependency "iOSDropDown" has no shared framework schemes

---> This is the message i get. I saw that another user has the same issue. Mind giving a hand?

Prevent dropDown from opening when some pre condition not satisfy on dropDown.listWillAppear ?

Hello guys, I want to track initial tap when any user taps on dropdown to check initially some condition & if condition satisfy then and then only user can tap on drop down otherwise some related user friendly message I will show.

Currently there is only post selection i.e. (dropDown.didSelection) method available but I want method when user taps initially to check some pre condition.

    lazy var departmentDropDown: DropDown = {
        
        let dd = DropDown()
        dd.translatesAutoresizingMaskIntoConstraints = false
        dd.placeholder = "Select Department"
        dd.textColor = .darkGray
        dd.font = UIFont.systemFont(ofSize: 16, weight: .medium)
        // dd.addTarget(self, action: #selector(handleDepartmentDropDown), for: .touchUpInside) // want to track below func
        return dd
    }()
    
    @objc func handleDepartmentDropDown() {
        print(123)
    }

How to Delegate

Hello, I am using this to select servers: example

When I select Germany 1 I want to UserDefaults.standard.set("1.1.1.1", forKey: "IP")

When I select Germany 2 I want to UserDefaults.standard.set("8.8.8.8", forKey: "IP")

How can I do this?

text text colour of rows property?

Reading from this #23

It was said text colour for dropdown is added?
My testing:
dropDownTop.optionArray = ["Option 1", "Option 2", "Option 3"]
dropDownTop.optionIds = [1,2,3]
dropDownTop.rowBackgroundColor = .black
dropDownTop.textColor = .white

Screenshot 2019-07-27 at 7 01 50 AM
How do I change the dropdown text colour?

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.