KDIntroView - swift 动态介绍视图框架及演示

网友投稿 649 2022-10-25

KDIntroView - swift 动态介绍视图框架及演示

KDIntroView - swift 动态介绍视图框架及演示

KDIntroView

Installation

To install it, simply add the following line to your Podfile:

pod 'KDIntroView'

or drag these files into the project

KDIntroView.swiftKDIntroViewController.swift

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 8.0

Introduction

KDIntroView is a framework to create dynamic onboarding views(onboarding flows) for your iOS App. You can create all sorts of cool animations.

Start!!!

Step One

Create all the views you need as xibs. Link each xib file with a class that inherits KDIntroView. Override moveEverythingAccordingToIndex(index: CGFloat).

Design your interface as you wish. This framework works for both code generated UI and autolayout.

Make sure each view has a clear background color if you wish to perform color change.

Step Two

Create a ViewController that inherits KDIntroViewController. (don't forget to import KDIntroView)

In viewDidAppear, call setup, and pass in an array that contains the name of all the xibs you created. Arrange them in the order you with them to appear. Override moveEverythingAccordingToIndex(index: CGFloat).

Now, you can see your views, but they are static.

Step Three

Implement the moveEverythingAccordingToIndex(index: CGFloat) in each view. The index: CGFloat variable is the offset of the scroller. In the first and the last view, index: CGFloat range from 0 ~ frame.width. In all the other views, index: CGFloat range from 0 ~ 2 * frame.width.

We have build-in functions, but you can easily customize your animation with CGAffineTransformation. There are more example in the demo project.

Also implement the moveEverythingAccordingToIndex(index: CGFloat) in viewcontroller to perform color animation and touchable elements. All the touchable elements must be added in the view controller and call view.bringSubviewToFront() after setup to make them reachable.

You can literally create any kind of animation! Play around with it, and free your imagination!

Author

Kedan Li, TakefiveInteractive.com

License

KDIntroView is available under the MIT license. See the LICENSE file for more info.

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:从零开始学 MySQL -- 数据库和数据表操作
下一篇:impress.js:基于CSS3的Web幻灯片展示框架
相关文章

 发表评论

暂时没有评论,来抢沙发吧~