Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions EMTLoadingIndicator/Classes/EMTLoadingIndicator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
//

import UIKit
#if !os(iOS)
import WatchKit
#endif

@objc
final public class EMTLoadingIndicator: NSObject {
Expand Down Expand Up @@ -61,7 +63,11 @@ final public class EMTLoadingIndicator: NSObject {

private func prepareImagesForWaitStyleDot() {
if EMTLoadingIndicator.dotWaitImage == nil {
#if SWIFT_PACKAGE
let bundle = Bundle.module
#else
let bundle = Bundle(for: EMTLoadingIndicator.self)
#endif
let cursors: [UIImage] = (0...29).map {
let index = $0
return UIImage(contentsOfFile: (bundle.path(forResource: "waitIndicatorGraphic-\(index)@2x", ofType: "png"))!)!
Expand Down
2 changes: 2 additions & 0 deletions EMTLoadingIndicator/Classes/EMTTimer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
// Copyright (C) 2016 emotionale. All rights reserved.
//

#if !os(iOS)
import WatchKit
#endif

typealias EMTTimerCallback = (Timer) -> Void

Expand Down
27 changes: 27 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// swift-tools-version:5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription

let package = Package(
name: "EMTLoadingIndicator",
platforms: [
.watchOS(.v4)
],
products: [
.library(
name: "EMTLoadingIndicator",
targets: ["EMTLoadingIndicator"])
],
targets: [
.target(
name: "EMTLoadingIndicator",
path: ".",
exclude: ["LICENSE",
"README.md",
"waitIndicatorGraphic.fla",
"EMTLoadingIndicator/Info.plist",
"EMTLoadingIndicator.podspec"],
sources: ["EMTLoadingIndicator/Classes"],
resources: [.process("EMTLoadingIndicator/Resources")])
]
)