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

Added optional param to immediately dismiss after selecting location from SearchResultVC and an optional close navBar button item. #74

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

MussaCharles
Copy link

@MussaCharles MussaCharles commented May 19, 2021

There were two things needed for my project: -

  1. Immediately dismiss after user tap a location from SearchResults TableView.
  2. Show a close button on navBar so that user can simply dismiss the Location picker if they change their mind.
    This button is very useful if the location picker was presented modally as there is no a back button generated like when the VC is pushed from navigation stack.

So I have implemented the two features leaving the old implementation unchanged. If someone in the future needs these two things they simply have to change the following boolean flags to true before pushing or presenting the location picker.

 public var dismissImmediatelyAfterTableViewSelection = false
 public var showCloseButtonOnNavBar = false

eg:

let locationPicker = LocationPickerViewController()
locationPicker.dismissImmediatelyAfterTableViewSelection = true
locationPicker.showCloseButtonOnNavBar = true

There is one more thing too. As a bonus, I have added another sample app named ProgramaticDemo, which demo the library for pure code based UIs.

Below is a screenshot showing the new added close button on top right corner (Useful for modally presented picker).

Screen Shot 2021-05-19 at 11 42 30 PM

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

Successfully merging this pull request may close these issues.

1 participant