Giter Site home page Giter Site logo

jogendra / loadingshimmer Goto Github PK

View Code? Open in Web Editor NEW
1.5K 22.0 67.0 921 KB

An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.

Home Page: https://jogendra.dev/

License: MIT License

Ruby 8.61% Swift 91.39%
swift swift4 ios11 cocoapods animations labels xcode library framework ios

loadingshimmer's Introduction

LoadingShimmer

An easy way to add a shimmering effect to any view with just single line of code. It is useful as an unobtrusive loading indicator. This is a network request waiting for the framework, the framework to increase the dynamic effect, convenient and fast, a line of code can be used.

CI Status Version License Platform

Demo/Example

For demo:

$ pod try LoadingShimmer

To run the example project, clone the repo, and run pod install from the Example directory first.

$ cd Example
$ pod install

If you don't have CocoaPods installed, grab it with [sudo] gem install cocoapods.

$ open LoadingShimmer.xcworkspace

Requirements

  • iOS 10.0 or later
  • Swift 5+
  • Xcode 10+

Installation

CocoaPods

LoadingShimmer is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'LoadingShimmer'

Manual Installation

Just drag the LoadingShimmer.swift files into your project.

Usage

Start Covering Loading -

LoadingShimmer.startCovering(view)

Stop Covering Loading -

LoadingShimmer.stopCovering(view)

Don't forget to import LoadingShimmer

Author

Jogendra Singh

The pod is inspired by DWLoadingShimmer

License

LoadingShimmer is available under the MIT license. See the LICENSE file for more info.

loadingshimmer's People

Contributors

jogendra avatar valeriyvan avatar vmammanalupo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loadingshimmer's Issues

This function is quite a lot

Actual Behaviour

Expected Behaviour

Steps to reproduce it

LogCat for the issue

Screenshots of the issue

Would you like to work on the issue?

Does not work with UIView on iOS 15

Actual Behaviour
No animation displayed after calling
LoadingShimmer.startCovering(view, with: nil)

Expected Behaviour
Animation displayed

Steps to reproduce it
override func viewDidLoad() {
super.viewDidLoad()

    let animationView = UIView()
    view.addSubviews(animationView)
    
    animationView.snp.makeConstraints {
        $0.edges.equalToSuperview()
    }
    
    LoadingShimmer.startCovering(animationView, with: nil)
}

LogCat for the issue

No crash there

Clear view. Changing backgroundColor of the view has no affect

Would you like to work on the issue?

Maybe

LoadingShimmer does not cover IB interface views

Actual Behaviour

There is no shimmer

image

Expected Behaviour

Shimmer should occur

Steps to reproduce it

  1. Create a view controller in storyboard
  2. Create views and outlets to the views.
  3. Set the background of the view to a different color and the created subviews to a different color.
  4. Connect the outlets.

Would you like to work on the issue?
No thank you.


import UIKit
import LoadingShimmer

class BugTest2ViewController: UIViewController {

    @IBOutlet var blackview: UIView!
    @IBOutlet var greenview: UIView!
    override func viewDidLoad() {
        super.viewDidLoad()
        LoadingShimmer.startCovering(blackview)
        LoadingShimmer.startCovering(greenview)
        // Do any additional setup after loading the view.
    }
}

Loader for TableView Cells is hardcoded in Library

let coverableCellsIds = ["Cell1", "Cell1", "Cell1", "Cell1", "Cell1"] if type(of: view!) === UITableView.self { for i in 0..<coverableCellsIds.count { getTableViewPath(view, index: i, coverableCellsIds: coverableCellsIds) } addCover(view) return }

Cannot open example project

Actual Behaviour

I try to open example project but it shows me errors "Multiple commands produce...". I use Xcode 10.1

Expected Behaviour

The example app should open

Steps to reproduce it
Follow the guideline README in the project.
Screenshots of the issue

screen shot 2019-02-27 at 16 40 53

Would you like to work on the issue?
yes

Add support for UICollectionView

Actual Behaviour

Currently, it is supporting normal views and UITableView.

Expected Behaviour

Add support for UICollectionView

Screenshots of the issue

N/A

Would you like to work on the issue?

Anyone can take the issue. Feel free to open the PR.

Integrate CIrcle-CI 2.0 to the project

Actual Behaviour

Currently, no any hook for checking PR quality and testing.

Expected Behaviour

Integrate Circle-CI

Steps to reproduce it

Screenshots of the issue

N/A

Would you like to work on the issue?

Yes

Using Loading Shimmer changes view background color

Actual Behaviour
Using Loading Shimmer changes a view's background color (always white background).

Expected Behaviour
Using Loading Shimmer honors the target view's background color, via using it as the backdrop while blurring its contained elements.

Steps to reproduce it

  1. Have a view with a background color.
  2. Cover that view with a loading shimmer via LoadingShimmer.startCovering(view)
  3. Hide the loading shimmer via LoadingShimmer.stopCovering(view)

Observe that the original background color is not honored.

When using Pod, not able to access access class due to internal access

I integrated using Pod, but couldn't able to access LoadingShimmer class due to default internal access of class.

I made public access to that class by putting public keyword.

public class LoadingShimmer: NSObject {
    public static let shared = LoadingShimmer()

    public class func startCovering(_ view: UIView?) {
        shared.coverSubviews(view)
    }

    public class func stopCovering(_ view: UIView?) {
        shared.removeSubviews(view)
    }

}

Would you please do the same changes in repo.

Thanks.

ios 13

Hi,
no more effect on table view on ios 13 device

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.