{"id":2432,"url":"https://github.com/cruffenach/CRToast","last_synced_at":"2025-08-02T23:33:36.221Z","repository":{"id":14084842,"uuid":"16788636","full_name":"cruffenach/CRToast","owner":"cruffenach","description":"A modern iOS toast view that can fit your notification needs","archived":false,"fork":false,"pushed_at":"2024-05-02T19:59:52.000Z","size":8109,"stargazers_count":4163,"open_issues_count":68,"forks_count":464,"subscribers_count":93,"default_branch":"master","last_synced_at":"2024-10-29T11:22:54.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/cruffenach.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"publiccode":null,"codemeta":null}},"created_at":"2014-02-13T01:54:08.000Z","updated_at":"2024-10-12T12:17:24.000Z","dependencies_parsed_at":"2024-06-18T11:01:34.084Z","dependency_job_id":"44569f00-919a-41df-bade-bb271bef7a62","html_url":"https://github.com/cruffenach/CRToast","commit_stats":{"total_commits":339,"total_committers":43,"mean_commits":7.883720930232558,"dds":0.6843657817109144,"last_synced_commit":"fea2562333505d41291e2bc8262518c63a257446"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruffenach%2FCRToast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruffenach%2FCRToast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruffenach%2FCRToast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cruffenach%2FCRToast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cruffenach","download_url":"https://codeload.github.com/cruffenach/CRToast/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227251701,"owners_count":17754045,"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":[],"created_at":"2024-01-05T20:16:13.633Z","updated_at":"2024-12-06T17:31:06.570Z","avatar_url":"https://github.com/cruffenach.png","language":"Objective-C","funding_links":[],"categories":["UI","Notification","HarmonyOS","Objective-C","IOS 或 OSX"],"sub_categories":["Alert \u0026 Action Sheet","Windows Manager","Other free courses"],"readme":"# CRToast\n\n[![Build Status](https://travis-ci.org/cruffenach/CRToast.svg?branch=master)](https://travis-ci.org/cruffenach/CRToast)\n[![Pod Version](http://img.shields.io/cocoapods/v/CRToast.svg?style=flat)](http://cocoadocs.org/docsets/CRToast)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n`CRToast` is a library that allows you to easily create notifications that appear on top of or by pushing out the status bar or navigation bar. `CRToast` was originally based on [CWStatusBarNotification](https://github.com/cezarywojcik/CWStatusBarNotification).\n\n![demo](screenshots/demo.gif)\n\n## Requirements\n\n`CRToast` uses ARC and requires iOS 7.0+. Works for iPhone and iPad.\n\n## Installation\n\n### CocoaPods\n\n`pod 'CRToast', '~\u003e 0.0.7'`\n\n### Carthage\n\n`github \"cruffenach/CRToast\"`\n\n### Manual\n\nAdd the project or source files to your own project.\n\n## Usage\n\nNotifications can be created through `CRToastManager`'s `showNotificationWithOptions:completionBlock:` This will queue up a notification with the options specified. You provide options for your notification in a dictionary using the keys in `CRToast.h`\n\n#### Example\nThis code\n\n```\tobjc\nNSDictionary *options = @{\n                          kCRToastTextKey : @\"Hello World!\",\n                          kCRToastTextAlignmentKey : @(NSTextAlignmentCenter),\n                          kCRToastBackgroundColorKey : [UIColor redColor],\n                          kCRToastAnimationInTypeKey : @(CRToastAnimationTypeGravity),\n                          kCRToastAnimationOutTypeKey : @(CRToastAnimationTypeGravity),\n                          kCRToastAnimationInDirectionKey : @(CRToastAnimationDirectionLeft),\n                          kCRToastAnimationOutDirectionKey : @(CRToastAnimationDirectionRight)\n                          };\n[CRToastManager showNotificationWithOptions:options\n                            completionBlock:^{\n                                NSLog(@\"Completed\");\n                            }];\n```\n\nGenerates this\n\n![](screenshots/red_notification.gif)\n\n## Customization\n\n`CRToast` is very customizable. Taking a hint from `UIStringDrawing`'s `drawInRect:withAttributes:` book, notifications are created with dictionaries filled with all their options.\n\n### Customizing Appearance\n\n`CRToast` allows for setting of\n\n- Left aligned image\n\nTitle and Subtitle text with:\n\n- Text Color\n- Text Font\n- Text Alignment\n- Text Color\n- Text Shadow Color\n- Text Shadow Offset\n- Text Max Number of Lines\n\n### Customizing Animation\n\n`CRToast` also allows for animation customization. This includes.\n\n- Animation Type (Linear, Spring or Gravity)\n- Animation Physics Coefficients (Spring Damping, Spring Initial Velocity, Gravity Magnitude)\n- Presentation Type (Slide over bars or push content out)\n- Status visibility (Status bar on top or below)\n- Direction (Enter and exit in any direction)\n- Enter, Stay on Screen and Exit Timing\n\n### Touch Interactions\n\n`CRToast` allows for any notification to respond to different types of touch interactions (tap, swipe). Interaction responders can be set as defaults or on a per notification basis.\nThe types of interactions you can set up to respond to are:\n\n```Obj-C\nCRToastInteractionTypeSwipeUp\nCRToastInteractionTypeSwipeLeft\nCRToastInteractionTypeSwipeDown\nCRToastInteractionTypeSwipeRight\nCRToastInteractionTypeTapOnce\nCRToastInteractionTypeTapTwice\nCRToastInteractionTypeTwoFingerTapOnce\nCRToastInteractionTypeTwoFingerTapTwice\n```\n\nThere are also wild card interaction types which cover a range of interactions\n\n```Obj-C\nCRToastInteractionTypeSwipe\nCRToastInteractionTypeTap\nCRToastInteractionTypeAll\n```\n\nAny interaction can be responded to using a `CRToastInteractionResponder`, they can be made with the following constructor\n\n```\n+ (instancetype)interactionResponderWithInteractionType:(CRToastInteractionType)interactionType\n                                   automaticallyDismiss:(BOOL)automaticallyDismiss\n                                                  block:(void (^)(CRToastInteractionType interactionType))block;\n```\n\nYou can set a collection of `CRToastInteractionResponder`s as the object for the key `kCRToastInteractionRespondersKey` in defaults to have all notifications respond to a certain interaction, or on any given one to have the interaction responders just work for that one notification.\n\n### Persistent and Programmatically Dismissed Notifications\n\nYou can also dismiss the current notification at any time with\n\n```\n+ (void)dismissNotification:(BOOL)animated;\n```\n\nYou can present notifications that must be dismissed by the user by passing `@(DBL_MAX)` for `kCRToastTimeIntervalKey` and setting up an interaction responder that will dismiss the notification.\n\n### Setting Defaults\n\nThere are sane defaults set for all properties, however you can set a default set of options for your application's notifications using `CRToastManagers`'s `setDefaultOptions:`.\n\n## License\n\n    The MIT License (MIT)\n\n    Copyright (c) 2013 Collin Ruffenach\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy\n    of this software and associated documentation files (the \"Software\"), to deal\n    in the Software without restriction, including without limitation the rights\n    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n    copies of the Software, and to permit persons to whom the Software is\n    furnished to do so, subject to the following conditions:\n\n    The above copyright notice and this permission notice shall be included in\n    all copies or substantial portions of the Software.\n\n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n    THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcruffenach%2FCRToast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcruffenach%2FCRToast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcruffenach%2FCRToast/lists"}