How to apply shadow effect on specific side of the parent view only in ios
<p>For applying shadow effect on view I am using the below code.  </p>

<pre><code>func addShadowImage(parentview:UIView){

    parentview.layer.shadowColor = UIColor.redColor().CGColor
    parentview.layer.masksToBounds = false

    //for bottom shadow on view
    parentview.layer.shadowOffset = CGSizeMake(0,1.0)
    parentview.layer.shadowOpacity = 0.7
    parentview.layer.shadowRadius = 1.0


    //for bottom and right sides shadow on view
    parentview.layer.shadowOffset = CGSizeMake(1.0,1.0)
    parentview.layer.shadowOpacity = 1
    parentview.layer.shadowRadius = 1.0


    //for empty shadow on view
    parentview.layer.shadowOffset = CGSizeMake(0,0)
    parentview.layer.shadowOpacity = 1
    parentview.layer.shadowRadius = 0

    //for bottom and right and left sides shadow on view
    parentview.layer.shadowOffset = CGSizeMake(0,2.0)
    parentview.layer.shadowOpacity = 1
    parentview.layer.shadowRadius = 2.0

    //for four sides shadow on view
    parentview.layer.shadowOffset = CGSizeMake(0,0)
    parentview.layer.shadowOpacity = 1.0
    parentview.layer.shadowRadius = 5.0
}
</code></pre>

<p>Now simply call the above function with parameter type is UIView
self.addShadowImage(yourViewObject)</p>

<p>Then it's working fine, But this shadow effected on all its subviews. </p>

<p>So now I want to apply a shadow effect on specific view and specific side(i.e either left or right/bottom/top).</p>