Giter Site home page Giter Site logo

twho / loading-buttons-ios Goto Github PK

View Code? Open in Web Editor NEW
395.0 7.0 39.0 10.9 MB

A collection of loading buttons and their stylings written in Swift.

License: MIT License

Swift 91.28% Objective-C 0.64% Ruby 8.08%
swift ios loading-animations button activityindicator loadingbutton

loading-buttons-ios's People

Contributors

aakashsrivastav avatar danialepaco avatar jvigneshcs avatar twho avatar vignesh-jeyaraj2 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

loading-buttons-ios's Issues

showLoader() hideLoader() bug

If you call showLoader() and hideLoader() in quick succession (less than 0.18 seconds apart) the hideLoader() function will not be executed due to the transition animation of 0.2 seconds you've put. This should not happen and a smooth transition should be granted no matter what.
There are workarounds to this using the showLoader closure but I think it should be fixed and taken into account anyways.

Other than this, great work on the repo! Good job!

I am using this pod by assign loading button class in storyBoard but some time loading progress indicator not end And other issue which I am facing when click on button progress indicator start but button title not removed

Start loading in GoogleMap function

extension homeViewController: GMSMapViewDelegate
{
    func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) {
        
        if self.textFieldname == "pickup"
        {
            if confirmPickUpbtn.isLoading
            {
                
            }
            else
            {
                confirmPickUpbtn.isLoading = true
                confirmPickUpbtn.showLoader(userInteraction: false)
            }
            
            
        }
        else if self.textFieldname == "dropoff"
        {
            if confirmDropoffbtn.isLoading
            {
                
            }
            else
            {
                confirmDropoffbtn.isLoading = true
                confirmDropoffbtn.showLoader(userInteraction: false)
            }
             
        }
        //        let camera = GMSCameraPosition.camera(withLatitude: (position.target.latitude), longitude: (position.target.longitude), zoom: 18.0 , bearing: 0, viewingAngle: 0)
        //        self.mapView?.animate(to: camera)
        reverseGeocodeCoordinate(position.target)
        
    }
}

End in reverseGeocodeCoordinate function

    private func reverseGeocodeCoordinate(_ coordinate: CLLocationCoordinate2D) {
        
        // 1
        let geocoder = GMSGeocoder()
        
        // 2
        geocoder.reverseGeocodeCoordinate(coordinate) { response, error in
            guard let address = response?.firstResult(), let lines = address.lines else {
                return
            }
            
            // 3
            if self.textFieldname == "pickup"
            {
               ###  if self.confirmPickUpbtn.isLoading
                {
                    self.confirmPickUpbtn.isLoading = false
                    self.confirmPickUpbtn.hideLoader()
                    self.confirmPickUpbtn.backgroundColor = UIColor(hexString: "#FFCF00")
                }
                current_lat = coordinate.latitude
                current_long = coordinate.longitude
                self.startLocTextF.text = lines.joined(separator: "\n")
                self.locationManager.stopUpdatingLocation()
            }
            else if self.textFieldname == "dropoff"
            {
                if self.confirmDropoffbtn.isLoading
                {
                    self.confirmDropoffbtn.isLoading = false
                    self.confirmDropoffbtn.hideLoader()
                    self.confirmDropoffbtn.backgroundColor = UIColor(hexString: "#FFCF00")
                }
                desition_lat = coordinate.latitude
                desition_long = coordinate.longitude
                self.endLocTextF.text = lines.joined(separator: "\n")
                self.locationManager.stopUpdatingLocation()
                
            }
            
            
            // 4
            UIView.animate(withDuration: 0.25) {
                self.view.layoutIfNeeded()
            }
        }
    }

Button Action code

@IBAction func conformpickup(_ sender: LoadingButton) {
        sender.isLoading ? sender.hideLoader() : sender.showLoader(userInteraction: true)
        DispatchQueue.main.async {
            self.confirmPickUpbtn.backgroundColor = UIColor(hexString: "#FFCF00")
        }
}

SwiftUI Version

Wouldn't happen to have a working SwiftUI version? Great job by the way ๐Ÿ‘

Build and archive problem

It works fine in Simulator,When trying to build and archive with generic ios device,it's giving the following error
Could not find module 'LoadingButtons' for target 'arm64-apple-ios'; found: x86_64-apple-ios-simulator, x86_64.Added x86_64 in valid architectures but it's not working

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.