Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help using customizeTableViewCell #17

Open
annjawn opened this issue Jul 7, 2017 · 1 comment
Open

Need help using customizeTableViewCell #17

annjawn opened this issue Jul 7, 2017 · 1 comment

Comments

@annjawn
Copy link

annjawn commented Jul 7, 2017

Hi,

I have been able to install and use the basic TableViewCell Google Places field, but I am not sure how to use customizeTableViewCell to customize the table view that shows the Google Place Autocomplete options.

This is what my GooglePlacesRow looks like-

GooglePlacesTableRow.defaultCellUpdate = { cell, row in
            cell.textLabel?.font = UIFont(name: "AvenirNext-Medium", size: 14)!
            cell.textLabel?.textColor = UIColor(red:0.04, green:0.62, blue:0.99, alpha:0.75)
            cell.height = ({return 40})
            cell.textField.textColor = UIColor.gray
        }

form +++ Section()
<<< GooglePlacesTableRow(){
                $0.title = "PICKUP ADDRESS"
                $0.placeholder = "1234 Pick-up Ave."
                let filter = GMSAutocompleteFilter()
                filter.type = .address
                filter.country = "US"
                $0.placeFilter = filter
            }.cellSetup({ (cell, row) in
                   //cell.customizeTableViewCell (??)
            })

The documentation says-

If you just want to change minor things of the cells that display the options (you will most probably want to) then the customizeTableViewCell callback is for you.

The documentation also says

You can customize attributes of the tableView that is displayed with the options. You should do this in cellSetup and keep in mind that the frame of the tableView is reset each time the tableView is displayed.

This is how currently the Autocomplete TableView looks like-

googleplaces

But I have absolutely no idea how to use customizeTableViewCell inside cellSetup() callback function, couldn't find any example or documentation detailing this online as well. Nothing in the sample code in Github. Sorry, I am a little new to Swift, so any help will be greatly appreciated.

@annjawn annjawn changed the title Need help with using customizeTableViewCell Need help with using customizeTableViewCell Jul 7, 2017
@annjawn annjawn changed the title Need help with using customizeTableViewCell Need help with using customizeTableViewCell Jul 7, 2017
@annjawn annjawn changed the title Need help with using customizeTableViewCell Need help using customizeTableViewCell Jul 7, 2017
@mats-claassen
Copy link
Member

Sorry for the late response but you can see an example of this in the example view controller at https://github.com/EurekaCommunity/GooglePlacesRow/blob/master/Example/Example/ViewController.swift#L31-L36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants