[IOS]消息提醒--TSMessages


github:https://github.com/toursprung/TSMessages



TSMessages

This framework provides an easy to use class to show little notification views on the top of the screen. (à la Tweetbot).

The notification moves from the top of the screen underneath the navigation bar and stays there for a few seconds, depending on the length of the displayed text. To dismiss a notification before the time runs out, the user can swipe it to the top or just tap it.

There are 4 different types already set up for you: Success, Error, Warning, Message (take a look at the screenshots)

It is very easy to add new notification types with a different design. Add the new type to the notificationType enum, add the needed design properties to the configuration file and set the name of the theme (used in the config file and images) in TSMessagesView.m inside the switch case.

Take a look at the Example project to see how to use this library. You have to open the workspace, not the project file, since the Example project uses cocoapods.

Currently installation can just be done by dragging in all folders besides the example project. In the future we'll provide a regular cocoapod for easier integration.

To show notifications use the following code:

    [TSMessage showNotificationInViewController:self
                                      withTitle:notificationTitle
                                    withMessage:notificationDescription
                                       withType:kNotificationError];

You don't need to do anything with TSMessageView, except you want to modify the behavior or the types of the notification itself.

If you don't want a detailed description (text underneath the title) you don't need to set one. The notification will automatically resize itself properly. There are different initializer available.

WarningSuccessErrorMessage

This project requires ARC.

If you have ideas how to improve this library please let me know or send a pull request.

TODOs

  • Update width when screen orientation changes while notification is being displayed

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值