{"id":18389288,"url":"https://github.com/rightpoint/rzviewactions","last_synced_at":"2025-04-07T02:34:10.283Z","repository":{"id":22490171,"uuid":"25829525","full_name":"Rightpoint/RZViewActions","owner":"Rightpoint","description":"A category on UIView that provides animation structure similar to SKAction from SpriteKit.","archived":false,"fork":false,"pushed_at":"2015-11-17T19:46:45.000Z","size":161,"stargazers_count":103,"open_issues_count":3,"forks_count":13,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-04T09:17:13.264Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rightpoint.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":"2014-10-27T16:57:57.000Z","updated_at":"2023-07-25T07:20:26.000Z","dependencies_parsed_at":"2022-08-20T17:40:19.375Z","dependency_job_id":null,"html_url":"https://github.com/Rightpoint/RZViewActions","commit_stats":null,"previous_names":["raizlabs/rzviewactions"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rightpoint%2FRZViewActions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rightpoint%2FRZViewActions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rightpoint%2FRZViewActions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rightpoint%2FRZViewActions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rightpoint","download_url":"https://codeload.github.com/Rightpoint/RZViewActions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247583223,"owners_count":20961990,"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-06T01:42:25.022Z","updated_at":"2025-04-07T02:34:05.263Z","avatar_url":"https://github.com/Rightpoint.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RZViewActions\n\n[![Version](https://img.shields.io/cocoapods/v/RZViewActions.svg?style=flat)](http://cocoadocs.org/docsets/RZViewActions)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"http://cl.ly/image/0y0n2C1B1M1X/rzva.gif\"\nalt=\"RZViewActions\"\u003e\n\u003c/p\u003e\n## Overview\nIt can be difficult and unwieldy to perform complex animations using `[UIView animateWithDuration...]`, especially when trying to manage several concurrent animations and their completion blocks. Core Animation offers some help with `CAAnimationGroup`, but realistically using Core Animation for such tasks can be wordy and just as cumbersome.\nRZViewActions offers a solution.\n\n## Installation\nInstall using [CocoaPods](http://cocoapods.org) (recommended) by adding the following line to your Podfile:\n\n`pod \"RZViewActions\"`\n\n## Demo Project\nAn example project is available in the Example directory. You can quickly check it out with\n\n`pod try RZViewActions`\n\nOr download the zip form github and run it manually.\n\n## Basic Usage\nRZViewActions provides additional structure for UIView animations, and allows you to define animations semantically:\n```obj-c\nRZViewAction *changeBg = [RZViewAction action:^{\n        self.view.backgroundColor = [UIColor blueColor];\n} withDuration:1.0];\n\n[UIView rz_runAction:changeBg withCompletion:^(BOOL finished) {\n  NSLog(@\"The view changed background color over 1 second\");\n}];\n```\nThis simple usage may not be particularly useful on its own, but is the fundamental building block for more complex actions. Note that actions can be stored and reused multiple times. If you do store an action, avoid retain cycles by using weak references within the animation block to any objects that might retain ownership of the action.\n\n## Sequences\nBasic actions can be combined in sequences that run each action to completion before running the next in the sequence:\n``` obj-c\nRZViewAction *rotate = [RZViewAction action:^{\n        self.label.transform = CGAffineTransformMakeRotation(M_PI_2);\n} withOptions:UIViewAnimationOptionCurveEaseInOut duration:3.0];\n    \nRZViewAction *wait = [RZViewAction waitForDuration:2.0];\n\nRZViewAction *fade = [RZViewAction action:^{\n  self.label.alpha = 0.5f;\n} withDuration:1.0];\n    \nRZViewAction *seq = [RZViewAction sequence:@[rotate, wait, fade]];\n\n[UIView rz_runAction:seq withCompletion:^(BOOL finished) {\n  NSLog(@\"The label rotated, and then faded out 2 seconds later\");\n}];\n```\nIt's immediately clear what the intent of the above animation is, because each action is defined separately instead of nested within completion blocks.\n\n## Groups\nRZViewActions also provides group animations, which performs several actions at once:\n``` obj-c\nRZViewAction *group = [RZViewAction group:@[rotate, fade]];\n\n[UIView rz_runAction:group withCompletion:^(BOOL finished) {\n  NSLog(@\"The label rotated over 3 seconds, and faded out during the first second\");\n}];\n```\nGrouping behavior is difficult to accomplish with standard UIView animations, especially when trying to execute a completion block, but RZViewActions makes these tasks clear and simple.\n\n## Endless Possibilities\nSequences can be added to groups and groups can be added to sequences, which means the your view animations can be arbitrarily complex. However, the self documenting nature of RZViewActions means your animations can grow in complexity, but your code remains approachable, debuggable, and explicit in intent.\n\n## Author\nRob Visentin, rob.visentin@raizlabs.com\n\n## License\nRZViewActions 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%2Frightpoint%2Frzviewactions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frightpoint%2Frzviewactions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frightpoint%2Frzviewactions/lists"}