Skip to content

Swift写的一套送礼机制,可自定义样式,调用简单。设置好要展示的model数据,一行代码调用

License

Notifications You must be signed in to change notification settings

U7426/GiftComponent

Repository files navigation

GiftComponent

CI Status Version License Platform

description

Manager 使用 Map + 双向链表 数据结构管理,类似LRU缓存淘汰算法。
所有逻辑处理在 Manger中, 展示视图只需要在manager 回调时 展示、更新、隐藏,逻辑处理 和 UI 没有耦合。

Example

        ///自定义配置样式(在ShowView 初始化之前配置)
        let configuartion = Configuration.default
        configuartion.showDuration = 0.2
        ...
        
        ///创建manager
        let manager = GiftManager<Gift>() //可自定义Model,遵守GiftShowType 协议。这里以提供的默认的 Gift 为例
        manager.setupViews(views)
        
        ///将接收到的数据添加到manager
        let model = Gift() 
        model.giftID = ...
        manager.receive(value: model)
        

效果

image

Installation

GiftComponent is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'GiftComponent'

Author

U7426, u7426fenglongfei@163.com

License

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

About

Swift写的一套送礼机制,可自定义样式,调用简单。设置好要展示的model数据,一行代码调用

Resources

License

Stars

Watchers

Forks

Packages

No packages published