Giter Site home page Giter Site logo

sfeventview's Introduction

这是啥?

一个上下两栏的事件面板

解决了啥

有些时候想定义一个类似UIActiveityController的面板,或者用于分享,或者用于其他事件,但好像没有合适的,这个时候你恰巧看到咱这个库,你就不用自己写了,代码简单易懂,下来看看,你看不了吃亏,看不了上当。

有啥特点?

  • 两步集成
  • 可以无限添加Item

没图你说啥

那么,怎样用?

- (void)onClick:(id)onClick
{
  [self.eventView showInView:self.view];
}

- (SFEventView *)eventView
{
  if(!_eventView)
  {

    NSMutableArray *arr = [@[] mutableCopy];
    NSMutableArray *bottomArray = [@[] mutableCopy];

    NSArray *titles = @[@"微信好友", @"微信朋友圈", @"印象笔记", @"QQ", @"Pocket", @"复制链接", @"新浪微博", @"有道云笔记"];

    for(int i = 5; i < 20; i++)
    {
      NSString *imgName = [NSString stringWithFormat:@"sns_icon_%d", i+1];
      UIImage *img = [UIImage imageNamed:imgName];
      NSString *title = titles[arc4random_uniform(titles.count)];

      SFEventItemActionBlock action = ^(SFEventItem *item)
      {
        NSLog(@"%@", item.text);
      };

      SFEventItem *item = [[SFEventItem alloc] initWithText:title
                                                       type:@"test"
                                                       image:img
                                                      action:action];



      [arr addObject:item];
    }

    for(int i = 0; i < 1; i++)
    {
      NSString *imgName = [NSString stringWithFormat:@"sns_icon_%d", i+20];
      UIImage *img = [UIImage imageNamed:imgName];

      SFEventItem *item = [[SFEventItem alloc] initWithText:@"weixin"
                                                       type:@"weixin"
                                                       image:img
                                                      action:nil];
      [bottomArray addObject:item];
    }

    _eventView = [[SFEventView alloc] initWithTitle:@"分享问题"
                                           topItems:arr
                                        bottomItems:bottomArray];
  }
  return _eventView;
}

有没有Pods?

pod search SFEventView pod SFEventView 你懂得。

未来有啥计划?

  • 支持动态添加Item
  • 做成可配置的,想要几行就几行

联系我?

mail: [email protected]
wechat: kernel32

sfeventview's People

Contributors

shiweifu avatar

Watchers

 avatar

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.