MSTwitterSplashScreen 1.0.6

MSTwitterSplashScreen 1.0.6

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布时间最后发布2015年6月

Mateusz Szklarek 维护。



MSTwitterSplashScreen 用于 iOS 应用

Twitter: @SzklarekMateusz LinkedIn: Mateusz Szklarek 电子邮件: [email protected]

该存储库允许你达到类似于你可能已经在 Twitter 应用中看到的效果。

功能

  • 与 iOS 7, 8 和 9 兼容
  • 所有 iPhone 型号(4/4S,5/5S/5C,6/6+)上的徽标大小相同
  • 自定义背景和徽标颜色
  • 自定义动画持续时间
  • 增加了创建渐变背景的可能性

你需要的只是

  • 你徽标的贝塞尔曲线(如果你不知道如何创建它,随时告诉我)

如何使用它?

MSTwitterSplashScreen 导入 ViewController.m

<MSTwitterSplashScreen/MSTwitterSplashScreen.h>

在 interface ViewController.m 中创建属性

@property (strong, nonatomic) MSTwitterSplashScreen *splashScreen;

创建 MSTwitterSplashScreen 类的实例

MSTwitterSplashScreen *twitterSplashScreen = ...

并通过公共构造函数初始化创建的对象

你需要提供 3 个参数

bézierPath

backgroundColortopColorbottomColor 用于渐变背景

logoColor

... = [[MSTwitterSplashScreen alloc] initSplashScreenWithBezierPath:bezierPath
                                                    backgroundColor:backgroundColor
                                                          logoColor:logoColor];
... = [[MSTwitterSplashScreen alloc] initSplashScreenWithBezierPath:bezierPath
                                 backgroundWithGradientFromTopColor:topColor
                                                        bottomColor:bottomColor
                                                          logoColor:logoColor];

确定动画的持续时间

splashScreen.durationAnimation = 1.8f;

将你的 splashScreen 添加至视图作为子视图

[self.view addSubview:splashScreen];

并分配给属性

self.splashScreen = splashScreen;

viewDidAppear:(BOOL)animated 中调用 startAnimation 方法

- (void)viewDidAppear:(BOOL)animated
{
    [self.twitterSplashScreen startAnimation];
}

如何安装

您可以使用 Cocoapods 将 MSTwitterSplashScreen 集成到您的项目中。将以下行添加到您的 *.podfile 文件中。我为您推荐使用仍在开发的最新版本。

您可以使用 CocoaPods 安装库。为此,您需要在 Podfile 中添加以下行之一:

pod 'MSTwitterSplashScreen', '~> 1.0.6'

这创建了对版本 >= 1.0.6< 1.1 的依赖项

对于最新版本或确切的开发版本(在生产环境中不推荐使用)

pod 'MSTwitterSplashScreen', :git => 'https://github.com/mateuszszklarek/MSTwitterSplashScreen.git', :tag => 'v1.0.6'

灵感来源于

Pod 是我为了一个正在进行的项目所需的现有 Pod CBZSplashView 的简单修改。非常感谢 Callum Boddy 给我修改他的 Pod 的机会。

许可

MIT 许可证(MIT)- 检查包含的 LICENSE 文件