• Stars
    star
    430
  • Rank 101,083 (Top 2 %)
  • Language
    Swift
  • License
    MIT License
  • Created about 8 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

FTPopOverMenu_Swift, swift version of FTPopOverMenu. FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use. Supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect.

FTPopOverMenu

Twitter Carthage compatible GitHub license Version Download CocoaPods GitHub stars

Swift version of FTPopOverMenu.

FTPopOverMenu

FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use, supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect. Simplest APIs, enable you to change the style in one line of code.

somtimes I want to customer every cell, so I seperate the global setting, and cell setting. e.g: my PM want some menu item are show but can't tap for some reason.

ScreenShots

screenshot

Installation

Manually

  • clone this repo.
  • Simply drag and drop the '/FTPopOverMenu_Swift/FTPopOverMenu.swift' file into your project.

CocoaPods

FTPopOverMenu_Swift is available through CocoaPods. To install it, simply add the following line to your Podfile:

  • For Swift 4, please use version <= 0.1.4
  • For Swift 5, please use version >= 0.2.0
  • Big API change at 0.3.0, update at your own risk.
  • version >= 0.4.1 Version, changed the name of framework, from FTPopOverMenu_Swift to FTPopOverMenu
target 'MyApp' do
    pod 'FTPopOverMenu_Swift', '~> 0.1.4'
end

Then run a pod install inside your terminal, or from CocoaPods.app.

Usage

Customize

Do any of the following settings to set the style (Only set the ones you want to change), maybe do this when app starts or when you want it to show a different style, but remember it's global change.

    let configuration = FTConfiguration.shared
    configuration.menuRowHeight = ...
    configuration.menuWidth = ...
    configuration.textColor = ...
    configuration.textFont = ...
    configuration.tintColor = ...
    configuration.borderColor = ...
    configuration.borderWidth = ...
    configuration.textAlignment = ...
    configuration.ignoreImageOriginalColor = ...;
    // set 'ignoreImageOriginalColor' to YES, images color will be same as textColor

From SenderView, Menu Without Images.

        FTPopOverMenu.showForSender(sender: sender,
                                    with: ["Share"],
                                    done: { (selectedIndex) -> () in
                              
                                        print(selectedIndex)
        }) {
            
        }

From SenderView, Menu With Images.

        FTPopOverMenu.showForSender(sender: sender,
                                    with: ["Share"],
                                    menuImageArray: ["iconImageName"],
                                    done: { (selectedIndex) -> () in
                              
                                        print(selectedIndex)
        }) {
            
        }

From SenderFrame/NavigationItem, Menu Without Images.

        FTPopOverMenu.showFromSenderFrame(senderFrame: sender.frame,
                                          with: ["Share"],
                                          done: { (selectedIndex) -> () in
                                            
        }) {
            
        }

From SenderFrame/NavigationItem, Menu With Images.

        FTPopOverMenu.showFromSenderFrame(senderFrame: sender.frame,
                                          with: ["Share"],
                                          menuImageArray: ["iconImageName"],
                                          done: { (selectedIndex) -> () in
                                            
        }) {
            
        }

From barButtonItems .

  • First: add action with event to you barButtonItems
    @IBAction func handleAddBarButtonItem(_ sender: UIBarButtonItem, event: UIEvent) {
        
        FTPopOverMenu.showForEvent(event: event,
                                   with: ["Share"],
                                   menuImageArray: ["iconImageName"],
                                   done: { (selectedIndex) -> () in
        
        }) {
            
        }
    }

CHANGELOG

CHANGELOG

More

  • Swift version of FTPopOverMenu.
  • Logo Designed by @Tobaloidee
  • Images in the demo from https://www.iconfinder.com/iconsets/pokemon-go.
  • If you like it, or maybe wanna use it in your own projects, please give me a star.
  • Looking for another way of doing this? Take a look at my another FTPopMenu at here. It was another way of showing pop over menus, which is wrapped from UIPopoverViewController, and more genetic and more good-looking. Feel free to try it.

License

FTPopOverMenu_Swift is available under the MIT license. See the LICENSE file for more info.

More Repositories

1

FTPopOverMenu

FTPopOverMenu is a pop over menu for iOS which is maybe the easiest one to use. Supports both portrait and landscape. It can show from any UIView, any UIBarButtonItem and any CGRect.
Objective-C
1,035
star
2

FTIndicator

A light wight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes support.
Objective-C
297
star
3

FTFoldingTableView

FTFoldingTableView. Folding cells with simple delegates, and change UI looks in a few lines.
Objective-C
130
star
4

FTImageViewer

FTImageViewer can preview images with just one lines of code with Swift. Also FTImageViewGrid has make showing images in grid much easier.
Swift
125
star
5

FTChatMessage

FTChatMessage, a chat message UI framework written in swift. Not quite finished.
Swift
63
star
6

FTChatMessageDemoProject

FTChatMessageDemoProject, a chat message UI framework written in swift. Not quite finished.
Swift
62
star
7

FTPopMenu

FTPopMenu
Objective-C
25
star
8

FTPickerView

FTPickerView. A simple UIPickerView/UIDatePicker wrapper.
Objective-C
17
star
9

FTImageSize

FTImageSize. Get image size from remote image url synchronously, without downloading it.
Swift
15
star
10

FTPinterest

FTPinterest is just a demo I wrote.
Swift
7
star
11

liufengting.github.io

Repo for My Blog.
HTML
5
star
12

FTPageController

FTPageController
Swift
3
star
13

FTFoldableTableView

FTFoldableTableView
Objective-C
3
star
14

FTPullToRefresh

FTPullToRefresh. Wait for it.
Objective-C
3
star
15

FTZoomTransition

FTZoomTransition
Swift
2
star
16

FTProgressView

FTProgressView
Swift
2
star
17

FTWaterFallLayout

FTWaterFallLayout
Swift
2
star
18

FTContainerController

FTContainerController
Objective-C
2
star
19

FTInteractiveTransition

FTInteractiveTransition
Objective-C
1
star
20

FTProgressHUD

FTProgressHUD
Swift
1
star