{"id":15036047,"url":"https://github.com/krausefx/tsmessages","last_synced_at":"2025-05-14T12:11:35.540Z","repository":{"id":8012793,"uuid":"9421282","full_name":"KrauseFx/TSMessages","owner":"KrauseFx","description":"💌 Easy to use and customizable messages/notifications for iOS à la Tweetbot","archived":false,"fork":false,"pushed_at":"2023-06-01T11:22:32.000Z","size":942,"stargazers_count":4870,"open_issues_count":95,"forks_count":720,"subscribers_count":155,"default_branch":"master","last_synced_at":"2025-05-12T04:01:54.537Z","etag":null,"topics":["cocoapods","ios","library","notifications","objective-c","tsmessages"],"latest_commit_sha":null,"homepage":"http://krausefx.com","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KrauseFx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2013-04-13T22:48:19.000Z","updated_at":"2025-05-06T00:50:17.000Z","dependencies_parsed_at":"2024-04-18T12:51:29.187Z","dependency_job_id":"2b7a8c87-54d9-4692-bd6f-e5a7e259fc34","html_url":"https://github.com/KrauseFx/TSMessages","commit_stats":{"total_commits":195,"total_committers":50,"mean_commits":3.9,"dds":0.6512820512820513,"last_synced_commit":"e4802d290362c87ba8a35c1afae88668dba8ab9a"},"previous_names":["toursprung/tsmessages"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrauseFx%2FTSMessages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrauseFx%2FTSMessages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrauseFx%2FTSMessages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KrauseFx%2FTSMessages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KrauseFx","download_url":"https://codeload.github.com/KrauseFx/TSMessages/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254140768,"owners_count":22021220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoapods","ios","library","notifications","objective-c","tsmessages"],"created_at":"2024-09-24T20:29:59.581Z","updated_at":"2025-05-14T12:11:30.530Z","avatar_url":"https://github.com/KrauseFx.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Notice: TSMessages is no longer being maintained/updated. We recommend everyone migrate to [RMessage](https://github.com/donileo/RMessage).**\n\n**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.**\n\n**If your project is Swift based, you might want to check out [SwiftMessages](https://github.com/SwiftKickMobile/SwiftMessages), which offers the same features, but is written completely in Swift.**\n\nTSMessages\n==========\n\nThis library provides an easy to use class to show little notification views on the top of the screen. (à la Tweetbot).\n\n[![Twitter: @KauseFx](https://img.shields.io/badge/contact-@KrauseFx-blue.svg?style=flat)](https://twitter.com/KrauseFx)\n[![Version](https://img.shields.io/cocoapods/v/TSMessages.svg?style=flat)](http://cocoadocs.org/docsets/TSMessages)\n[![License](https://img.shields.io/cocoapods/l/TSMessages.svg?style=flat)](http://cocoadocs.org/docsets/TSMessages)\n[![Platform](https://img.shields.io/cocoapods/p/TSMessages.svg?style=flat)](http://cocoadocs.org/docsets/TSMessages)\n\nThe 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.\n\nThere are 4 different types already set up for you: Success, Error, Warning, Message (take a look at the screenshots)\n\nIt 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.\n\n**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.\n\nGet in contact with the developer on Twitter: [KrauseFx](https://twitter.com/KrauseFx) (Felix Krause)\n\n# Screenshots\n\n\u003ctable\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003cimg src=\"screenshots/TSMessages0.png\" /\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"screenshots/TSMessages1.png\" /\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003cimg src=\"screenshots/TSMessages2.png\" /\u003e\u003c/td\u003e\u003ctd\u003e\u003cimg src=\"screenshots/TSMessages3.png\" /\u003e\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003e\u003cimg src=\"screenshots/TSMessages4.png\" /\u003e\u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n# Installation\n\n## From CocoaPods\nTSMessages is available through [CocoaPods](https://cocoapods.org/). To install\nit, simply add the following line to your Podfile:\n\n    pod \"TSMessages\"\n    \n## Manually\nCopy the source files TSMessageView and TSMessage into your project. Also copy the TSMessagesDesignDefault.json.\n\n# Usage\n\nTo show notifications use the following code:\n\n```objective-c\n    [TSMessage showNotificationWithTitle:@\"Your Title\"\n                                subtitle:@\"A description\"\n                                    type:TSMessageNotificationTypeError];\n\n\n    // Add a button inside the message\n    [TSMessage showNotificationInViewController:self\n                                          title:@\"Update available\"\n                                       subtitle:@\"Please update the app\"\n                                          image:nil\n                                           type:TSMessageNotificationTypeMessage\n                                       duration:TSMessageNotificationDurationAutomatic\n                                       callback:nil\n                                    buttonTitle:@\"Update\"\n                                 buttonCallback:^{\n                                     NSLog(@\"User tapped the button\");\n                                 }\n                                     atPosition:TSMessageNotificationPositionTop\n                           canBeDismissedByUser:YES];\n\n\n    // Use a custom design file\n    [TSMessage addCustomDesignFromFileWithName:@\"AlternativeDesign.json\"];\n```\n\nYou can define a default view controller in which the notifications should be displayed:\n```objective-c\n   [TSMessage setDefaultViewController:myNavController];\n```\n\nYou can define a default view controller in which the notifications should be displayed:\n```objective-c\n   [TSMessage setDelegate:self];\n   \n   ...\n   \n   - (CGFloat)messageLocationOfMessageView:(TSMessageView *)messageView\n   {\n    return messageView.viewController...; // any calculation here\n   }\n```\n\nYou can customize a message view, right before it's displayed, like setting an alpha value, or adding a custom subview\n```objective-c\n   [TSMessage setDelegate:self];\n   \n   ...\n   \n   - (void)customizeMessageView:(TSMessageView *)messageView\n   {\n      messageView.alpha = 0.4;\n      [messageView addSubview:...];\n   }\n```\n\nYou can customize message view elements using UIAppearance\n```objective-c\n#import \u003cTSMessages/TSMessageView.h\u003e\n@implementation TSAppDelegate\n....\n\n- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n{\n//If you want you can overidde some properties using UIAppearance\n[[TSMessageView appearance] setTitleFont:[UIFont boldSystemFontOfSize:6]];\n[[TSMessageView appearance] setTitleTextColor:[UIColor redColor]];\n[[TSMessageView appearance] setContentFont:[UIFont boldSystemFontOfSize:10]];\n[[TSMessageView appearance]setContentTextColor:[UIColor greenColor]];\n[[TSMessageView appearance]setErrorIcon:[UIImage imageNamed:@\"NotificationButtonBackground\"]];\n[[TSMessageView appearance]setSuccessIcon:[UIImage imageNamed:@\"NotificationButtonBackground\"]];\n[[TSMessageView appearance]setMessageIcon:[UIImage imageNamed:@\"NotificationButtonBackground\"]];\n[[TSMessageView appearance]setWarningIcon:[UIImage imageNamed:@\"NotificationButtonBackground\"]];\n//End of override\n\nreturn YES;\n}\n```\n\n\n\nThe following properties can be set when creating a new notification:\n\n* **viewController**: The view controller to show the notification in. This might be the navigation controller.\n* **title**: The title of the notification view\n* **subtitle**: The text that is displayed underneath the title (optional)\n* **image**: A custom icon image that is used instead of the default one (optional)\n* **type**: The notification type (Message, Warning, Error, Success)\n* **duration**: The duration the notification should be displayed\n* **callback**: The block that should be executed, when the user dismissed the message by tapping on it or swiping it to the top.\n\nExcept the title and the notification type, all of the listed values are optional\n\nIf 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. \n\n# License\nTSMessages is available under the MIT license. See the LICENSE file for more information.\n\n# Recent Changes\nCan be found in the [releases section](https://github.com/KrauseFx/TSMessages/releases) of this repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrausefx%2Ftsmessages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrausefx%2Ftsmessages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrausefx%2Ftsmessages/lists"}