Coder Social home page Coder Social logo

xymenu's Introduction

XYMenu

简易集成弹出菜单 OC&&Swift

三种显示方式(Left, Mid, Right)

自动监测菜单是否超出屏幕(若超出则向上弹出菜单)

若发现问题或者有新的需求想法

请提出Issue或[email protected]

demo.gif

OC

  1. 将XYMenu/XYMenuOC引入工程

  2. UIView调用菜单

    引用 UIView+XYMenu.h头文件

    @interface UIView (XYMenu)
    /**
     UIView Show XYMenu
     @param imagesArr 图片
     @param titles 标题
     @param menuType 菜单类型 (XYMenuLeftNormal,XYMenuMidNormal,XYMenuRightNormal)
     @param block 回调Block
    */
    - (void)xy_showMenuWithImages:(NSArray *)imagesArr titles:(NSArray *)titles menuType:(XYMenuType)menuType withItemClickIndex:(ItemClickIndexBlock)block
    
  3. UIBarButtonItem调用菜单

    引用UIBarButtonItem+XYMenu.h头文件

    @interface UIBarButtonItem (XYMenu)
    /**
     UIBarButtonItem Show XYMenu
     @param imagesArr 图片
     @param titles 标题
     @param menuType 菜单类型(XYMenuLeftNavBar,XYMenuRightNavBar)
     @param currentNavVC BarButoonItem的当前NavVC
     @param block 回调Block
    */
    - (void)xy_showMenuWithImages:(NSArray *)imagesArr titles:(NSArray *)titles menuType:(XYMenuType)menuType currentNavVC:(UINavigationController *)currentNavVC withItemClickIndex:(ItemClickIndexBlock)block;
    

Swift

  1. 将XYMenu/XYMenuSwift引入工程

  2. UIView调用菜单

    /**
    UIView Show XYMenu
    @param images 图片
    @param titles 标题
    @param type 菜单类型 (XYMenuLeftNormal,XYMenuMidNormal,XYMenuRightNormal)
    @param closure 回调closure 
           index   item索引
    */
    sender.xy_showXYMenu(images: images, titles: titles, type: type, closure: { (index) in })
    
  3. UIBarButtonItem调用菜单

    /**
     UIBarButtonItem Show XYMenu
     @param images 图片
     @param titles 标题
     @param type 菜单类型(XYMenuLeftNavBar,XYMenuRightNavBar)
     @param currentNavVC BarButoonItem的当前NavVC
     @param closure 回调closure 
            index   item索引
    */
    barButtonItem.xy_showXYMenu(images: images, titles: titles, currentNavVC: self.navigationController!, type: type, closure: { (index) in })
    

版本记录

1.0.1 --- 实现UIView UIBarButtonItem弹出菜单(OC&&Swift)

xymenu's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.