Skip to content

Need help using customizeTableViewCell #17

Description

@annjawn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions