{"id":19593688,"url":"https://github.com/c-viorel/mbtoastmac","last_synced_at":"2025-04-27T15:33:07.795Z","repository":{"id":199124347,"uuid":"702004553","full_name":"c-Viorel/MBToastMac","owner":"c-Viorel","description":"MBToastMac: Toasts for macOS. Crafted in Swift.","archived":false,"fork":false,"pushed_at":"2023-10-15T17:07:54.000Z","size":15931,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T08:02:12.622Z","etag":null,"topics":["macos","swift"],"latest_commit_sha":null,"homepage":"http://viorelporumbescu.tech","language":"Swift","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/c-Viorel.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,"publiccode":null,"codemeta":null}},"created_at":"2023-10-08T08:04:44.000Z","updated_at":"2025-02-06T13:10:37.000Z","dependencies_parsed_at":"2024-11-11T08:42:09.400Z","dependency_job_id":"65be9540-ebfe-4a12-b4ca-e2ed726d4182","html_url":"https://github.com/c-Viorel/MBToastMac","commit_stats":null,"previous_names":["c-viorel/mbtoast","c-viorel/mbtoastmac"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-Viorel%2FMBToastMac","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-Viorel%2FMBToastMac/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-Viorel%2FMBToastMac/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-Viorel%2FMBToastMac/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c-Viorel","download_url":"https://codeload.github.com/c-Viorel/MBToastMac/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251162400,"owners_count":21545766,"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":["macos","swift"],"created_at":"2024-11-11T08:40:44.708Z","updated_at":"2025-04-27T15:33:02.774Z","avatar_url":"https://github.com/c-Viorel.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MBToastMac\n\n[![Version](https://img.shields.io/cocoapods/v/MBToastMac.svg?style=flat)](https://cocoapods.org/pods/MBToastMac)\n[![License](https://img.shields.io/cocoapods/l/MBToastMac.svg?style=flat)](https://cocoapods.org/pods/MBToastMac)\n[![Platform](https://img.shields.io/cocoapods/p/MBToastMac.svg?style=flat)](https://cocoapods.org/pods/MBToastMac)\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/c-Viorel/MBToastMac/blob/main/Example/toast_icon.png?raw=true\" alt=\"Toast Icon\"\u003e\n\u003c/p\u003e\n\n\n## MBToastMac: Toasts for macOS. Crafted in Swift.\n\n  In the world of macOS development, clarity and brevity are often the keys to effective user interaction. MBToast was forged with this philosophy in mind.\n\n  We understand that every interaction, no matter how brief, is a touchpoint between the user and the software. It’s a chance to inform, to guide, to reassure. That’s why we developed a toast system that's not just about fleeting messages but about enriching those small moments of communication.\n\n  Why choose MBToast?\n\n  Simplicity: Our library integrates seamlessly into your macOS projects, allowing you to implement toasts without the weight of unnecessary features.\n\n  Efficiency: Built with Swift, it's optimized for performance, ensuring your app remains agile and responsive.\n\n  Customizability: While we value minimalism, we also understand the importance of adaptability. Customize to fit your application's aesthetics, ensuring consistency in design.\n\n  Reliability: Every toast delivered is a result of rigorous testing and refinement, ensuring reliability in varied use-cases.\n\n  Dive into MBToast – where minimalism meets function. Elevate your user feedback and make every message count.\n  \n  ![Toast Eaxample](https://github.com/c-Viorel/MBToastMac/blob/main/Example/MBToast_description.gif?raw=true)\n\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n\n## Basic Usage\n\n### 1. Displaying a Custom Toast Message\nTo show a basic toast message with a custom style:\n\n```swift\nself.view.makeToast(\"Your Message Here\")\n\n```\n## 2. Displaying Predefined Toast Styles\n- Success Toast\n```\nself.view.makeToast(\"Your Message Here\", style: MBToastStyleSuccess())\n``` \n- Warning Toast\n```swift\nself.view.makeToast(\"Your Message Here\", style: MBToastStyleWarning())\n```\n- Info Toast \n```swift\nself.view.makeToast(\"Your Message Here\", style: MBToastStyleInfo())\n```\n\n## 3. Displaying Progress Toast\nUtilize the overlay progress indicator for instances where the duration is indeterminate. This feature ensures users are informed during periods of background activity or while awaiting a response.\n- Start Progress\n```swift\nself.view.makeToastActivity()\n``` \n\n- Stop Progress\n```swift\nself.view.hideToastActivity()\n``` \n\n## Customization\n\nYou have the ability to fully customize the appearance and behavior of the toast notifications by conforming to the `Style` protocol. This protocol provides a wide range of properties to adjust, such as font size, margin adjustments, color specifications, and more. By conforming to this protocol, you can tailor the toast appearance to better fit your application's theme and design philosophy.\n\n### `Style` Protocol Properties:\n\n| Property               | Description                                        |\n|------------------------|----------------------------------------------------|\n| **fontSize**               | Font size of the message.                          |\n| **horizontalMargin**       | Horizontal margin for the toast.                   |\n| **verticalMargin**         | Vertical margin for the toast.                     |\n| **cornerRadius**           | Corner radius of the toast.                        |\n| **font**                   | Font of the message.                               |\n| **backgroundColor**        | Background color of the toast.                     |\n| **foregroundColor**        | Text color of the message.                         |\n| **fadeInOutDuration**      | Duration of the fade in/out animations.            |\n| **fadeInOutDelay**         | Delay before the fade out begins.                  |\n| **labelOriginWithMargin**  | Origin point of the message label with margins.    |\n| **activitySize**           | Size of the progress indicator.                    |\n| **position**               | Position of the toast on the screen.               |\n| **icon**                   | Optional icon image. Default is nil.               |\n\n### Custom Style Example:\n\nTo create your custom style, you can implement the `Style` protocol like the following:\n\n```swift\nstruct CustomToastStyle: Style {\n    var fontSize: CGFloat = 14.0\n    var fontSize: CGFloat = 14.0\n    var horizontalMargin: CGFloat = 15.0\n    var verticalMargin: CGFloat = 10.0\n    var cornerRadius: CGFloat = 5.0\n    var font: NSFont = NSFont.systemFont(ofSize: 14.0)\n    var backgroundColor: NSColor = NSColor.black.withAlphaComponent(0.7)\n    var foregroundColor: NSColor = NSColor.white\n    var fadeInOutDuration: CGFloat = 0.3\n    var fadeInOutDelay: CGFloat = 2.0\n    var labelOriginWithMargin: CGPoint = CGPoint(x: 15.0, y: 10.0)\n    var activitySize: CGSize = CGSize(width: 50, height: 50)\n    var position: MBToastPosition = .bottom\n    var icon: NSImage? = nil\n    var iconTint: NSColor = NSColor.white\n}\n```\n\n\n```swift\n// Usage:\nself.view.makeToast(\"Custom styled toast\", style: CustomToastStyle())\n```\n\n\n## Installation\n\nMBToast is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'MBToastMac'\n```\n\nYou may also opt to download the project and integrate the MBToastMac directory into your existing project for a more streamlined approach.\n\n## Author\n\n**Viorel Porumbescu**  \n📧 [viorelporumbescu@outlook.com](mailto:viorelporumbescu@outlook.com)  \n📄 [Resume](https://resume.viorelporumbescu.tech/)\n\n## License\n\nMBToast is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-viorel%2Fmbtoastmac","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc-viorel%2Fmbtoastmac","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-viorel%2Fmbtoastmac/lists"}