Skip to content

Commit 8dcf50b

Browse files
committed
Add backup symbol for play button
1 parent 3c145a3 commit 8dcf50b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Source/Views/PageView.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,20 @@ class PageView: UIScrollView {
2222
lazy var playButton: UIButton = {
2323
let button = UIButton(type: .custom)
2424
button.frame.size = CGSize(width: 60, height: 60)
25-
button.setBackgroundImage(AssetManager.image("lightbox_play"), for: UIControl.State())
25+
var buttonImage = AssetManager.image("lightbox_play")
26+
27+
// Note by Elvis Nuñez on Mon 22 Jun 08:06
28+
// When using SPM you might find that assets are note included. This is a workaround to provide default assets
29+
// under iOS 13 so using SPM can work without problems.
30+
if #available(iOS 13.0, *) {
31+
if buttonImage == nil {
32+
buttonImage = UIImage(systemName: "play.circle.fill")
33+
}
34+
}
35+
36+
button.setBackgroundImage(buttonImage, for: UIControl.State())
2637
button.addTarget(self, action: #selector(playButtonTouched(_:)), for: .touchUpInside)
38+
button.tintColor = .white
2739

2840
button.layer.shadowOffset = CGSize(width: 1, height: 1)
2941
button.layer.shadowColor = UIColor.gray.cgColor

0 commit comments

Comments
 (0)