{"id":18270710,"url":"https://github.com/tciuro/NoticeView","last_synced_at":"2025-04-05T01:30:48.168Z","repository":{"id":62449109,"uuid":"4351782","full_name":"tciuro/NoticeView","owner":"tciuro","description":"A TweetBot-like notice component for iOS.","archived":false,"fork":false,"pushed_at":"2015-05-08T15:02:40.000Z","size":1730,"stargazers_count":817,"open_issues_count":13,"forks_count":142,"subscribers_count":58,"default_branch":"master","last_synced_at":"2025-03-03T20:16:41.352Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tciuro.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}},"created_at":"2012-05-16T20:59:55.000Z","updated_at":"2024-12-18T11:57:25.000Z","dependencies_parsed_at":"2022-11-01T23:33:34.199Z","dependency_job_id":null,"html_url":"https://github.com/tciuro/NoticeView","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tciuro%2FNoticeView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tciuro%2FNoticeView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tciuro%2FNoticeView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tciuro%2FNoticeView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tciuro","download_url":"https://codeload.github.com/tciuro/NoticeView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276043,"owners_count":20912286,"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-11-05T11:38:49.307Z","updated_at":"2025-04-05T01:30:47.056Z","avatar_url":"https://github.com/tciuro.png","language":"Objective-C","readme":"## NoticeView\n\nA TweetBot-like notice component for iOS.\n\n\u003cbr/\u003e\n![Alt text](http://cloud.github.com/downloads/tciuro/NoticeView/screenshot_2.0.1.png)\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## Usage\n\n* Drop the WBNoticeView folder in your project\n* Add QuartzCore.framework to your project\n\n### New in 3.0: Cleaner API, easier customization and more\n\nFirst and foremost, please note that in v3.0 the API has changed. Instead of deprecating and complicating the API, it was decided to replace some of the methods. NoticeView is a tiny library, so the impact should be minimal and the code easy to adapt.\r\n\r\nWhy the change? Prior to v3.0, it was fairly difficult to customize the look and feel given the current structure of the notice classes. This version simplifies that task, improves accessibility, and enhances the utility of the tap to dismiss functionality.\r\n\r\nHere is the brief of the changes introduced in v3.0:\r\n\r\n- Adds a .podspec file to the repository.\r\n- Updated the internals of WBNoticeView to set up accessibility labels and attributes for the notice. These changes make it easy to target the notice views inside of tests while performing functional testing (e.g. KIF https://github.com/square/KIF).\r\n- It's now easier to customize NoticeView.\r\n- Tap to dismiss behaviors are much more flexible. It's possible to determine if a notice was dismissed interactively in the dismissal block, allowing for Growl style notifications that can be responded to on tap or automatically dismissed. Notices can also be optionally dismissed via tap before the display duration has expired.\n\nAcknowledgments: big thanks to @blakewatters for taking the time to refactor, document and cleanup the code.\n\n### New in 2.4: Specify a completion block when a notice is dismissed\n\nStarting with 2.4, any notice can have a completion block associated with it. This block will be invoked when the notice has been dismissed (works on sticky and non-sticky notices):\n\n    WBErrorNoticeView *notice = [WBErrorNoticeView errorNoticeInView:self.view title:NSLocalizedString(@\"Signup Error\", nil) message:NSLocalizedString(@\"You need to fill out all entries in this screen to signup.\", nil)];\n    notice.sticky = YES;\n    notice.dismissedBlock = ^{\n        NSLog(@\"The notice has been dismissed!\");\n    };\n    \n### New in 2.3.1: Dismissing a Notice Manually\n\nStarting with 2.3.1, any notice with the 'sticky' property set can be dismissed at will. This could happen for example when an specific event is detected. Just invoke 'dismissNotice' on the notice whenever you're ready to dismiss it:\n\n    [myNotice dismissNotice];\n    \nCheck the demo project to see it in action.\n\n### New in 2.3: Make any Notice Sticky\n\nSome users have asked whether 'sticky' could be a property of any notice view. Well, I'm happy to report that starting with version 2.3, all notice types can be made sticky. The usage follows the regular pattern, only this time we set the 'sticky' property accordingly:\n\n    WBErrorNoticeView *notice = [WBErrorNoticeView errorNoticeInView:self.view title:@\"Network Error\" message:@\"Check your network connection.\"];\n    notice.sticky = YES;\n    [notice show];\n    \n### New in 2.1: Sticky Notice\n\nNew in 2.1 is a different type of notice: Sticky. As it name implies, the notice will remain visible until the user taps on it to dismiss it. The usage follows the Error and Success notice pattern:\n\n    WBStickyNoticeView *notice = [WBStickyNoticeView stickyNoticeInView:self.view title:@\"7 New Tweets.\"];\n    [notice show];\n    \n### NoticeView 1.0 vs 2.0\n\nThe behavior in version 1 was \"fire and forget\". Calling *showErrorNoticeInView* or *showSuccessNoticeInView* displayed the notice, but there was no way to retain it for later use. Version 2 allows the developer to instantiate a notice, customize it (optional) and show it. Not only it's possible to retain it, but also customize it anytime with say, a different title and message. Oh, yeah… and it's cleaner too.\n\n### Examples\n\nSince version 2 is more flexible, I have eliminated the older examples and replaced them with the new API. Please note that the older API is still there, for backward compatibility.\n\u003cbr/\u003e\n\nTo display a small error notice:\n\n    WBErrorNoticeView *notice = [WBErrorNoticeView errorNoticeInView:self.view title:@\"Network Error\" message:@\"Check your network connection.\"];\n    [notice show];\n\t\nIf the message provided doesn't fit in one line, the notice will be enlarged to accommodate the text:\n\n    WBErrorNoticeView *notice = [WBErrorNoticeView errorNoticeInView:self.view title:@\"Network Error\" message:@\"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.\"];\n    [notice show];\n\nTo display a small success notice:\n\n    WBSuccessNoticeView *notice = [WBSuccessNoticeView successNoticeInView:self.view title:@\"Link Saved Successfully\"];\n    [notice show];\n\n### Customizing the Notice\n\nInstead of piling up a bunch of arguments in a method call, I decided to use properties instead. This way, new properties can be added easily without having to clutter the API with specialized methods.\n\nExample: customize a success notice with a bit of transparency and placing the notice at a specific Y coordinate:\n\n    WBSuccessNoticeView *notice = [WBSuccessNoticeView successNoticeInView:self.view title:@\"Link Saved Successfully\"];\n    \n    notice.alpha = 0.8;\n    notice.originY = self.headerView.frame.size.height;\n    \n    [notice show];\n\n\t\n## Notes\n\n\u003e If you pass nil instead of a valid UIView, an NSInvalidArgumentException exception will be raised.\n\nThe default values are the following:\n\n        if (nil == title) title = @\"Unknown Error\";\n        if (nil == message) message = @\"Information not provided.\";\n        if (0.0 == duration) duration = 0.5;\n        if (0.0 == delay) delay = 2.0;\n        if (0.0 == alpha) alpha = 1.0;\n\t\tif (origin \u003c 0.0) origin = 0.0;\n\t\t\n## NoticeView SLOCCount Stats\n\nWho doesn't like stats? ;-) Here are some as reported by SLOCCount:\n\n    SLOC\tDirectory\t\t\t\tSLOC-by-Language (Sorted)\n\t797     NoticeView      \t\tobjc=797\n\t245     NoticeViewiPad  \t\tobjc=245\n\t0       NoticeView.xcode\t\tproj (none)\n\t0       top_dir         \t\t(none)\n\n\tTotals grouped by language (dominant language first):\n\n\tobjc:          1042 (100.00%)\n\n\tTotal Physical Source Lines of Code (SLOC)                = 1,042\n\tDevelopment Effort Estimate, Person-Years (Person-Months) = 0.21 (2.51) (*)\n\tSchedule Estimate, Years (Months)                         = 0.30 (3.54) (**)\n\tEstimated Average Number of Developers (Effort/Schedule)  = 0.71\n\tTotal Estimated Cost to Develop                           = $ 50,119 (***)\n\n\t(*)   Basic COCOMO model, Person-Months = 2.4 * (KSLOC**1.05)\n\t(**)  Basic COCOMO model, Months = 2.5 * (person-months**0.38)\n\t(***) Average salary = $100,000/year, overhead = 2.40\n\nSLOCCount, Copyright (C) 2001-2004 David A. Wheeler\n\u003cbr/\u003ehttp://www.dwheeler.com/sloccount/\n\nLatest salary information\n\u003cbr/\u003ehttp://www.indeed.com/salary/Software-Engineer.html\n\n## Contribute\n\nI'd love to include your contributions. Feel free to improve it, send comments or suggestions. If you have improvements please [send me a pull request](https://github.com/tciuro/NoticeView/pull/new/master).\n\n## Contact Me\n\nYou can ping me on Twitter — [@titusmagnus](http://twitter.com/titusmagnus).","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftciuro%2FNoticeView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftciuro%2FNoticeView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftciuro%2FNoticeView/lists"}