{"id":2291,"url":"https://github.com/robertherdzik/RHPlaceholder","last_synced_at":"2025-08-02T23:33:27.311Z","repository":{"id":62451973,"uuid":"120531839","full_name":"robertherdzik/RHPlaceholder","owner":"robertherdzik","description":"Show pleasant loading view for your users 😍","archived":false,"fork":false,"pushed_at":"2021-11-21T16:09:34.000Z","size":24115,"stargazers_count":238,"open_issues_count":2,"forks_count":30,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-27T11:30:18.894Z","etag":null,"topics":["animation","cocoapods","facebook","facebook-animation","gradient","instagram","instagram-animation","ios","ios-animation","ios-lib","ios-swift","ios-ui","ios-uiview","loader","loaders","loading-animation","loading-animations","placeholder","swift","swift-library"],"latest_commit_sha":null,"homepage":"","language":"Makefile","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/robertherdzik.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":"2018-02-06T22:36:10.000Z","updated_at":"2024-08-12T09:08:23.000Z","dependencies_parsed_at":"2022-11-01T23:46:24.239Z","dependency_job_id":null,"html_url":"https://github.com/robertherdzik/RHPlaceholder","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertherdzik%2FRHPlaceholder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertherdzik%2FRHPlaceholder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertherdzik%2FRHPlaceholder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertherdzik%2FRHPlaceholder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertherdzik","download_url":"https://codeload.github.com/robertherdzik/RHPlaceholder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503196,"owners_count":17930534,"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":["animation","cocoapods","facebook","facebook-animation","gradient","instagram","instagram-animation","ios","ios-animation","ios-lib","ios-swift","ios-ui","ios-uiview","loader","loaders","loading-animation","loading-animations","placeholder","swift","swift-library"],"created_at":"2024-01-05T20:16:10.004Z","updated_at":"2024-12-06T17:31:02.641Z","avatar_url":"https://github.com/robertherdzik.png","language":"Makefile","funding_links":[],"categories":["UI","Makefile","Swift"],"sub_categories":["Activity Indicator"],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src =\"./ReadmeAssets/LogoBanner.gif\"/\u003e\n\u003c/p\u003e\n\n[![Build Status](https://travis-ci.org/robertherdzik/RHPlaceholder.svg?branch=master)](https://travis-ci.org/robertherdzik/RHPlaceholder)\n[![Version](https://img.shields.io/cocoapods/v/RHPlaceholder.svg?style=flat)](https://cocoapods.org/pods/RHPlaceholder)\n[![License](https://img.shields.io/cocoapods/l/BadgeSwift.svg?style=flat)](/LICENSE)\n[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat)](https://developer.apple.com/iphone/index.action)\n[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat)](https://developer.apple.com/swift)\n[![Twitter](https://img.shields.io/twitter/follow/Roherdzik.svg?style=social\u0026label=Follow)](https://twitter.com/Roherdzik)\n\n# RHPlaceholder 💾\nBecause traditional `loading view` like `UIActivityIndicatorView` or similar one are no longer so trendy (Facebook or Instagram apps are moving away from these approaches), I decided to create very simple library which will give you oportunity to have Facebook or Instagram 'view loading state' in your great project without big effort 💥! 🍕 \n\n## Play with it 😎\n\n## Installation\nYou can install library using \u003cb\u003e Cocoapods\u003c/b\u003e:\n```\npod 'RHPlaceholder'\n```\nor using \n\u003cb\u003e Carthage\u003c/b\u003e:\n\nadd\n```\ngithub \"robertherdzik/RHPlaceholder\"\n```\nto your Cartfile and perform `carthage update --platform iOS.`\n\n## Usage\nWOW... it is soo easy to use 🙊! Base integration with your storyboard VC will take couple minutes 💥\n\n### Base Usage\njust create instance const of `Placeholder` in your `ViewController`:\n```swift\nprivate let placeholderMarker = Placeholder() // By default you will have Insta like gradient animation\n```\n\nbear in mind, that you can choose between couple of predefined animations (like e.g. RainbowAnimatorGradient):\n```swift\nprivate let placeholderMarker = Placeholder(layerAnimator: RainbowAnimatorGradient.self)\n```\n\n... and then just bind up library with your views which needs to be animated:\n\n```swift\nprivate func addPlaceholder() {\n    let viewElements: [UIView] = [\n        name,\n        surname,\n        age,\n        email,\n        birthDate\n    ]\n        \n    placeholderMarker.register(viewElements)\n}\n```\ncall `addPlaceholder()` method in `viewDidLoad()`. \nBoom 😲 library has been associated with your views 👏\n\nall what left, is to controll showing 'loading state' animation on your views using `startAnimation()` and `remove()`\n```swift\nfunc fetchUserData() {\n    placeholderMarker.startAnimation()\n    apiManager.fetchUser() { [weak self] user in \n        self?.placeholderMarker.remove()\n        // .. rest of the method\n    }\n}\n```\n\n#### List of available animatotrs: \n##### (`default`) InstaLayerAnimatorGradient\n\u003cp align=\"center\"\u003e\n\u003cimg src =\"./ReadmeAssets/insta1.gif\" width=\"373\" height=\"656\"/\u003e\n\u003c/p\u003e\n\n\u003ctable align=\"center\" bgcolor=\"#FFFFFF\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eBackAndForthLayerAnimatorGradient\u003c/th\u003e\n    \u003cth\u003eBlinkAnimator\u003c/th\u003e\n    \u003cth\u003eRainbowAnimatorGradient\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src =\"./ReadmeAssets/bf1.gif\" width=\"186\" height=\"328\"/\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src =\"./ReadmeAssets/blink1.gif\" width=\"186\" height=\"328\"/\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src =\"./ReadmeAssets/Rainbow1.gif\" width=\"186\" height=\"328\"/\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n#### Customization\nYou can add your own Animators, by conforming to the `LayerAnimating` protocol and passing your new Animator as a param to the `Placeholder` init.\n\n## Swift support\n| Library ver| Swift ver| Note |\n| ------------- |:-------------:| ------------- |\n| 0.0.3   | 4.1 | Very early version, API may change |\n| 0.0.5   | 4.2 | Very early version, API may change |\n| 0.0.6   | 5.0 | Very early version, API may change |\n\n\n## Check the Demo project\n\nPlease check out the demo project, you can see there how Library has been implemented in details.\n\n### Layout Inspiration\nLayout inspiration has been taken from one of the Dribbble projects, unfortunately I cannot find now this project anymore, because of that I cannot annotate creator in here 😦...\n\n### Assets\n---\n- Great 😍 tab bar icons from:\n\u003cdiv\u003eIcons made by \u003ca href=\"http://www.freepik.com\" title=\"Freepik\"\u003eFreepik\u003c/a\u003e from \u003ca href=\"https://www.flaticon.com/\" title=\"Flaticon\"\u003ewww.flaticon.com\u003c/a\u003e is licensed by \u003ca href=\"http://creativecommons.org/licenses/by/3.0/\" title=\"Creative Commons BY 3.0\" target=\"_blank\"\u003eCC 3.0 BY\u003c/a\u003e\u003c/div\u003e\n\n---\n\n- Cool 😎 profile icon from:\n\u003cdiv\u003eIcons made by \u003ca href=\"http://www.freepik.com\" title=\"Freepik\"\u003eFreepik\u003c/a\u003e from \u003ca href=\"https://www.flaticon.com/\" title=\"Flaticon\"\u003ewww.flaticon.com\u003c/a\u003e is licensed by \u003ca href=\"http://creativecommons.org/licenses/by/3.0/\" title=\"Creative Commons BY 3.0\" target=\"_blank\"\u003eCC 3.0 BY\u003c/a\u003e\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertherdzik%2FRHPlaceholder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertherdzik%2FRHPlaceholder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertherdzik%2FRHPlaceholder/lists"}