Ios SGActionView网格菜单

Ios SGActionView网格菜单,ios,objective-c,xcode,uialertview,uiactionsheet,Ios,Objective C,Xcode,Uialertview,Uiactionsheet,我正在开发一个应用程序,其中我正在使用我从这里下载的网格菜单。它工作正常,但我的问题是,当用户点击此网格菜单中的按钮时,我不知道如何显示nslog。例如,如果用户点击Facebook,则应记录“Facebook推送”。下面是调用grid的代码 [SGActionView showGridMenuWithTitle:@"Share" itemTitles:@[ @"Facebook", @"Twitter", @"Google+", @"L

我正在开发一个应用程序,其中我正在使用我从这里下载的网格菜单。它工作正常,但我的问题是,当用户点击此网格菜单中的按钮时,我不知道如何显示nslog。例如,如果用户点击Facebook,则应记录“Facebook推送”。下面是调用grid的代码

[SGActionView showGridMenuWithTitle:@"Share"
                             itemTitles:@[ @"Facebook", @"Twitter", @"Google+", @"Linkedin",
                                           @"Weibo", @"WeChat", @"Pocket", @"Dropbox" ]
                                 images:@[ [UIImage imageNamed:@"facebook"],
                                           [UIImage imageNamed:@"twitter"],
                                           [UIImage imageNamed:@"googleplus"],
                                           [UIImage imageNamed:@"linkedin"],
                                           [UIImage imageNamed:@"weibo"],
                                           [UIImage imageNamed:@"wechat"],
                                           [UIImage imageNamed:@"pocket"],
                                           [UIImage imageNamed:@"dropbox"]]
                         selectedHandle:nil];

请告诉我当按下此网格(facebook、Twitter或任何其他)上的按钮时如何执行操作谢谢

好的,我检查了库

方法原型是

+ (void)showGridMenuWithTitle:(NSString *)title
                   itemTitles:(NSArray *)itemTitles
                       images:(NSArray *)images
               selectedHandle:(SGMenuActionHandler)handler
并且
SGMenuActionHandler
是块类型

typedef void(^SGMenuActionHandler)(NSInteger index);
所以你可以像这样使用它

[SGActionView showGridMenuWithTitle:@"Share"
                         itemTitles:@[ @"Facebook", @"Twitter", @"Google+", @"Linkedin",
                                       @"Weibo", @"WeChat", @"Pocket", @"Dropbox" ]
                             images:@[ [UIImage imageNamed:@"facebook"],
                                       [UIImage imageNamed:@"twitter"],
                                       [UIImage imageNamed:@"googleplus"],
                                       [UIImage imageNamed:@"linkedin"],
                                       [UIImage imageNamed:@"weibo"],
                                       [UIImage imageNamed:@"wechat"],
                                       [UIImage imageNamed:@"pocket"],
                                       [UIImage imageNamed:@"dropbox"]]
                     selectedHandle:^(NSInteger index){

                         if(index == 0){
                         }
                         else if(index == 1){
                         },....

                     }];

正如我在你的原始帖子上评论的那样,我以前从未使用过这个库。这只是猜测。

好的,我查了图书馆

方法原型是

+ (void)showGridMenuWithTitle:(NSString *)title
                   itemTitles:(NSArray *)itemTitles
                       images:(NSArray *)images
               selectedHandle:(SGMenuActionHandler)handler
并且
SGMenuActionHandler
是块类型

typedef void(^SGMenuActionHandler)(NSInteger index);
所以你可以像这样使用它

[SGActionView showGridMenuWithTitle:@"Share"
                         itemTitles:@[ @"Facebook", @"Twitter", @"Google+", @"Linkedin",
                                       @"Weibo", @"WeChat", @"Pocket", @"Dropbox" ]
                             images:@[ [UIImage imageNamed:@"facebook"],
                                       [UIImage imageNamed:@"twitter"],
                                       [UIImage imageNamed:@"googleplus"],
                                       [UIImage imageNamed:@"linkedin"],
                                       [UIImage imageNamed:@"weibo"],
                                       [UIImage imageNamed:@"wechat"],
                                       [UIImage imageNamed:@"pocket"],
                                       [UIImage imageNamed:@"dropbox"]]
                     selectedHandle:^(NSInteger index){

                         if(index == 0){
                         }
                         else if(index == 1){
                         },....

                     }];

正如我在你的原始帖子上评论的那样,我以前从未使用过这个库。这只是猜测。

我写了SGActionView


SGMenuActionHandler是一个块,它给出您点击的项的索引。因此,不用猜测,特里克14的答案是正确的。

我写了SGActionView


SGMenuActionHandler是一个块,它给出您点击的项的索引。因此,不用猜测,trick14的答案是正确的。

我以前从未使用过SGActionView,但我想selectedHandle就是您想要的参数。参数必须是SEL类型。我以前从未使用过SGActionView,但我猜selectedHandle就是您想要的参数。参数必须是SEL类型。