Skip to content

Commit

Permalink
Add SwiftPM manifest and localized string lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbuenemann committed Sep 26, 2020
1 parent f34bf7b commit c23fd76
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -37,7 +37,9 @@ playground.xcworkspace
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
Package.resolved
.build/
.swiftpm/

# CocoaPods
#
Expand Down
Expand Up @@ -15,7 +15,11 @@ extension String {
let customConfig = AssetsPickerConfig.customStringConfig,
let localizedKey = AssetsPickerLocalizedStringKey(rawValue: key),
let string = customConfig[localizedKey] else {
#if SWIFT_PACKAGE
self = Bundle.module.localizedString(forKey: key, value: key, table: "AssetsPickerViewController")
#else
self = Bundle.assetsPickerBundle.localizedString(forKey: key, value: key, table: "AssetsPickerViewController")
#endif
return
}
self = string
Expand Down
27 changes: 27 additions & 0 deletions Package.swift
@@ -0,0 +1,27 @@
// swift-tools-version:5.3
import PackageDescription

let package = Package(
name: "AssetsPickerViewController",
defaultLocalization: "en",
platforms: [.iOS(.v10)],
products: [
.library(
name: "AssetsPickerViewController",
targets: ["AssetsPickerViewController"]
)
],
dependencies: [
.package(url: "https://github.com/SnapKit/SnapKit", from: "5.0.1")
],
targets: [
.target(
name: "AssetsPickerViewController",
dependencies: ["SnapKit"],
path: "AssetsPickerViewController",
sources: ["Classes"],
resources: [.process("Assets")]
)
],
swiftLanguageVersions: [.v4_2, .v5]
)
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -101,10 +101,10 @@ Customizable Album & Asset Layout

- multiple selection by dragging cells (from iOS 13)

- SPM(Swift Package Manager) support

## Features To-do

- SPM(Swift Package Manager) support
## Features To-do

- Cropping image before select

Expand Down

0 comments on commit c23fd76

Please sign in to comment.