Skip to content

Commit

Permalink
- shadow issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketan-Simform committed Jul 5, 2019
1 parent cf93d05 commit 1e7eb3a
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions SSCustomTabBar/Classes/SSCustomTabBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,35 @@ public class SSCustomTabBar: UITabBar {
}
}

/// Shadow Color
@IBInspectable var shadowColor: UIColor {
get {
return UIColor(cgColor: self.layer.shadowColor ?? UIColor.clear.cgColor)
}
set{
self.layer.shadowColor = newValue.cgColor
}
}

/// Shadow Radius
@IBInspectable var shadowRadius: CGFloat {
get {
return layer.shadowRadius
}
set{
self.layer.shadowRadius = newValue
}
}

/// Shadow Offset
@IBInspectable var shadowOffset: CGSize {
get {
return layer.shadowOffset
} set {
self.layer.shadowOffset = newValue
}
}

private var kLayerFillColor: CGColor = UIColor.blue.cgColor
private var displayLink: CADisplayLink!
private let tabBarShapeLayer = CAShapeLayer()
Expand Down Expand Up @@ -129,6 +158,12 @@ extension SSCustomTabBar {
self.shadowImage = UIImage()
self.clipsToBounds = false

/// Shadow
self.layer.shadowOffset = shadowOffset
self.layer.shadowRadius = shadowRadius
self.layer.shadowColor = shadowColor.cgColor
self.layer.shadowOpacity = 1.0

self.addSubview(leftPoint4)
self.addSubview(leftPoint3)
self.addSubview(leftPoint2)
Expand Down
1 change: 1 addition & 0 deletions SSCustomTabBar/Classes/SSCustomTabBarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public class SSCustomTabBarViewController: UITabBarController {
self.setObserver()
}
}
self.applicationDidBecomeActive()
}


Expand Down

0 comments on commit 1e7eb3a

Please sign in to comment.