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

Swiftspinner doesn't works in more of one view IOS10 #107

Open
moiseslugoa opened this issue May 12, 2017 · 1 comment
Open

Swiftspinner doesn't works in more of one view IOS10 #107

moiseslugoa opened this issue May 12, 2017 · 1 comment

Comments

@moiseslugoa
Copy link

moiseslugoa commented May 12, 2017

Hello everybody, i get an "error" i used cocoapods for integrate sprinner but only works in my first view for others doesnt do anything like be in freeze, i implement the code in AppDelegate with a observer, and property in SwiftSpiner i change a few features, please help me and i add a snippet of my code

AppDelegate

	func showWaitScreen() {
		DispatchQueue.main.async(execute: {
			self.window?.currentViewController()?.view.endEditing(true);
			UIApplication.shared.isNetworkActivityIndicatorVisible = true;
			SwiftSpinner.sharedInstance.titleLabel.font = FONT_TEX_TITLE_Diezyocho
		if nil == SesionCBHandler.sharedInstance.currentSpinner {
			SwiftSpinner.sharedInstance.removeFromSuperview()
			SesionCBHandler.sharedInstance.currentSpinner = SwiftSpinner.show("T2J0ZW5pZW5kbyBkYXRvcy4uLg==".base64Decoded(),
				animated: true);//"Obteniendo datos..."
		}
		});
	}
	
	func hideWaitScreen() {
		DispatchQueue.main.async(execute: {
		if nil != SesionCBHandler.sharedInstance.currentSpinner {
			SwiftSpinner.hide();
			SwiftSpinner.sharedInstance.removeFromSuperview()
			SesionCBHandler.sharedInstance.currentSpinner = nil;
		}
			UIApplication.shared.isNetworkActivityIndicatorVisible = false;
		});
	}`

SwiftSpinner

UIView.animate(withDuration: 0.33, delay: 0.0, options: .curveEaseOut, animations: {
                
                spinner.blurView.contentView.alpha = 0
                  spinner.blurView.effect = nil
                spinner.blurView.effect = nil
                spinner.blurView.contentView.alpha = 0
                
                }, completion: {_ in
                    spinner.blurView.contentView.alpha = 1
                    spinner.removeFromSuperview()
                    spinner.titleLabel.text = nil
                    spinner.blurView.contentView.alpha = 1.0
                    spinner.removeFromSuperview()
                    spinner.titleLabel.font = spinner.defaultTitleFont
                    spinner.titleLabel.text = nil
                    
                    completion?()
            })
            
            spinner.animating = false
        })
    }

UIView.animate(withDuration: 0.33, delay: 0.0, options: .curveEaseOut, animations: {
                
        spinner.blurView.contentView.alpha = 1
                spinner.blurView.effect = spinner.blurEffect
                
                spinner.blurView.contentView.alpha = 1.0
                spinner.blurView.effect = UIBlurEffect.init(style: UIBlurEffectStyle.dark)
                
                }, completion: nil)
            
            #if os(iOS)
                // Orientation change observer
                NotificationCenter.default.addObserver(
                    spinner,
                    selector: #selector(SwiftSpinner.updateFrame),
                    name: NSNotification.Name.UIApplicationDidChangeStatusBarOrientation,
                    object: nil)
            #endif
        }
        
        spinner.title = title
        spinner.animating = animated
        
        return spinner
    }
@moiseslugoa moiseslugoa changed the title Swiftspinner doesnt works in more of one view IOS10 Swiftspinner doesn't works in more of one view IOS10 May 12, 2017
@miguelDelgado333
Copy link

Yes, I have an equal error. Help me friends or I run :(

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

2 participants