add Shadow on UIView using swift 3
<p>prior swift 3 i was adding shadow in my UIView like this :</p>

<pre><code>//toolbar is an UIToolbar (UIView)
toolbar.layer.masksToBounds = false
toolbar.layer.shadowOffset = CGSize(width: -1, height: 1)
toolbar.layer.shadowRadius = 1
toolbar.layer.shadowOpacity = 0.5
</code></pre>

<p>but the above code is not working in swift 3 , instead of shadow my whole View's color is turned to ugly gray</p>

<p>anyone knows how can we add shadow in swift 3 ?</p>