{"id":16209827,"url":"https://github.com/joshdholtz/notables-swift","last_synced_at":"2025-03-19T08:31:07.631Z","repository":{"id":141821732,"uuid":"46366616","full_name":"joshdholtz/Notables-Swift","owner":"joshdholtz","description":"Protocol extensions for common NSNotifications for the lazy (me)","archived":false,"fork":false,"pushed_at":"2015-11-18T04:01:29.000Z","size":26,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T16:59:20.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/joshdholtz.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":"2015-11-17T18:24:49.000Z","updated_at":"2023-06-04T05:37:13.000Z","dependencies_parsed_at":"2023-03-13T18:38:36.107Z","dependency_job_id":null,"html_url":"https://github.com/joshdholtz/Notables-Swift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2FNotables-Swift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2FNotables-Swift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2FNotables-Swift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2FNotables-Swift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshdholtz","download_url":"https://codeload.github.com/joshdholtz/Notables-Swift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243976478,"owners_count":20377691,"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-10-10T10:33:15.347Z","updated_at":"2025-03-19T08:31:07.339Z","avatar_url":"https://github.com/joshdholtz.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notables-Swift\nProtocol extensions for common NSNotifications for the lazy (me)\n\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n## AppNotable\n- Listens for...\n  - `UIApplicationDidEnterBackgroundNotification`\n  - `UIApplicationWillEnterForegroundNotification`\n  - `UIApplicationDidFinishLaunchingNotification`\n  - `UIApplicationDidBecomeActiveNotification`\n  - `UIApplicationWillResignActiveNotification`\n  - `UIApplicationDidReceiveMemoryWarningNotification`\n  - `UIApplicationWillTerminateNotification`\n\n## KeyboardNotable\n- Listens for...\n  - `UIKeyboardWillShowNotification`\n  - `UIKeyboardWillHideNotification`\n  - `UIKeyboardDidShowNotification`\n  - `UIKeyboardDidHideNotification`\n- Passes back object with...\n  - `animationCurve`\n  - `animationDuration`\n  - `frameEnd`\n  - `frameBegin`\n  - `animate` with the keyboard animation curves \n\n### Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate Notables into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"joshdholtz/Notables-Swift\" \"master\"\n```\n\nRun `carthage` to build the framework and drag the built `Notables.framework` into your Xcode project.\n\n### Manually\n\nIf you prefer not to use either of the aforementioned dependency managers, you can integrate Notables into your project manually by copying and pasting all the files in the `Classes` directory.\n\n## Quick Usage\n\n```swift\nclass ViewController: UIViewController {\n\t@IBOutlet weak var bottomConstraint: NSLayoutConstraint!\n\toverride func viewWillAppear(animated: Bool) {\n\t\tsuper.viewWillAppear(animated)\n\t\tnote_registerForAppEvents()\n\t\tnote_registerForKeyboardEvents()\n\t}\n\t\n\toverride func viewWillDisappear(animated: Bool) {\n\t\tnote_unregisterForAppEvents()\n\t\tnote_unregisterForKeyboardEvents()\n\t\tsuper.viewWillDisappear(animated)\n\t}\n}\n\n// MARK: \n\nextension ViewController: AppNotable {\n\tfunc note_appDidEnterBackground() {\n\t\tprint(\"Called \\(__FUNCTION__)\")\n\t}\n\t\n\tfunc note_appDidBecomeActive() {\n\t\tprint(\"Called \\(__FUNCTION__)\")\n\t}\n}\n\n// MARK: KeyboardNotable\n\nextension ViewController: KeyboardNotable {\n\tfunc note_keyboardWillShow(info: KeyboardNotableInfo) {\n\t\tprint(\"Called \\(__FUNCTION__)\")\n\t\t\n\t\tbottomConstraint.constant += info.frameEnd.height\n\t\tinfo.animate(animations: { () -\u003e Void in\n\t\t\tself.btnSend.layoutIfNeeded()\n\t\t}, completion: nil)\n\t}\n\t\n\tfunc note_keyboardWillHide(info: KeyboardNotableInfo) {\n\t\tprint(\"Called \\(__FUNCTION__)\")\n\t\t\n\t\tbottomConstraint.constant -= info.frameEnd.height\n\t\tinfo.animate(animations: { () -\u003e Void in\n\t\t\tself.btnSend.layoutIfNeeded()\n\t\t}, completion: nil)\n\t}\n\t\n\tfunc note_keyboardDidShow(info: KeyboardNotableInfo) {\n\t\tprint(\"Called \\(__FUNCTION__)\")\n\t}\n\t\n\tfunc note_keyboardDidHide(info: KeyboardNotableInfo) {\n\t\tprint(\"Called \\(__FUNCTION__)\")\n\t}\n}\n```\n\n## Author\n\nJosh Holtz, me@joshholtz.com, [@joshdholtz](https://twitter.com/joshdholtz)\n\n## License\n\n`Notables` 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%2Fjoshdholtz%2Fnotables-swift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshdholtz%2Fnotables-swift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdholtz%2Fnotables-swift/lists"}