{"id":18270203,"url":"https://github.com/rFlex/SCViewShaker","last_synced_at":"2025-04-04T23:31:48.814Z","repository":{"id":18573459,"uuid":"21776264","full_name":"rFlex/SCViewShaker","owner":"rFlex","description":"A highly configurable UIView category for shaking a view with various shaking styles","archived":false,"fork":false,"pushed_at":"2015-10-22T02:59:49.000Z","size":1126,"stargazers_count":86,"open_issues_count":3,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-30T04:50:04.941Z","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":"kubernetes/kubernetes","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rFlex.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-07-12T20:48:52.000Z","updated_at":"2019-02-15T15:50:00.000Z","dependencies_parsed_at":"2022-08-21T04:50:12.395Z","dependency_job_id":null,"html_url":"https://github.com/rFlex/SCViewShaker","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rFlex%2FSCViewShaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rFlex%2FSCViewShaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rFlex%2FSCViewShaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rFlex%2FSCViewShaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rFlex","download_url":"https://codeload.github.com/rFlex/SCViewShaker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266476,"owners_count":20910831,"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:24.497Z","updated_at":"2025-04-04T23:31:48.015Z","avatar_url":"https://github.com/rFlex.png","language":"Objective-C","readme":"SCViewShaker\n============\n\n\n## About\nA highly configurable UIView category for shaking a view. You start shaking your views with a one liner :). It supports a few different shaking styles (horizontal, vertical, rotate) and let you configure the duration, the speed and the shake strength.\n\n![](shake.gif)\n\n## Usage\n\nSCViewShaker works as a category on UIView. It provides the following methods:\n     \n```objective-c\n- (void)shake;\n\n- (void)shakeWithOptions:(SCShakeOptions)shakeOptions force:(CGFloat)force duration:(CGFloat)duration iterationDuration:(CGFloat)iterationDuration completionHandler:(ShakeCompletionHandler)completionHandler\n     \n- (void)endShake\n     \n@property (readonly, nonatomic) BOOL isShaking\n```\n\n*shake* does a small shake on the view for a short amount of time. It was added as a convenience method.\n\n\n*shakeWithOptions:force:duration:iterationDuration:completionHandler:* performs a new shake action with the complete control on how the shake will be done. It takes the follow parameters:\n\n**shakeOptions** is an enum of options that can be activated by using the OR operator (like SCShakeOptionsDirectionRotate | SCShakeOptionsForceInterpolationNone).\n\n**force** is the coefficient of force to apply on each shake iteration (typically between 0 and 1 even though nothing prevents you for setting a higher value if you want).\n\n**duration** is the total duration of the shaking motion. This may be ignored depending of the options you set.\niterationDuration is how long each shake iteration will last. You may want to set a very low value (like 0.02) if you want a proper shake effect.\n\n**completionHandler**, if not null, is the block that will be invoked when the shake finishes.\n\n#### Simple example\n\n```objective-c\nUIView *view = ...; // Grab a view from somewhere\n[view beginShakingWithOptions:SCShakeOptionsDirectionRotate | SCShakeOptionsForceInterpolationExpDown | SCShakeOptionsAtEndRestart | SCShakeOptionsAutoreverse force:0.15 duration:1 iterationDuration:0.03 completionHandler:nil];\n```\n\n## Options\n\n#### Direction\n\nThe direction affects the visual effect of the shake effect. All value bounds shown here are based on a force of 1.\n\n**SCShakeOptionsDirectionRotate**: The view will rotate from -90° to 90°.\n\n**SCShakeOptionsDirectionHorizontal**: The view will move horizontally from -frameWidth to +frameWidth.\n\n**SCShakeOptionsDirectionVertical**: The view will move vertically from -frameHeight to +frameHeight.\n\n**SCShakeOptionsDirectionHorizontalAndVertical**: The view will randomly move horizontally or vertically.\n\n\n#### Force interpolation\n\nThe force interpolation affects how the force changes in the time.\n\n**SCShakeOptionsForceInterpolationNone**: The force will remain always the same as the one you provided.\n\n**SCShakeOptionsForceInterpolationLinearUp**: The force will linearly changes from 0 to the one you provided.\n\n**SCShakeOptionsForceInterpolationLinearDown**: The force will linearly changes from the one you provided to zero.\n\n**SCShakeOptionsForceInterpolationExpUp**: The force will exponentialy changes from 0 to the one you provided.\n\n**SCShakeOptionsForceInterpolationExpDown**: The force will exponentialy changes from the one you provided to zero.\n\n**SCShakeOptionsForceInterpolationRandom**: The force will randomly change between 0 and the one you provided.\n\n#### Action at end\n\nThe action at end defines what should happen when the shake completes\n\n**SCShakeOptionsAtEndRestart**: The shake will be restarted automatically from the beginning.\n\n**SCShakeOptionsAtEndComplete**: The shake will stop.\n\n**SCShakeOptionsAtEndContinue**: The shake will contnue endlessly. The force won't change anymore when it reaches the duration.\n\n#### Misc options\n\n**SCShakeOptionsAutoreverse**: When the shake reaches the end, the shake will continue in the reverse order. Setting this value will double the effective **duration**.\n\n## Podfile\nIf you are using cocoapods, you can use this project with the following Podfile\n\n```ruby\npod \"SCViewShaker\", \"~\u003e 1.0\"\n```\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FrFlex%2FSCViewShaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FrFlex%2FSCViewShaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FrFlex%2FSCViewShaker/lists"}