I want to have a tranparent background in my UIViewController for that I used clearColor like this
colorPickerVc.view.backgroundColor = UIColor.clearColor()
presentViewController(colorPickerVc, animated: true, completion: nil)
the problem is when colorPickerVc finished loading, the background color become black I want a solution if possible that work on ios 7 to thank's for your help
Solution of @good4pc :
colorPickerVc.view.backgroundColor = UIColor.clearColor()
if #available(iOS 8.0, *)
{
colorPickerVc.modalPresentationStyle = UIModal PresentationStyle.OverCurrentContext
}
else
{
colorPickerVc.modalPresentationStyle = UIModalPresentationStyle.CurrentContext
}
presentViewController(colorPickerVc, animated: true, completion: nil)
work for me, thank you guys for your help
colorPickerVc.modalPresentationStyle = UIModalPresentationStyle.OverCurrentContext
colorPickerVc.view.backgroundColor = UIColor.clearColor()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With