loading-buttons-ios
loading-buttons-ios copied to clipboard
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")
}
}
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.
0.1 i am using this version
On Fri, Nov 20, 2020 at 11:02 AM Michael T. Ho [email protected] wrote:
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.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/twho/loading-buttons-ios/issues/9#issuecomment-730871965, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARPRT56IKPJ3OAWBIZHMJM3SQYA57ANCNFSM4T3BK6PA .
And how to reproduce the bug? I won't be able to help you without enough information
Is this issue got resolved ? I am facing the similar issue.
Steps to reproduce:
- Add a UIButton in Storyboard and set custom class in identity inspector.
- Set title and other IBInspectable properties.
- In the code set the indicator style.
- On a button action try to animate, animation started but the label remains visible.
- 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
I will add a storyboard version in the demo app, hopefully I'll catch this bug