File tree Expand file tree Collapse file tree
Sources/ScreenDataUI/Views Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,8 @@ import PackageDescription
66let package = Package (
77 name: " ScreenDataUI " ,
88 platforms: [
9- . iOS( . v14)
9+ . iOS( . v14) ,
10+ . watchOS( . v7)
1011 ] ,
1112 products: [
1213 // Products define the executables and libraries a package produces, and make them visible to other packages.
Original file line number Diff line number Diff line change @@ -67,12 +67,20 @@ public struct SDImage: View {
6767 public var image : SomeImage
6868 private var progressTint : Color
6969
70+ private var screenWidth : CGFloat {
71+ #if os(iOS)
72+ UIScreen . main. bounds. width
73+ #else
74+ WKInterfaceDevice . current ( ) . screenBounds. width
75+ #endif
76+ }
77+
7078 private var width : CGFloat {
7179 guard let width = image. style? . width else {
7280 return . infinity
7381 }
7482
75- if CGFloat ( width) >= UIScreen . main . bounds . width {
83+ if CGFloat ( width) >= screenWidth {
7684 return . infinity
7785 }
7886
You can’t perform that action at this time.
0 commit comments