Latest 2.0.0
Homepage https://github.com/l900416/LTxMenu
License MIT
Platforms ios 8.0, requires ARC
Frameworks Foundation, UIKit
Authors

Similar to Facebook News Feed , Alipay Life , QZone and other social applications . click a drop-down button to display more functions

LTxMenu
LTxMenu
LTxMenu
LTxMenu

Why

In Facebook News Feed , Alipay Life , QZone and other social applications , they all contain a function drop-down button which would show a list of more functions when taped .
I didn’t find any on GitHub , so I wrote a similar UI controls myself using Objective-C. Reference : https://github.com/kolyvan/kxmenu

Get Start

  • Drag the file to the project
  • pod LTxMenu

How To Use

Create

/**
* class instance method with dataSource and delegate. you can also create with [[LTxMenuView alloc] init] then set the dataSource and the delegate.
**/
+ (instancetype)instanceWithDataSource:(id <LTxMenuViewDataSource>)dataSource delegate:(id <LTxMenuViewDelegate>)delegate;
/**
* show menuView in viewController from a special position.
* @param viewController the menuview 's container
* @param position the menuview 's arrow direction
**/
- (void)showMenu:(UIViewController*)viewController from:(CGRect)position;
/**
* hide the menuview. usually you did not need to call this method
**/
- (void)dismissMenu;

DataSource && Delegate


#pragma mark LTxMenuViewDelegate
@protocol LTxMenuViewDelegate<NSObject>

@optional
/**
* called when a specified index was selected.
**/
-(void)didSelectRowAtIndex:(NSInteger)index;

/**
* called when a specified accessoryView was selected.
**/
-(void)didSelectAccessoryView:(UIView*)accessoryView
atIndex:(NSInteger)index;
@end

#pragma mark LTxMenuViewDataSource
@protocol LTxMenuViewDataSource<NSObject>

@required
/**
* Returns the number of rows
**/
- (NSInteger)numberOfRows;

@optional
/**
* Returns the height of specified index. default value is 50.
**/
- (CGFloat)heightForRowAtIndex:(NSInteger)index;

/**
* Returns the attributedTitle of specified index.
**/
- (NSAttributedString*)attributedTitleForRowAtIndex:(NSInteger)index;

/**
* Returns the image of specified index.
**/
- (UIImage*)imageForRowAtIndex:(NSInteger)index;

/**
* Returns the accessoryViews placed at the end of specified index.
**/
- (NSArray<UIView*>*)accessoryViewsAtIndex:(NSInteger)index;
@end;

Deployment

7.0

Licence

MIT

email

[email protected]

Latest podspec

{
    "name": "LTxMenu",
    "version": "2.0.0",
    "summary": "u7c7bu4f3cu652fu4ed8u5b9du3001u5faeu4fe1u670bu53cbu5708u3001QQu7a7au95f4u7b49u793eu4ea4u5e94u7528u4e2du7684u70b9u51fbu5217u8868u4e0bu62c9u6309u94aeuff0cu5c55u793au66f4u591au529fu80fd.",
    "description": "u7c7bu4f3cu652fu4ed8u5b9du3001u5faeu4fe1u670bu53cbu5708u3001QQu7a7au95f4u7b49u793eu4ea4u5e94u7528u4e2du7684u70b9u51fbu5217u8868u4e0bu62c9u6309u94aeuff0cu5c55u793au66f4u591au529fu80fd(u4f8bu5982u9690u85cfu3001u4e3eu62a5u3001u5206u4eabu7b49).",
    "homepage": "https://github.com/l900416/LTxMenu",
    "license": "MIT",
    "authors": {
        "liangtong": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/l900416/LTxMenu.git",
        "tag": "2.0.0"
    },
    "source_files": [
        "LTxMenu",
        "LTxMenu/**/*.{h,m}"
    ],
    "public_header_files": "LTxMenu/**/*.h",
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This