Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #7 from screeningeagledreamlab/add-spm-support
Browse files Browse the repository at this point in the history
Add Swift Package Manager support
  • Loading branch information
hujunfeng authored Jul 5, 2022
2 parents 43e1939 + e8b4d65 commit 8b1c455
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 18 deletions.
8 changes: 4 additions & 4 deletions AssetsPicker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -588,7 +588,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand All @@ -611,7 +611,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/AssetsPickerViewController/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -636,7 +636,7 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = "$(SRCROOT)/AssetsPickerViewController/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
8 changes: 0 additions & 8 deletions AssetsPickerViewController/Classes/Assets/AssetsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,6 @@ extension AssetsManager {
return .smartAlbum
case 1:
return .album
case 2:
return .moment
default:
loge("Section number error: \(section)")
return .album
Expand Down Expand Up @@ -461,12 +459,6 @@ extension AssetsManager {
sortedAlbumsArray.append(albumEntry.sortedAlbums)
albumsFetchArray.append(albumEntry.fetchResult)

if pickerConfig.albumIsShowMomentAlbums {
let momentEntry = fetchAlbums(forAlbumType: .moment)
fetchedAlbumsArray.append(momentEntry.fetchedAlbums)
sortedAlbumsArray.append(momentEntry.sortedAlbums)
albumsFetchArray.append(momentEntry.fetchResult)
}
isFetchedAlbums = true
}
// notify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
//

import UIKit

fileprivate let kDimmerViewKey = "kDimmerViewKey"
fileprivate let kDimmerView = "kDimmerView"
fileprivate let kDimmerViewRatio = "kDimmerViewRatio"
Expand Down Expand Up @@ -88,7 +90,7 @@ extension UIView {
return view
}

fileprivate func createDimmerActivityView(style: UIActivityIndicatorView.Style = .gray) -> UIActivityIndicatorView {
fileprivate func createDimmerActivityView(style: UIActivityIndicatorView.Style = .medium) -> UIActivityIndicatorView {
let activityIndicator = UIActivityIndicatorView(style: style)
return activityIndicator
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import UIKit

open class PanoramaIconView: UIView {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ open class AssetsPickerConfig {
PHAssetCollectionType: ((PHAssetCollection, PHFetchResult<PHAsset>) -> Bool)
]?

/// Not yet fully implemeted, do not set this true until it's completed.
open var albumIsShowMomentAlbums: Bool = false

// MARK: Fetch
open var albumFetchOptions: [PHAssetCollectionType: PHFetchOptions]?

Expand Down Expand Up @@ -175,8 +172,7 @@ open class AssetsPickerConfig {
options.predicate = NSPredicate(format: "mediaType = %d OR mediaType = %d", PHAssetMediaType.image.rawValue, PHAssetMediaType.video.rawValue)
assetFetchOptions = [
.smartAlbum: options,
.album: options,
.moment: options
.album: options
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by DragonCherry on 19/12/2017.
//

import UIKit

extension Device {
static func safeAreaInsets(isPortrait: Bool) -> UIEdgeInsets {
let size = Device.size()
Expand Down
31 changes: 31 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "AssetsPicker",
defaultLocalization: "en",
platforms: [.iOS(.v13)],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "AssetsPicker",
targets: ["AssetsPicker"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "AssetsPicker",
dependencies: [],
path: "AssetsPickerViewController",
exclude: ["Info.plist"],
resources: [.process("Assets")]
),
]
)

0 comments on commit 8b1c455

Please sign in to comment.