ABPadLockScreen icon indicating copy to clipboard operation
ABPadLockScreen copied to clipboard

background color not changing

Open cs14rendra opened this issue 8 years ago • 4 comments

I am running swift demo app , background color showing black . In another project , i am calling it in a observer and When app coming from background then at that time only background color is showing change . NSNotificationCenter.defaultCenter().addObserverForName(UIApplicationDidEnterBackgroundNotification, object: nil, queue: NSOperationQueue.mainQueue()) {_ in

        if (dataViewController().getpass() == "")
        {  
            self.setPin() // here I am calling set pin screen 

        }else{

            self.lockApp()   // here i am calling to unlock screen 


        }

In one Line - In observer it is working but as a normal code it is not working

cs14rendra avatar Apr 13 '16 16:04 cs14rendra

@cs14rendra I have recently created a new Swifty library for iOS pin view. Please have a look. https://github.com/siavashalipour/SAPinViewController

siavashalipour avatar Aug 22 '16 01:08 siavashalipour

@cs14rendra Sorry but I'm not entirely sure what you mean. The example project describes how to set the background color of the view:

ABPadLockScreenView.appearance().backgroundColor = UIColor(hue:0.61, saturation:0.55, brightness:0.64, alpha:1)

If you can provide an example of the issues you're having I'll try and provide some guidance.

abury avatar Aug 25 '16 07:08 abury

I'm having exactly the same issue. Doesn't matter what figures i add it still stays black.

`ABPadLockScreenView.appearance().backgroundColor = UIColor(hue:215, saturation:46.6, brightness:56.7, alpha:1) screen

Oddly enough my laptop shows the screen being blue and not black both with original settings on the swift demo app.

sarah-jameson avatar Aug 25 '16 12:08 sarah-jameson

Thanks for letting me know @sarah-jameson. Ok, it looks like the UIApperance setter for the background color has broken somehow. I'll add a test and fix for this in the next release.

In the mean time, you can set the background color for the view directly without using UIApperance:

let lockScreen = ABPadLockScreenViewController(delegate: self, complexPin: false)
 lockScreen.view.backgroundColor = UIColor.redColor()

abury avatar Aug 25 '16 22:08 abury