NYSTK(iOS炫彩弹框框架)

logo.png

ios 炫彩弹框
ios colorful alert framework

GitHub address: https://github.com/niyongsheng/NYSTK

Usage:

  • Installation with CocoaPods:pod 'NYSTK','~>0.0.6'
  • Import the main file:#import <NYSTK/NYSTK.h>


  • Manual import:Drag NYSTK folder to project
  • Import the main file:#import "NYSTK.h"

Screenshot:

nystk_demo_1.gif
nystk_demo_2.gif

APIs:

#pragma mark - Toast
/// 纯文本toast
/// @param message 提示文本
/// @param theme 主题样式
+ (void)showToastWithMessage:(NSString *)message themeModel:(NYSTKThemeModel)theme;

/// 图文toast提示
/// @param message 提示样式
/// @param imageName 提示图
/// @param theme 主题样式
+ (void)showToastWithMessage:(NSString *)message image:(NSString *)imageName themeModel:(NYSTKThemeModel)theme;

/// 炫彩弹框
/// @param message 信息
/// @param type 类型
/// @param direction 进入方向
/// @param view 作用域
/// @param theme 主题样式
+ (void)showColorfulToastWithMessage:(NSString *)message
                                type:(NYSTKColorfulToastType)type
                           direction:(NYSTKComeInDirection)direction
                              onView:(UIView *)view
                          themeModel:(NYSTKThemeModel)theme;

#pragma mark - 带block回调的签到弹窗
/// 签到弹框
/// @param signMessageText 富文本
/// @param view 作用域
/// @param type 类型
/// @param emitter 粒子样式
/// @param theme 主题样式
/// @param infoButtonClickedBlock 详情回调
/// @param closeButtonClickedBlock 关闭回调
+ (void)showSignAlertWithMessage:(NSAttributedString *)signMessageText
                          onView:(UIView *)view
                        signType:(NYSTKSignType)type
                     emitterType:(NYSTKEmitterAnimationType)emitter
                      themeModel:(NYSTKThemeModel)theme
          infoButtonClickedBlock:(void(^)(void))infoButtonClickedBlock
         closeButtonClickedBlock:(void(^)(void))closeButtonClickedBlock;

/// 网络图片弹框
/// @param imageURL 图片url
/// @param contentMode 显示方式
/// @param size 尺寸
/// @param view 作用域
/// @param emitter 粒子样式
/// @param theme 主题样式
/// @param infoButtonClickedBlock 详情回调
/// @param closeButtonClickedBlock 关闭回调
+ (void)showAlertWithImageURL:(NSURL *)imageURL
                  contentMode:(UIViewContentMode)contentMode
                         size:(CGSize)size
                       onView:(UIView *)view
                  emitterType:(NYSTKEmitterAnimationType)emitter
                   themeModel:(NYSTKThemeModel)theme
       infoButtonClickedBlock:(void(^)(void))infoButtonClickedBlock
      closeButtonClickedBlock:(void(^)(void))closeButtonClickedBlock;

/// 信息弹框
/// @param title 标题
/// @param message 信息
/// @param view 作用域
/// @param type 成功/失败/警告
/// @param colorType 颜色
/// @param emitter 粒子效果
/// @param theme 主题
/// @param infoButtonClickedBlock 详情回调
/// @param closeButtonClickedBlock 关闭回调
+ (void)showMessageWithTitle:(NSString *)title
                     message:(NSAttributedString *)message
                      onView:(UIView *)view
                    type:(NYSTKMessageType)type
                   colorType:(NYSTKMessageColorType)colorType
                 emitterType:(NYSTKEmitterAnimationType)emitter
                  themeModel:(NYSTKThemeModel)theme
      infoButtonClickedBlock:(void(^)(void))infoButtonClickedBlock
     closeButtonClickedBlock:(void(^)(void))closeButtonClickedBlock;

/// 提示弹框
/// @param title 标题
/// @param message 信息
/// @param time 时间
/// @param btnTitle 确认按钮标题
/// @param view 作用域
/// @param type 类型
/// @param emitter 粒子效果
/// @param theme 主题
/// @param infoButtonClickedBlock 详情回调
/// @param closeButtonClickedBlock 关闭回调
+ (void)showAlertWithTitle:(NSString *)title
                   message:(NSAttributedString *)message
                      time:(NSString *)time
              infoBtnTitle:(NSString *)btnTitle
                    onView:(UIView *)view
                      type:(NYSTKAlertType)type
               emitterType:(NYSTKEmitterAnimationType)emitter
                themeModel:(NYSTKThemeModel)theme
    infoButtonClickedBlock:(void(^)(void))infoButtonClickedBlock
   closeButtonClickedBlock:(void(^)(void))closeButtonClickedBlock;

Instance:

// simple toast
[NYSTKAlert showToastWithMessage:@"NYSTK toast test !" themeModel:self.tintModel];

// colorful toast
[NYSTKAlert showColorfulToastWithMessage:@"NYSTK colorful toast test ..."
                                    type:NYSTKColorfulToastTypeBlueFlower
                               direction:NYSTKComeInDirectionUp
                                  onView:[UIApplication sharedApplication].delegate.window
                              themeModel:self.tintModel];

// custom alert
[NYSTKAlert showAlertWithTitle:@"查看优惠券"
                       message:[[NSAttributedString alloc] initWithString:@"激活码:MVBCQ-B3VPW-CT369"]
                          time:@"有效期:2020-09-07"
                  infoBtnTitle:@"确定"
                        onView:self.view
                          type:NYSTKAlertTypeDefault
                   emitterType:NYSTKEmitterAnimationTypeColourbar
                    themeModel:self.tintModel
                    infoButtonClickedBlock:^{

} closeButtonClickedBlock:^{

}]; 

Remind

  • ARC
  • iOS >= 10.0
  • iPhone \ iPad screen anyway

Contact Me

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • NYSMC 自动选择加载“壳应用”/“真应用”的简单框架。Auto Choose Sheel/Applicatio...
    泥剛阅读 3,865评论 0 0
  • MVVM模式与团队合作 说到架构设计和团队协作,这个对App的开发还是比较重要的。即使作为一个专业的搬砖者,前提是...
    GitHubPorter阅读 11,665评论 9 19
  • 夜莺2517阅读 127,805评论 1 9
  • 版本:ios 1.2.1 亮点: 1.app角标可以实时更新天气温度或选择空气质量,建议处女座就不要选了,不然老想...
    我就是沉沉阅读 11,843评论 1 6
  • 我是一名过去式的高三狗,很可悲,在这三年里我没有恋爱,看着同龄的小伙伴们一对儿一对儿的,我的心不好受。怎么说呢,高...
    小娘纸阅读 8,704评论 4 7