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

Swift usage can't conform to protocol #10

Closed
petergzli opened this issue Dec 3, 2015 · 2 comments
Closed

Swift usage can't conform to protocol #10

petergzli opened this issue Dec 3, 2015 · 2 comments

Comments

@petergzli
Copy link

Hi,

This is fantastic. I'm implementing this wrapper into my swift code. I have followed all the instructions. I subclasses a textfield with MVPlaceSearchTextField, created the outlet. Then I attached the delegate PlaceSearchTextFieldDelegate to the view controller. Next I set the strapi key.

But once I try setting the delegate methods (four of them). I still get the can't conform error.

Here is my extension of my AddAddressViewController class which is subclass of UIViewController. I have everything, but I seem to be missing something, clearly.

extension AddAddressViewController: PlaceSearchTextFieldDelegate {

//MARK: Placesearch Textfield Delegates

func placeSearch(textField: MVPlaceSearchTextField!, responseForSelectedPlace responseDict: GMSPlace!) {
    return
}

func placeSearch(textField: MVPlaceSearchTextField!, resultCell cell: UITableViewCell!, withPlaceObject placeObject: PlaceObject!, atIndex index: Int) {
}

func placeSearchWillHideResult(textField: MVPlaceSearchTextField!) {
}

func placeSearchWillShowResult(textField: MVPlaceSearchTextField!) {
}

}

@TheMrugraj
Copy link
Owner

Sorry I dont have considered swift as of now, even not have tested with the same. :(

@yamini-rm
Copy link

yamini-rm commented Jul 29, 2016

Try this code for Swift:

@objc(placeSearch:ResponseForSelectedPlace:) func placeSearch(textField: MVPlaceSearchTextField!, responseForSelectedPlace responseDict: GMSPlace!) {
}

@objc(placeSearch:ResultCell:withPlaceObject:atIndex:) func placeSearch(textField: MVPlaceSearchTextField!, resultCell cell: UITableViewCell!, withPlaceObject placeObject: PlaceObject!, atIndex index: Int) {
}

@objc(placeSearchWillShowResult:) func placeSearchWillShowResult(textField: MVPlaceSearchTextField!) {
}

@objc(placeSearchWillHideResult:) func placeSearchWillHideResult(textField: MVPlaceSearchTextField!) {

}

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

3 participants