Code Monkey home page Code Monkey logo

rushisangani / rsselectionmenu Goto Github PK

View Code? Open in Web Editor NEW
353.0 11.0 91.0 20.94 MB

An elegant selection list or dropdown menu for iOS with single or multiple selections.

License: MIT License

Swift 78.70% Objective-C 20.29% Ruby 1.00%
ios dropdown-menus dropdown selection swift dropdownlist selectionmenu swift-3 list popover dropdownbutton swift4 rsselectionmenu multiselectdropdown multiselectpopupwindows popovers select-multiple selectbox swift5

rsselectionmenu's Issues

Formsheet height incorrect after 5.1.1 update

I was using RSSelectionMenu with Formsheet style fine with version 5.0, after updating to 5.1.1 Formsheet height goes to the bottom of the screen.

New Actionsheet and Alert styles work ok.

automaticDimension error after updating to 5.3

Hi
I'm getting error Error:(78, 33) 'automaticDimension' has been renamed to 'UITableViewAutomaticDimension' while compiling my app after I updated to 5.3
Can you please look into it?

[Feature Request] Add an option to show a simple title in Formsheet style

Hello

Thanks for this awesome lib. Works great. Anyways, I was wondering if you could allow showing a simple title at the top of the selection menu when its style is .Formsheet, basically above the search bar (if it's enabled) or where the search bar would be

Thanks in advance ๐Ÿ˜€๐Ÿ™Œ๐Ÿผ

Issue in Formsheet

Formsheet appears only one time, If the tap anywhere else or make a selection and then try to show the Formsheet it shows nothing.

Default Selection

Thank for library.
How to set item default selected in single selection?

[BUG] When selected a item shows multiple selections

Hi, I'm using your plugin as a popover selection list.
Currently I'm loading the items from the CoreData so I extended the class I needed to get an identifier as specified in the documentation

extension CategoriesCoreData: UniqueProperty {
    public func uniquePropertyName() -> String {
        return "title"
    }
}

The title is for sure unique because before adding a new category the software checks if that title already exists
When I tap, in this case a category, they show all as selected UI only, with this I mean, on the UI appears that all have been selected but on the code only one was selected as it should.
captura de ecra 2018-07-20 as 00 05 22

cancell button

first i want to thanks for your very good support
thanks to add function to add title but very little thing still has problem for me
when i add search button i can change the placeholder of search that is awesome but there is a
cancell buttun with text "Cancell" its whould be nice if you can add this function to

by the way you are so cool man !!!

NavigationBar barTintColor not always working

Hi

I am trying to set #212121 as the barTintColor of the NavigationBar but it isn't working properly as a lighter color is set.

Look at the screenshot below: the StatusBar color and SearchBar colors are #212121 but the NavigationBar's isn't (which actually is #323232).

captura de pantalla 2018-08-18 a la s 18 06 43

onDismiss was not found

Hi

Awesome work with RSSelectionMenu. Makes creating of drop down easier, manageable, and cool. Though I am encountering an issue when I try to use onDismiss. Swift shows an error that the menu has no member 'onDismiss'. Is there some import or configuration I am missing?

Thanks

Empty tableView message

I would like to show a UILabel with a message when the datasource is empty to handle empty tableView. How is it possible here?

Diss select an item

Hi,

I have a list of products with single selection. If the user regret of the product I can't diss select. How can you do that.

Missing selected items when using the select all first first row option

Hi,

Again I am loving this pod. Thanks for keeping it well maintained!!

I think I found a bug today.

If you add a first row with type .All. In the callback to setSelectedItem. The selected items array is returning with zero items.

It would make sense to me if there is a select all option available the setSelectedItem closure should return an array of all the items.

If this is not a bug and it is the intentional behaviour I am sorry. I just thought I would raise it with you.

Thanks.

Error while creating menu

let selectionMenu = RSSelectionMenu(dataSource: simpleDataArray) { (cell, object, indexPath) in
cell.textLabel?.text = object
}

When I try to create a menu using code above, compiler give this error:

image

Filter not working properly

Hi,

I'm using custom model with custom cell

This is the class "bank" :

class bank: NSObject, UniqueProperty {
    
    let banknm:String
    
    init(banknm:String) {
        
        self.banknm = banknm
    }
    
    // Here id has the unique value for each person
    func uniquePropertyName() -> String {
        return "banknm"
    }
}

And this the function I'm calling on Button Click.

func displayBank() {
        
        let selectionMenu =  RSSelectionMenu(selectionType: .Single, dataSource: bankDataArray, cellType: .Custom(nibName: "CustomTableViewCell", cellIdentifier: "customCell")) { (cell, bank, indexPath) in
            
            let customCell = cell as! CustomTableViewCell
            
            let rec   = self.bankDataArray[indexPath.item]
            customCell.lbl.text = rec.banknm
        }
        selectionMenu.setSelectedItems(items: selbankDataArray) { (text, selected, selectedItems) in
            self.selbankDataArray = selectedItems
            
            self.btnBank.setTitle(self.selbankDataArray.first?.banknm, for: .normal)
            
        }
        if(bankDataArray.isEmpty) {
            selectionMenu.addFirstRowAs(rowType: .Custom(value: "No Banks Found"), showSelected: self.firstRowSelected) { (text, isSelected) in
                
                // update your flag here to maintain consistency. -  This is required to be update when presenting for the second time.
                self.firstRowSelected = isSelected
            }
        }
                
        selectionMenu.showSearchBar { (searchtext) -> ([bank]) in
            return            self.bankDataArray.filter({$0.banknm.lowercased().hasPrefix(searchtext.lowercased())
                
                
            })
        }
        
        selectionMenu.show(from: self)
    }

Now when I type to filter the list, It's not returning the right ones
Here's the screen recording...
https://drive.google.com/open?id=1JCWdYm4NI9nuf8q3wvD3zaw4x3btFZYq

How find index selected

If I select an item how can I know the index that I select, in the selectionMenu.setSelectedItems(items: [])

thanks

On dismiss closure feature request

Hey

This pod is so so good and such a pleasure to use. Thanks for making and sharing it!

I have a feature request. Would it be possible to add an on dismiss callback closure which would be triggered when the formsheet style gets dismissed.

Thanks!

Disable cell check

Hi,

I want to disable checking the default checked cell so that user cannot uncheck them.
How can I do that please?

Thank you

Popover with Title

Hi folks
Is there a way to show "Popover" with a NavigationBar or at least a custom Title?
I saw the screenshot in this ticket: #51
This would be exactly what I need.

Bests

Philippe

Every row mark as checked

What is my problem? - It's works perfect but when I select one row, the App shows me "one row selected... etc" and it's okay, but when im looking into an App I have "checked" every rows.

there is my code:

@IBAction func licenseSelection(_ sender: Any) {
                let context = licenseSavingController.persistentContainer.viewContext
                let request = NSFetchRequest<NSFetchRequestResult>(entityName: "Licencja")
            let selectionMenu = RSSelectionMenu(selectionType: .Single, dataSource: licencje, cellType: .Basic) { (cell, object, indexPath) in
                cell.tintColor = .orange

                request.returnsObjectsAsFaults = false
                do {
                    var result = try context.fetch(request) as! [NSManagedObject]
                    result = [result[indexPath.row]]
                    for data in result {
                        self.licznik = self.licznik+1
                        cell.textLabel?.text = data.value(forKey: "licenseDescript") as? String ?? data.value(forKey: "licenseURL") as? String
                        //forKey: "licenseURL") as? String ?? "default"
                        //forKey: "licenseNumber") as? String ?? "default"
                        //data.value(forKey: "deviceID") as? String ?? "default"
                    }
                } catch {
                    print("Failed")
            }
        }

            selectionMenu.uniquePropertyName = "licznik"
            selectionMenu.setSelectedItems(items: wybranaLicencja) { (text, isSelected, selectedItems) in
                self.wybranaLicencja = selectedItems
                print(selectedItems)
            }
            selectionMenu.show(style: .Popover(sourceView: sender as! UIView, size: nil), from: self)
        }

like that: https://imgur.com/nveTKJ8 Im really confused with this :P

Build error

Building project takes too long time when adding the pod of RSSelectionMenu

Get the Id of the cell Selected?

Thanks for the great library.
How to get the id of the selected cell in formsheet?
The dataSource is a dictionary of key, value pairs. On cell selection how to capture the Id ?
Any help?
Thanks.

Cannot assign value type of...

Hi, I've recently added your lib to my project but I'm getting this error

Cannot assign value of type '[String : Any]?' to type '[NSAttributedStringKey : Any]?'

This error can be found in the file RSSelectionMenuController.swift line 325 witch contains this function

    // navigation bar
    fileprivate func setNavigationBarTheme(_ theme: NavigationBarTheme) {
        if let navigationBar = self.navigationController?.navigationBar {
            
            navigationBar.barTintColor = theme.color
            if theme.color != nil {
                navigationBar.tintColor = UIColor.white
            }
            
            navigationItem.title = theme.title
            navigationBar.titleTextAttributes = theme.attributes // <- Line where the error is located (325)
        }
    }

error in buttuns

i don't know why in new update my buttons (navigations button and search cancel button ) not showing up at all
in my code i setup

selectionMenu.rightBarButtonTitle = "Submit"
selectionMenu.leftBarButtonTitle = "Close"

and for my search i setup
selectionMenu.searchBarCancelButtonAttributes = SearchBarCancelButtonAttributes("Dismiss", .red)

and i want to customize search placeholder alignment in my case its stick on right but my language is RTL
screen shot 1396-08-06 at 12 05 46 pm

thank you for your support

Sticky Search bar

Thanks for such a great library, Can you please make the search bar as sticky on top while scrolling, it will possible by adding searchbar in tableview delegate , 'tableView(_ tableView: UITableView,
viewForHeaderInSection section: Int) -> UIView?' instead of 'tableHeaderView',
Thanks for great work ๐Ÿ’ฏ ๐Ÿ‘

Clear Selection Button

Hi,

this is a really great swift module!

Is it possible to have a button e.g. on the left navbar for clearing the selection?

Thanks
Phil

what is correct version to install ?

when i added pod 'RSSelectionMenu' into my podfile i got following message in terminal

Installing RSSelectionMenu (3.3)
which means it is installing 3.3

and when i addedd pod 'RSSelectionMenu', '~> 5.2.1' into podfile i got following message in terminal

CocoaPods could not find compatible versions for pod "RSSelectionMenu":
  In Podfile:
    RSSelectionMenu (~> 5.2.1)

None of your spec sources contain a spec satisfying the dependency: `RSSelectionMenu (~> 5.2.1)`.

Please define which is correct version to install.

Using Present or Push disables the custom NavigationBar styles

I want to use .Multiple and .Present at the same time. I do not want the "Done" button but a cancel button on the left. Anyways, the library keeps overriding my custom configuration.

Please give us full control of the NavigationBar buttons in any of the styles.
Basically, disable these checks, please.

Thanks

Formsheet looks really bad in landscape mode

In landscape mode there's too much padding on top and bottom sides, so it just shows a single item.

Please fix it so more items are shown and hopefully even make it device independent, so the bigger the screen, the more items it shows.

Thanks in advance.

captura de pantalla 2018-07-28 a la s 21 42 59

Selection issues in v 5.1

Hey

After updating to latest version, I'm facing an issue where selection of some items in table does not work.

It's happening in Single and Multiple selection types as well. And without custom cells too.

Here's a gif showing the issue:

kapture 2018-08-21 at 11 47 27

tableview height

tableview height should calculate dynamic if I have just 2 row your library create table view with lots of empty white space

Install on IOS 9.0

I installed the zip on IOS 9.0 and all seemed fine. Is there a reason the deployment target in the podfile is 10.0? Thanks!

Get data from Api via closure

How to pass data through api return. For eg: With every searchText i call an api which return data array and then it refreshes the selection menu. When i try to add the api inside the return function. It shows an error that closure require a return. It is not considering the return from the closure as a return.
For eg:

 selectionMenu.showSearchBar(withPlaceHolder: "Search Player", tintColor: UIColor.white.withAlphaComponent(0.3)) { (searchText) -> ([SearchModel]) in


            let parameters = ["term": searchText]
            ThreadStore.shared.search(parameters: parameters) {(success, list) in
               return list as! [SearchModel] .   //(Returning the response from the web service)
           }
        }

Formsheet Width is not proper some time

I am using formsheet to present users list which works fine but some time the width of formsheet shrink check the following image.
screen shot

It happens only some time other time the width is fine but i am unable to find why this is happening.
img_0070

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.