Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 #9

Open
waqarali462 opened this issue Nov 19, 2020 · 6 comments

Comments

@waqarali462
Copy link

waqarali462 commented Nov 19, 2020

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")
        }
}
@waqarali462 waqarali462 changed the title 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 process indicator start but button title not removed 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 Nov 19, 2020
@twho
Copy link
Owner

twho commented Nov 20, 2020

Hi, I need more context on how to reproduce the bug so I can help with it. E.g., you need to provide the version you're using, and what actions you take to make the issue happens.

@waqarali462
Copy link
Author

waqarali462 commented Nov 26, 2020 via email

@twho
Copy link
Owner

twho commented Nov 26, 2020

And how to reproduce the bug? I won't be able to help you without enough information

@kannanprasad87
Copy link

Is this issue got resolved ? I am facing the similar issue.

@kannanprasad87
Copy link

kannanprasad87 commented Apr 9, 2021

Steps to reproduce:

  1. Add a UIButton in Storyboard and set custom class in identity inspector.
  2. Set title and other IBInspectable properties.
  3. In the code set the indicator style.
  4. On a button action try to animate, animation started but the label remains visible.
  5. I have debugged the code - its trying to set alpha value to zero for the button label and image but didn't reflected.

Xcode used :12.4 iOS version : 14.3

@twho
Copy link
Owner

twho commented May 26, 2021

I will add a storyboard version in the demo app, hopefully I'll catch this bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants