MIT-Mobile / MIT-Mobile-for-iOS

The iPhone native portion of the MIT Mobile Framework
http://m.mit.edu/about/iphoneapp.html
Other
107 stars 46 forks source link

Searchbar cancel button not staying active after searchBarSearchButtonClicked #95

Closed transitmark closed 10 years ago

transitmark commented 10 years ago

@rosslebeau

What do you think about this solution?

I think I like this one over the selected because it recursively goes through all the subviews and enables them.

http://stackoverflow.com/questions/9968595/how-to-enable-cancel-button-with-uisearchbar

rosslebeau commented 10 years ago

I think it's fine. I'm always a little wary of messing with unexposed things but in this case I don't think there's likely to ever be controls in a UISearchBar we don't want enabled. How does it look? I assume this also lets you press the close button to dismiss the view even when the searchbar isn't first responder?

transitmark commented 10 years ago

Looks good and yes. Button stays red and calls searchBarCancelButtonClicked when clicked even when the search bar isn't first responder.

transitmark commented 10 years ago

@rosslebeau

So we don't have any conflicts with later versions of iOS we are deciding against this way and are going to try to implement our own cancel button. For what I am doing with the search bar I am going to try to add a cancel button to the uinavigationbar and set the search bar's cancel button to not show and implement my own didclickcancelbutton method.

rosslebeau commented 10 years ago

@Smartcop Sure, we already had it implemented this way on the iPad. We can implement this while we're taking care of the other calendars stuff, or if you'd like to do it, just make a PR into 3.6/dev-intrepid when you're done.

transitmark commented 10 years ago

@rosslebeau Nah that's alright you can do it :-)