JSPopoverMenu is a popover tag manager view. Elegant edting mode, easy to use.
Tap the Edit button at the top right to start edit mode and then this button will change to Done.
To move the cells, you just
drag it. Moving a cell to Trashbin icon will put the cell to the end of the queue and turn the cell to gray.

Touch the done button at the top right to confirm deleting or those tail cells to put it back to where it was automatically. By touching the reset button, you could undo all actions.
Demo
Installation
CocoaPods
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'JSPopoverMenu', '~> 1.0' //
end
Manual
Download two .swift files in Source.
Usage
- Check the demo in JSPopoverMenuDemo. The demo is designed to show the menu view when the
titleView, which is aUIButton, of theNavigationBaris tapped. JSPopoverMenuViewDelegateprotocal is required to implement.JSPopoverMenuViewis a subclass ofUIView, so just use it like others.
1. Initialization
The default width is the same as the screen. So you just need to set the height of the menu view. data is [String] type,every single String represents a tag (a Cell) on the collection
view.
popoverView = JSPopoverMenuView(height: 120, data: defaultData)
2. Delegate
1. Set delegate
popoverView.delegate = self
self refers to a view controller in the demo. Any subclass of UIView is also fine.
2. Set baseView. The entire PopoverView will be added to the baseView
var baseView: UIView { return self.view }
3.1 Tag Tapped Event
func popoverMenu(_ popoverMenu: PopoverMenuView, didSelectedAt indexPath: IndexPath)
3.2 Edit Done Event
func popoverMenu(_ popoverMenu: PopoverMenuView, updatedData data: [String])
3.3 New Tag Inserted Event
func popoverMenu(_ popoverMenu: PopoverMenuView, newTag value: String)
Notice: This function will be invoked right after users added a new tag, which means the menu is still under the editing mode and the new tag could be delete immediately. Thus, it's better to get the final data after the editing
b func popoverMenu(_ popoverMenu: PopoverMenuView, updatedData data: [String]).
3. Show
There are two methods to show and dimiss the menu.
1. QuickSwitch.
Show the menu if the menu is not displayed, or dimiss it if the menu is displayed
popoverView.quickSwitch()
2.1 Show
popoverView.show() { print("I'm here") }
2.2 Dimiss
popoverView.dismiss() { print("See ya") }
TODO
- Using AutoLayout
- The character validation of the
UITdextFieldis too simple.




