Skip to content

Commit b079a83

Browse files
authored
Reduce image size and prevent macOS app crash (#39)
1 parent c0c0058 commit b079a83

11 files changed

+18
-1
lines changed

Assets/demo.gif

-434 KB
Loading

Assets/example.png

-18 KB
Loading

Sources/AnimationContext.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import UIKit
2526

2627
internal struct AnimationContext {
2728
let view: UIView
2829
let container: UIView
2930
}
31+
#endif

Sources/Animator.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import UIKit
2526

2627
internal protocol AnimatorDelegate: AnyObject {
@@ -231,3 +232,4 @@ internal final class Animator {
231232
return .init()
232233
}
233234
}
235+
#endif

Sources/Drop.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import UIKit
2526

2627
/// An object representing a drop.
@@ -177,3 +178,4 @@ public extension Drop {
177178
public let message: String
178179
}
179180
}
181+
#endif

Sources/DropView.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import UIKit
2526

2627
internal final class DropView: UIView {
@@ -226,3 +227,4 @@ extension CGRect {
226227
return min(width, height) / 2
227228
}
228229
}
230+
#endif

Sources/Drops.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
23-
23+
#if os(iOS)
2424
import UIKit
2525

2626
internal typealias AnimationCompletion = (_ completed: Bool) -> Void
@@ -218,3 +218,4 @@ extension Drops: AnimatorDelegate {
218218
return queue.first { $0.animator === animator }
219219
}
220220
}
221+
#endif

Sources/PassthroughView.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import UIKit
2526

2627
internal final class PassthroughView: UIView {
@@ -29,3 +30,4 @@ internal final class PassthroughView: UIView {
2930
return view == self ? nil : view
3031
}
3132
}
33+
#endif

Sources/PassthroughWindow.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import UIKit
2526

2627
internal final class PassthroughWindow: UIWindow {
@@ -43,3 +44,4 @@ internal final class PassthroughWindow: UIWindow {
4344

4445
private weak var hitTestView: UIView?
4546
}
47+
#endif

Sources/Presenter.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import UIKit
2526

2627
internal final class Presenter: NSObject {
@@ -93,3 +94,4 @@ internal final class Presenter: NSObject {
9394
)
9495
}
9596
}
97+
#endif

Sources/WindowViewController.swift

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2222
// THE SOFTWARE.
2323

24+
#if os(iOS)
2425
import UIKit
2526

2627
internal final class WindowViewController: UIViewController {
@@ -90,3 +91,4 @@ internal extension UIViewController {
9091
return self
9192
}
9293
}
94+
#endif

0 commit comments

Comments
 (0)