All Projects → KrauseFx → Tsmessages

KrauseFx / Tsmessages

Licence: mit
💌 Easy to use and customizable messages/notifications for iOS à la Tweetbot

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Tsmessages

Mscircularslider
A fully-featured, powerful circular slider for iOS applications
Stars: ✭ 94 (-98.09%)
Mutual labels:  library, cocoapods
Campcotcollectionview
Collapse and expand UICollectionView sections with one method call.
Stars: ✭ 161 (-96.73%)
Mutual labels:  library, cocoapods
Predicateflow
Write amazing, strong-typed and easy-to-read NSPredicate.
Stars: ✭ 98 (-98.01%)
Mutual labels:  library, cocoapods
Notifier
Notifications library made with VanillaJS.
Stars: ✭ 67 (-98.64%)
Mutual labels:  library, notifications
Ismessages
This is simple extension for presenting system-wide notifications from top/bottom of device screen.
Stars: ✭ 299 (-93.93%)
Mutual labels:  notifications, cocoapods
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (-76.05%)
Mutual labels:  library, cocoapods
Fscalendar
A fully customizable iOS calendar library, compatible with Objective-C and Swift
Stars: ✭ 9,829 (+99.49%)
Mutual labels:  library, cocoapods
Noty
⛔️ DEPRECATED - Dependency-free notification library that makes it easy to create alert - success - error - warning - information - confirmation messages as an alternative the standard alert dialog.
Stars: ✭ 6,725 (+36.49%)
Mutual labels:  library, notifications
Ftindicator
A light wight UI package contains local notification, progress HUD, toast, with blur effect, elegant API and themes support.
Stars: ✭ 292 (-94.07%)
Mutual labels:  notifications, cocoapods
Slidecontroller
Swipe between pages with an interactive title navigation control. Configure horizontal or vertical chains for unlimited pages amount.
Stars: ✭ 279 (-94.34%)
Mutual labels:  library, cocoapods
Keyboardhidemanager
Codeless manager to hide keyboard by tapping on views for iOS written in Swift
Stars: ✭ 57 (-98.84%)
Mutual labels:  library, cocoapods
Observable
The easiest way to observe values in Swift.
Stars: ✭ 346 (-92.98%)
Mutual labels:  library, cocoapods
Imageviewer.swift
An easy to use Image Viewer that is inspired by Facebook
Stars: ✭ 1,071 (-78.26%)
Mutual labels:  library, cocoapods
Notti
Dead simple user notification.
Stars: ✭ 72 (-98.54%)
Mutual labels:  library, notifications
Potato Library
Easy to use Utility library for Android
Stars: ✭ 45 (-99.09%)
Mutual labels:  library, notifications
Datepicker
A Date Picker with Calendar for iPhone and iPad Apps.
Stars: ✭ 103 (-97.91%)
Mutual labels:  library, cocoapods
Greedo Layout For Ios
Full aspect ratio grid layout for iOS
Stars: ✭ 837 (-83.01%)
Mutual labels:  library, cocoapods
Styledecorator
Easy string decoration with styles
Stars: ✭ 17 (-99.65%)
Mutual labels:  library, cocoapods
Alertift
Swifty, modern UIAlertController wrapper.
Stars: ✭ 242 (-95.09%)
Mutual labels:  library, cocoapods
Glnotificationbar
GLNotificationBar is a ios10 style notification bar, can be used to handle push notification in active state.
Stars: ✭ 306 (-93.79%)
Mutual labels:  notifications, cocoapods

Notice: TSMessages is no longer being maintained/updated. We recommend everyone migrate to RMessage.

This repository will be kept as is for those who want to continue using TSMessages or are in the process of migrating. If an issue you submitted to TSMessages still applies to RMessage feel free to create a new issue in RMessage's repository.

If your project is Swift based, you might want to check out SwiftMessages, which offers the same features, but is written completely in Swift.

TSMessages

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

Twitter: @KauseFx Version License Platform

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.

Get in contact with the developer on Twitter: KrauseFx (Felix Krause)

Installation

From CocoaPods

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

pod "TSMessages"

Manually

Copy the source files TSMessageView and TSMessage into your project. Also copy the TSMessagesDesignDefault.json.

Usage

To show notifications use the following code:

    [TSMessage showNotificationWithTitle:@"Your Title"
                                subtitle:@"A description"
                                    type:TSMessageNotificationTypeError];


    // Add a button inside the message
    [TSMessage showNotificationInViewController:self
                                          title:@"Update available"
                                       subtitle:@"Please update the app"
                                          image:nil
                                           type:TSMessageNotificationTypeMessage
                                       duration:TSMessageNotificationDurationAutomatic
                                       callback:nil
                                    buttonTitle:@"Update"
                                 buttonCallback:^{
                                     NSLog(@"User tapped the button");
                                 }
                                     atPosition:TSMessageNotificationPositionTop
                           canBeDismissedByUser:YES];


    // Use a custom design file
    [TSMessage addCustomDesignFromFileWithName:@"AlternativeDesign.json"];

You can define a default view controller in which the notifications should be displayed:

   [TSMessage setDefaultViewController:myNavController];

You can define a default view controller in which the notifications should be displayed:

   [TSMessage setDelegate:self];
   
   ...
   
   - (CGFloat)messageLocationOfMessageView:(TSMessageView *)messageView
   {
    return messageView.viewController...; // any calculation here
   }

You can customize a message view, right before it's displayed, like setting an alpha value, or adding a custom subview

   [TSMessage setDelegate:self];
   
   ...
   
   - (void)customizeMessageView:(TSMessageView *)messageView
   {
      messageView.alpha = 0.4;
      [messageView addSubview:...];
   }

You can customize message view elements using UIAppearance

#import <TSMessages/TSMessageView.h>
@implementation TSAppDelegate
....

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//If you want you can overidde some properties using UIAppearance
[[TSMessageView appearance] setTitleFont:[UIFont boldSystemFontOfSize:6]];
[[TSMessageView appearance] setTitleTextColor:[UIColor redColor]];
[[TSMessageView appearance] setContentFont:[UIFont boldSystemFontOfSize:10]];
[[TSMessageView appearance]setContentTextColor:[UIColor greenColor]];
[[TSMessageView appearance]setErrorIcon:[UIImage imageNamed:@"NotificationButtonBackground"]];
[[TSMessageView appearance]setSuccessIcon:[UIImage imageNamed:@"NotificationButtonBackground"]];
[[TSMessageView appearance]setMessageIcon:[UIImage imageNamed:@"NotificationButtonBackground"]];
[[TSMessageView appearance]setWarningIcon:[UIImage imageNamed:@"NotificationButtonBackground"]];
//End of override

return YES;
}

The following properties can be set when creating a new notification:

  • viewController: The view controller to show the notification in. This might be the navigation controller.
  • title: The title of the notification view
  • subtitle: The text that is displayed underneath the title (optional)
  • image: A custom icon image that is used instead of the default one (optional)
  • type: The notification type (Message, Warning, Error, Success)
  • duration: The duration the notification should be displayed
  • callback: The block that should be executed, when the user dismissed the message by tapping on it or swiping it to the top.

Except the title and the notification type, all of the listed values are optional

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

Screenshots

iOS 7 Design

iOS 7 Error

iOS 7 Message

iOS 6 Design

Warning

Success

Error

Message

License

TSMessages is available under the MIT license. See the LICENSE file for more information.

Recent Changes

Can be found in the releases section of this repo.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].