Latest 1.0.2
Homepage https://github.com/DevNewbee/JSPopoverMenu
License MIT
Platforms ios 8.0, requires ARC
Authors

Build Pass
Language

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.
Example1

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

Demo
Add New Tag

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

  1. Check the demo in JSPopoverMenuDemo. The demo is designed to show the menu view when the titleView, which is a UIButton, of the NavigationBar is tapped.
  2. JSPopoverMenuViewDelegate protocal is required to implement.
  3. JSPopoverMenuView is a subclass of UIView, 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

  1. Using AutoLayout
  2. The character validation of the UITdextField is too simple.

Apps using JSPopoverView

云洞

Latest podspec

{
    "name": "JSPopoverMenu",
    "version": "1.0.2",
    "summary": "Popover MenuView Menu",
    "description": "It's a popover view for managing tags.",
    "homepage": "https://github.com/DevNewbee/JSPopoverMenu",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "DevNewbee": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/DevNewbee/JSPopoverMenu.git",
        "tag": "1.0.2"
    },
    "source_files": "Source/*.swift",
    "requires_arc": true,
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This