• Stars
    star
    237
  • Rank 169,885 (Top 4 %)
  • Language Makefile
  • License
    MIT License
  • Created almost 7 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Show pleasant loading view for your users ๐Ÿ˜

Build Status Version License Platform Language Twitter

RHPlaceholder ๐Ÿ’พ

Because 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 ๐Ÿ’ฅ! ๐Ÿ•

Play with it ๐Ÿ˜Ž

Installation

You can install library using Cocoapods:

pod 'RHPlaceholder'

or using Carthage:

add

github "robertherdzik/RHPlaceholder"

to your Cartfile and perform carthage update --platform iOS.

Usage

WOW... it is soo easy to use ๐Ÿ™Š! Base integration with your storyboard VC will take couple minutes ๐Ÿ’ฅ

Base Usage

just create instance const of Placeholder in your ViewController:

private let placeholderMarker = Placeholder() // By default you will have Insta like gradient animation

bear in mind, that you can choose between couple of predefined animations (like e.g. RainbowAnimatorGradient):

private let placeholderMarker = Placeholder(layerAnimator: RainbowAnimatorGradient.self)

... and then just bind up library with your views which needs to be animated:

private func addPlaceholder() {
    let viewElements: [UIView] = [
        name,
        surname,
        age,
        email,
        birthDate
    ]
        
    placeholderMarker.register(viewElements)
}

call addPlaceholder() method in viewDidLoad(). Boom ๐Ÿ˜ฒ library has been associated with your views ๐Ÿ‘

all what left, is to controll showing 'loading state' animation on your views using startAnimation() and remove()

func fetchUserData() {
    placeholderMarker.startAnimation()
    apiManager.fetchUser() { [weak self] user in 
        self?.placeholderMarker.remove()
        // .. rest of the method
    }
}

List of available animatotrs:

(default) InstaLayerAnimatorGradient

BackAndForthLayerAnimatorGradient BlinkAnimator RainbowAnimatorGradient

Customization

You can add your own Animators, by conforming to the LayerAnimating protocol and passing your new Animator as a param to the Placeholder init.

Swift support

Library ver Swift ver Note
0.0.3 4.1 Very early version, API may change
0.0.5 4.2 Very early version, API may change
0.0.6 5.0 Very early version, API may change

Check the Demo project

Please check out the demo project, you can see there how Library has been implemented in details.

Layout Inspiration

Layout 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 ๐Ÿ˜ฆ...

Assets


  • Great ๐Ÿ˜ tab bar icons from:
Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

  • Cool ๐Ÿ˜Ž profile icon from:
Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

More Repositories

1

RHPreviewCell

I envied so much Spotify iOS app this great playlist preview cell ๐Ÿ˜, I decided to create my own one ๐ŸŒถ. Now you can give your users ability to quick check "what content is hidden under your UITableViewCell". Great think is that this Library not requires 3D Touch support from user device๐Ÿ’ฅ.
Swift
385
star
2

RHSideButtons

Library provides easy to implement variation of Android (Material Design) Floating Action Button for iOS. You can use it as your app small side menu. ๐ŸŒถ
Swift
168
star
3

SkrybaMD

Swifty powered ๐Ÿ”ŒMarkdown Documentation generator. If your team need easy way to maintain and create documentation, this generator is for you.
Swift
18
star
4

Instasoup

#SwiftUI mirroring of Instagram app Home screen
Swift
12
star
5

RHSwipeableCell

RHSwipeableCell gives you simple and cool looking custom cell with extra button after swipe action.
Swift
4
star
6

RHPlaygroundFreestyle

Sometimes I try to draw something in Playground, and if I decide whether it should be kept for the future usage, I will put this piece of .playground code in this repo ๐Ÿฐ
Swift
3
star
7

BitBayJS_terminal

Because life is way easier if you can check your currencies on BitBay through terminal... ๐Ÿ™ƒ
JavaScript
3
star
8

RHAnalogClock

Clock - my very old project, I'm afraid that he will be no longer developed. ๐Ÿ˜”
Objective-C
2
star
9

RHLifoOperationQueue

Simple implementation of LIFO algorithm for NSOperationQueue
Swift
1
star
10

Language

Because for english learning purposes most of the times I create .xlsx file with words to learn, I have created for myself small script for training words randomly fetched from .xlsx file. ๐Ÿ“–
Ruby
1
star
11

XcodeTheme-Rapha.cc

You are Road Cycling lover? โค๏ธhere you have: Xcode theme inspired by Rapha.cc ๐Ÿšดโ€โ™€๏ธcolors
1
star
12

wallapopNotifier

Because you don't have opportunity to `subscribe` for particular search and receiving notification in wallapop.es website or mobile app, I created quite simple mechanism to getting those according to defined keywords/filters.
1
star