Latest 1.0.0
Homepage https://github.com/xxg90s/XXGravityBall
License MIT
Platforms ios 7.0, requires ARC
Frameworks UIKit, Foundation, CoreMotion
Authors

通过UIDynamicCoreMotion实现mobike我的贴纸动画效果

Image

如何使用:

Pod支持 pod 'XXGravityBall', '~> 1.0.0'

初始化View并自行设置背景和手势支持

    //初始化View
    self.displayView = [[XXGravityBallDisplayView alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height*0.6, self.view.bounds.size.width, self.view.bounds.size.height*0.4)];
    //设置背景,自行选择
    [self.displayView setBgImage:[UIImage imageNamed:@"skyBg.jpg"]];
    //设置手势,自行选择
    self.displayView.enableClick = YES;
    [self.view addSubview:self.displayView];

    __weak typeof(self) weakSelf = self;
    self.displayView.didClickBallBlock = ^(XXGravityBallItem *item) {
        [weakSelf didClickBall:item];
    };

如果需要更多的信息,可以在XXGravityBallItem对象中添加,通过Model控制View。

小球尺寸默认为40,如果想要更改,在这里#define GBBALLWIDTH 40.

文章博客地址:http://www.jianshu.com/p/cbe29b157e1d 欢迎提问与关注!

Latest podspec

{
    "name": "XXGravityBall",
    "version": "1.0.0",
    "license": "MIT",
    "summary": "u901au8fc7UIDynamicu4e0eCoreMotionu5b9eu73b0mobikeu6211u7684u8d34u7eb8u52a8u753bu6548u679c",
    "homepage": "https://github.com/xxg90s/XXGravityBall",
    "source": {
        "git": "https://github.com/xxg90s/XXGravityBall.git",
        "tag": "1.0.0"
    },
    "source_files": "XXGravityBall/XXGravityBall/XXGravityBall/*.{h,m}",
    "requires_arc": true,
    "platforms": {
        "ios": "7.0"
    },
    "frameworks": [
        "UIKit",
        "Foundation",
        "CoreMotion"
    ],
    "authors": {
        "xxg90s": "[email protected]"
    },
    "social_media_url": "https://github.com/xxg90s"
}

Pin It on Pinterest

Share This