Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 51fb5fb

Browse files
maniramezanrnystrom
authored andcommitted
Add drop shadow to separate bar button and body text (#2573)
* Add drop shadow to separate bar button and body text * Change shadow color and radius
1 parent e4d85ec commit 51fb5fb

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Classes/Repository/RepositoryViewController.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,21 @@ EmptyViewDelegate {
299299
present(alert, animated: trueUnlessReduceMotionEnabled)
300300
}
301301

302+
private func addDropShadow() {
303+
guard let buttonBarView = buttonBarView else {
304+
return
305+
}
306+
307+
let shadowPath = UIBezierPath(rect: CGRect(origin: CGPoint(x: 0, y: buttonBarView.bounds.height),
308+
size: CGSize(width: buttonBarView.bounds.width, height: 1)))
309+
buttonBarView.layer.masksToBounds = false
310+
buttonBarView.layer.shadowColor = UIColor.darkGray.cgColor
311+
buttonBarView.layer.shadowOpacity = 1
312+
buttonBarView.layer.shadowPath = shadowPath.cgPath
313+
buttonBarView.layer.shouldRasterize = true
314+
buttonBarView.layer.shadowRadius = 2
315+
}
316+
302317
// MARK: ButtonBarPagerTabStripViewController Overrides
303318

304319
override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
@@ -331,4 +346,12 @@ EmptyViewDelegate {
331346
fetchDetails()
332347
}
333348

349+
// MARK: UIViewController Overrides
350+
351+
override func viewDidLayoutSubviews() {
352+
super.viewDidLayoutSubviews()
353+
354+
addDropShadow()
355+
}
356+
334357
}

0 commit comments

Comments
 (0)