LocationPicker icon indicating copy to clipboard operation
LocationPicker copied to clipboard

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

Open MussaCharles opened this issue 3 years ago • 0 comments

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

MussaCharles avatar May 19 '21 14:05 MussaCharles