Skip to content

Commit fdc6c46

Browse files
authored
Merge pull request #38 from eure/spm
Add SPM support
2 parents 13ed72c + cbc15c7 commit fdc6c46

22 files changed

Lines changed: 87 additions & 4 deletions

Package.swift

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// swift-tools-version:5.5
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "MosaiqueAssetsPicker",
8+
platforms: [
9+
.iOS(.v10)
10+
],
11+
products: [
12+
// Products define the executables and libraries a package produces, and make them visible to other packages.
13+
.library(
14+
name: "MosaiqueAssetsPicker",
15+
targets: ["MosaiqueAssetsPicker"]),
16+
],
17+
dependencies: [
18+
// Dependencies declare other packages that this package depends on.
19+
// .package(url: /* package url */, from: "1.0.0"),
20+
],
21+
targets: [
22+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
23+
// Targets can depend on other targets in this package, and on products in packages this package depends on.
24+
.target(
25+
name: "MosaiqueAssetsPicker",
26+
dependencies: [],
27+
path: "Sources/MosaiqueAssetsPicker",
28+
exclude:["Info.plist"]
29+
),
30+
.testTarget(
31+
name: "MosaiqueAssetsPickerTests",
32+
dependencies: ["MosaiqueAssetsPicker"],
33+
path: "Tests/AssetsPickerTests",
34+
exclude:["Info.plist"]
35+
),
36+
],
37+
swiftLanguageVersions: [.v5]
38+
)

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,14 @@ You can default to it if the user runs iOS 14 by using the new API:
140140

141141
```pod 'MosaiqueAssetsPicker'```
142142

143+
### SPM:
144+
145+
```
146+
dependencies: [
147+
.package(url: "https://github.com/eure/AssetsPicker.git", .upToNextMajor(from: "1.3.0"))
148+
]
149+
```
150+
143151
### What's using MosaiqueAssetsPicker
144152

145153
- Pairs Engage

Sources/MosaiqueAssetsPicker/Configuration/MosaiqueAssetPickerConfiguration.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright © 2018 eureka, Inc. All rights reserved.
77
//
88

9+
#if os(iOS)
10+
911
import Foundation
1012
import enum Photos.PHAssetMediaType
1113
import PhotosUI
@@ -109,3 +111,4 @@ public struct MosaiqueAssetPickerConfiguration {
109111

110112
public init() {}
111113
}
114+
#endif

Sources/MosaiqueAssetsPicker/Utils/AssetFuture.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2019 eureka, Inc. All rights reserved.
77
//
88

9+
#if os(iOS)
910
import Foundation
1011
import Photos
1112
import PhotosUI
@@ -208,3 +209,4 @@ public class AssetFuture {
208209
}
209210
}
210211
}
212+
#endif

Sources/MosaiqueAssetsPicker/Utils/AssetPickerCellRegistrator.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2018 eureka, Inc. All rights reserved.
77
//
88

9+
#if os(iOS)
910
import Foundation
1011
import UIKit
1112

@@ -60,3 +61,4 @@ public class AssetPickerCellRegistrator {
6061
customAssetItemClasses[cellType] = (cellClass, cellIdentifier)
6162
}
6263
}
64+
#endif

Sources/MosaiqueAssetsPicker/Utils/MosaiqueAssetPickerPresenter.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2020 eureka, Inc. All rights reserved.
77
//
88

9+
#if os(iOS)
910
import Foundation
1011
import Photos
1112
import PhotosUI
@@ -69,3 +70,4 @@ public final class MosaiqueAssetPickerPresenter: PHPickerViewControllerDelegate
6970
}
7071
}
7172
}
73+
#endif

Sources/MosaiqueAssetsPicker/Utils/NSLock+exec.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2019 eureka, Inc. All rights reserved.
77
//
88

9+
#if os(iOS)
910
import Foundation
1011

1112
extension NSLock {
@@ -16,3 +17,4 @@ extension NSLock {
1617
return result
1718
}
1819
}
20+
#endif

Sources/MosaiqueAssetsPicker/Utils/NotificationCenter+assetPicker.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2019 eureka, Inc. All rights reserved.
77
//
88

9+
#if os(iOS)
910
import Foundation
1011

1112
let PhotoPickerPickAssetsNotificationName = NSNotification.Name(rawValue: "jp.eure.assetspicke.PhotoPickerPickAssestNotification")
@@ -14,3 +15,4 @@ let PhotoPickerCancelNotificationName = NSNotification.Name(rawValue: "jp.eure.a
1415
extension NotificationCenter {
1516
static let assetPicker = NotificationCenter()
1617
}
18+
#endif

Sources/MosaiqueAssetsPicker/Utils/SelectionContainer.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © 2018 eureka, Inc. All rights reserved.
77
//
88

9+
#if os(iOS)
910
import Foundation
1011
import Photos
1112

@@ -75,3 +76,4 @@ public final class SelectionContainer<T: ItemIdentifier> {
7576
selectedItems = []
7677
}
7778
}
79+
#endif

Sources/MosaiqueAssetsPicker/Utils/ViewSizeCalculator.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2121
// THE SOFTWARE.
2222

23+
#if os(iOS)
2324
import UIKit
2425

2526
public struct ViewSizeCalculator<T: UIView> {
@@ -67,3 +68,4 @@ public struct ViewSizeCalculator<T: UIView> {
6768
return size
6869
}
6970
}
71+
#endif

0 commit comments

Comments
 (0)