Git Product home page Git Product logo

customdropdown's Introduction

CustomDropDown

Drop Down view for iOS using UIKit.

CustomDropDown can be used anywhere you need a dropdown and it makes everything so easy, provides options for customization. You can provide your custom view for the rows and the selected view as well.

Install

Carthage

For installing with Carthage, add it to your Cartfile.

github "tejuamirthi/CustomDropDown"

Do this command with terminal.

$ carthage update

Then, You need to add CustomDropDown.framework to your project.

Refer here for step by step compilation of adding frameworks via carthage

Basic

For basic usage please refer to the Example project

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Work on good-first-issue to contribute right away.

Contributing guidelines

Feel free to raise new issues if you find any bugs or create feature requests

License

Licensed under Apache License 2.0

customdropdown's People

Contributors

caocmai avatar franklinsamboni avatar jacquealvesb avatar pancreax avatar tejuamirthi avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

customdropdown's Issues

[BUG] Text overlap

Describe the bug
The text in the dropdown view overlaps if we add more items in dropdown

To Reproduce
Add multiple items in the array
Scroll down the drop-down view

Expected behavior
The text should not overlap

Screenshots
Simulator Screen Shot - iPhone SE (2nd generation) - 2020-10-27 at 10 19 50

Smartphone (please complete the following information):

  • Device: iPhone SE (2nd Generation)
  • OS: iOS 13.5.0
  • Xcode: 12.0

[FR] Update the example project properly with dropdown styles

Is your feature request related to a problem? Please describe.
Right now, example project is not the whole picture. Need to display dropdown styles clearly

Describe the solution you'd like
Use the CustomDropDown framework as it is used earlier and display the example projects for both the styles. Label and ImageLabel which are being supported currently. Right now, example project shows only one example.

Additional context
Refer here for more info. You'll need to add another view and make it use the other DropDown style.

Feel free to reach out for a discussion!

[FR] DropDown row background color and styling

  • Add option for custom background color for drop down row
  • Different color for selected row's backgroundColor
  • Option for selected text foreground color.
  • Option for specifying NSAttributedString attributes for normal row

[BUG] Terminating app due to uncaught exception 'NSGenericException'

Describe the bug
The framework is generate an app crash when the superview of the custom drop down view is nil.

To Reproduce

  • Create an project with two ViewControllers embebed in a NavigationViewController
  • In the first one just put a segue to the SecondViewController.
  • In the SecondViewController implement the CustomDropDown framework
  • Run and navigate to SecondViewController.
  • Tap on Back button of Navigation Item, then app crash.

Expected behavior

  • An app should be navigated back successfully and the framework shouldn't generate this crash.

Screenshots

Smartphone (please complete the following information):

  • Device: Simulator iPhone 11 Pro Max
  • OS: iOS 14
  • Xcode: 12.0.1

Additional context
Copy of error:
Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to activate constraint with anchors <NSLayoutYAxisAnchor:0x6000003b3b80 "TtGC14CustomDropDown14CustomDropDownSS:0x7fb7a340f320.top"> and <NSLayoutYAxisAnchor:0x60000038c000 "TtGC14CustomDropDown18CustomDropDownViewSS:0x7fb7a340e1e0.bottom"> because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal.'

Add support for cocoapods

Is your feature request related to a problem? Please describe.
Till now, we give support only as a carthage dependency

Describe the solution you'd like
Add support as a pod

Label height should be increased based on the content size available.

Based on the text cell height row should be increased.
If I gave a constant value for row height and cell height
Then it is not working.

If I add height for row at index path method - UITableView.automaticDimension. It is also not working.

Can you please help me where can I change the code.

How can I fix this issue.
Screenshot 2024-04-23 at 11 19 35 AM

[BUG] adjust the label height according to length of the text

Describe the bug
Right now, when the text of any row is more than one line, the text is truncated at the end. Also if single line text is there, bottom part of the text is cut.

Expected behavior
Label height should be the height of the text in any number of lines it may be plus the padding from top and bottom

Smartphone (please complete the following information):

  • Device: iPhone 11 pro max
  • OS: 13.3
  • Xcode: 11.3.1

Additional context
Work on the CustomDropDown.swift view file

func getStringLabelCell(indexPath: IndexPath) -> UITableViewCell {

Label height should be increased based on the content size available.

Based on the text cell height row should be increased.
If I gave a constant value for row height and cell height
Then it is not working.

If I add height for row at index path method - UITableView.automaticDimension. It is also not working.

Can you please help me where can I change the code.

How can I fix this issue.
Screenshot 2024-04-23 at 11 19 35 AM

[BUG] No default behaviour for selecting a row from dropdown

Describe the bug
Right now, when we click on any row in dropdown, nothing happens

To Reproduce
Expand the dropdown and click on any row

Expected behavior
For default dropdown style, change the display text to the selected row text

Smartphone (please complete the following information):

  • Device: iPhone 11 pro Max
  • OS: 13.3
  • Xcode: 11.3.1

[FR] Create a proper cell for the drop down rows

Is your feature request related to a problem? Please describe.
Right now DropDown cell is created everytime the cellForRowAt is called without reuse

Describe the solution you'd like
Create a new UITableViewCell for the default style(when the items are string)

Additional context
You'll be needed to check out this file CustomDropDown.swift for cellForRowAt

Refactor code

Seperate the views into different files in the framework
Code clean up and add comments at places
Update relevant documentation

[FR] Multi option select dropdown

Is your feature request related to a problem? Please describe.
There's no support for multi-select dropdown yet

Describe the solution you'd like
Provide option for multi-select drop down

Additional context

  • add a new dropdowntype
  • Respective new dropdowncell with checkbox in the left side
  • new dropdowndisplayview because we need to display the selected rows, may be a collection view inside this view? You can implement anything you want

Like the below picture, would love to add support for multi selection dropdown and the selected labels should be displayed in the top using a collection view

962AEA65-0754-4B57-B38E-408789454E76

Label height should be increased based on the content size available. #40

Based on the text cell height row should be increased.
If I gave a constant value for row height and cell height
Then it is not working.

If I add height for row at index path method - UITableView.automaticDimension. It is also not working.

Can you please help me where can I change the code. I have an requirement for this task.

How can I fix this issue.
Screenshot 2024-04-23 at 11 19 35 AM

Add support for SPM

Is your feature request related to a problem? Please describe.
Till now, we give support only as a carthage dependency

Describe the solution you'd like
Add support for Swift Package Manager

[BUG] DropDown toggle

Describe the bug
Right now, when we click on any part of the screen and if the dropdown is expanded already, it doesn't close.

To Reproduce
Add a dropdown and try expanding and closing by tapping on different areas on screen

Expected behavior
DropDown should collapse as soon as the user hits anywhere on the screen(If user hits on the dropdown view itself, it is handled)

Smartphone (please complete the following information):

  • Device: iPhone 11 Pro Max simulator
  • OS: 13.3
  • Xcode: 11.3.1

[FR] Add new dropdown styles

Is your feature request related to a problem? Please describe.
Right now only dropdown with text is supported. Customization for the user is given to create their own style but don't have any default styles

Describe the solution you'd like
Add few dropdown styles like Image, ImageAndLabel, Label

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.