From df497ec18b60672db7aa8a221749bfa38afa485f Mon Sep 17 00:00:00 2001 From: wade Date: Sun, 20 Sep 2020 17:13:21 +0900 Subject: [PATCH] SPM Support --- Package.swift | 31 ++++++++++++++++++ README.md | 10 ++++++ TLPhotoPicker.podspec | 2 +- TLPhotoPicker/Assets.xcassets/Contents.json | 6 ++++ .../arrow.imageset/Contents.json | 21 ++++++++++++ .../Assets.xcassets/arrow.imageset/arrow.png | Bin 0 -> 1105 bytes .../camera.imageset/Contents.json | 21 ++++++++++++ .../camera.imageset/camera@3x.png | Bin 0 -> 3079 bytes .../Contents.json | 21 ++++++++++++ .../insertPhotoMaterial@3x.png | Bin 0 -> 1672 bytes .../pop_arrow.imageset/Contents.json | 21 ++++++++++++ .../pop_arrow.imageset/pop_arrow.png | Bin 0 -> 1496 bytes .../video.imageset/Contents.json | 21 ++++++++++++ .../Assets.xcassets/video.imageset/video.png | Bin 0 -> 834 bytes TLPhotoPicker/Classes/TLBundle.swift | 8 +++-- .../Classes/TLCollectionTableViewCell.xib | 12 +++---- .../Classes/TLPhotoCollectionViewCell.xib | 12 +++---- TLPhotoPicker/Classes/TLPhotoLibrary.swift | 2 +- .../TLPhotopickerDataSourcesProtocol.swift | 2 +- .../Classes/TLPhotosPickerViewController.xib | 16 +++++---- TLPhotoPicker/TLBundle+SPM.swift | 25 ++++++++++++++ 21 files changed, 206 insertions(+), 25 deletions(-) create mode 100644 Package.swift create mode 100644 TLPhotoPicker/Assets.xcassets/Contents.json create mode 100644 TLPhotoPicker/Assets.xcassets/arrow.imageset/Contents.json create mode 100644 TLPhotoPicker/Assets.xcassets/arrow.imageset/arrow.png create mode 100644 TLPhotoPicker/Assets.xcassets/camera.imageset/Contents.json create mode 100644 TLPhotoPicker/Assets.xcassets/camera.imageset/camera@3x.png create mode 100644 TLPhotoPicker/Assets.xcassets/insertPhotoMaterial.imageset/Contents.json create mode 100644 TLPhotoPicker/Assets.xcassets/insertPhotoMaterial.imageset/insertPhotoMaterial@3x.png create mode 100644 TLPhotoPicker/Assets.xcassets/pop_arrow.imageset/Contents.json create mode 100644 TLPhotoPicker/Assets.xcassets/pop_arrow.imageset/pop_arrow.png create mode 100644 TLPhotoPicker/Assets.xcassets/video.imageset/Contents.json create mode 100644 TLPhotoPicker/Assets.xcassets/video.imageset/video.png create mode 100644 TLPhotoPicker/TLBundle+SPM.swift diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..894defe8 --- /dev/null +++ b/Package.swift @@ -0,0 +1,31 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "TLPhotoPicker", + platforms: [ + .iOS(.v10) + ], + products: [ + // Products define the executables and libraries produced by a package, and make them visible to other packages. + .library( + name: "TLPhotoPicker", + targets: ["TLPhotoPicker"] + ), + ], + targets: [ + .target( + name: "TLPhotoPicker", + path: "TLPhotoPicker", + exclude: ["Classes/TLBundle.swift"], + resources: [ + .process("TLPhotoPicker/Classes/TLCollectionTableViewCell.xib"), + .process("TLPhotoPicker/Classes/TLPhotoCollectionViewCell.xib"), + .process("TLPhotoPicker/Classes/TLPhotosPickerViewController.xib"), + .process("TLPhotoPicker/Assets.xcassets") + ] + ) + ] +) diff --git a/README.md b/README.md index 10625d2d..5fb1ef35 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,16 @@ Specify TLPhotoPicker into your project's Cartfile: github "tilltue/TLPhotoPicker" ``` +### Swift Package Manager + +The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but TLPhotoPicker does support its use on supported platforms. + +Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the dependencies value of your Package.swift. + +dependencies: [ + .package(url: "https://github.com/tilltue/TLPhotoPicker.git", .upToNextMajor(from: "2.1.0")) +] + > Don't forget the Privacy Description in `info.plist`. diff --git a/TLPhotoPicker.podspec b/TLPhotoPicker.podspec index f7609580..ba9cc4a0 100644 --- a/TLPhotoPicker.podspec +++ b/TLPhotoPicker.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'TLPhotoPicker' - s.version = '2.0.12' + s.version = '2.1.0' s.summary = 'multiple phassets picker for iOS lib. like facebook' # This description is used to generate tags and improve search results. diff --git a/TLPhotoPicker/Assets.xcassets/Contents.json b/TLPhotoPicker/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/TLPhotoPicker/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TLPhotoPicker/Assets.xcassets/arrow.imageset/Contents.json b/TLPhotoPicker/Assets.xcassets/arrow.imageset/Contents.json new file mode 100644 index 00000000..4ce84168 --- /dev/null +++ b/TLPhotoPicker/Assets.xcassets/arrow.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "arrow.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TLPhotoPicker/Assets.xcassets/arrow.imageset/arrow.png b/TLPhotoPicker/Assets.xcassets/arrow.imageset/arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..94910cf0960045e5764820649279ea9a89858425 GIT binary patch literal 1105 zcmaJ=TWkzb7(Ut(ZMJcF(6l5@W>tvp&Sft(ldg8nwrpaWX1nNvhtAHNb|>vz%$(ZU zB1+R*BrXXNp77vF1o6ZJi6)5f;F2JM;K3V>Y8oM&sqXS%O>*Y^|H=1#|K-s z+M0$M06=YWb0S6drQTY&fc&>TI=Y=~^|-wUcbk1UC))_bRWpNNQkVNt3dw4I=Y7-y zK&4+x_uw9Bi=dc#Q1&oESGNcofR%_ZhUWMH%L?IUfsMksk0Q}*wNFSTI_6>#FGgiCwgj5a z<#NGXC}`UKG|Tfm&2Tiw1qdSGAZ#L6mrZVTOk+M=l4Qcf@mWd zn|9hX2a8?o%9_}8vZe(^5w4MBMKe5q?JPl(grwnM*-%h25u=DiP}5W)%=2uNXF}^m zVzBL@c(W*WFzZ9{Fwb#JC|cwuOl3$%1}<{dKiqIxt~U$1MItAVt?fc;hi&R`wq`*q zp9@=7Z;q>$&xI??rAachce8)pbn%Fck7t(VmN=!!M+O;po6L1*_2-M^O-v*c@wEFg z^Zn<~*2)O*Kl5?X=*7eFExvRG9PI;>`)VeA$K(07J%x(9E2_@S<383cJ_sg7&X)%h z=V7QZJ2yhb9l^q2Yvz1 C>1Ja9 literal 0 HcmV?d00001 diff --git a/TLPhotoPicker/Assets.xcassets/camera.imageset/Contents.json b/TLPhotoPicker/Assets.xcassets/camera.imageset/Contents.json new file mode 100644 index 00000000..d5ba6f34 --- /dev/null +++ b/TLPhotoPicker/Assets.xcassets/camera.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "camera@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TLPhotoPicker/Assets.xcassets/camera.imageset/camera@3x.png b/TLPhotoPicker/Assets.xcassets/camera.imageset/camera@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..2c7ebe0c7cd6f9ccd69effbf7ce4e2e93da3b0da GIT binary patch literal 3079 zcma)8dpr}~`&aJ6uvUpFiCU~&J|&9DWtn@Jwaxu9X>82qmTMF?mvWm(;0U|>zwDD=bVRj)yhNyAPeB*Bf`!hhR{zU_eE%*P7a-yvUh@h6zTwGHKdmYZji<09z1_laHI~ z&vf)Ojm$sNX1YA6BgwRi=z?@vqoj-z$yX0bDIGF!m*&Aei~tS6gTKsO`Y)p){#%Fp z(*55huQHS}%9OJ;_vBFIIB1TE)_ik_ea5?@otNA<*t3kkCsUoGI(MdRl^y4w!EQJi^ z&O&c|YdKz&1;t_22pZM>D`!nXXVZ>+2?#}|-6qu2y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Qck@V-?4_ZZgAum}+Wp^8~z z($I(4W!7<%J_+)Ys`NDI~1p? literal 0 HcmV?d00001 diff --git a/TLPhotoPicker/Assets.xcassets/insertPhotoMaterial.imageset/Contents.json b/TLPhotoPicker/Assets.xcassets/insertPhotoMaterial.imageset/Contents.json new file mode 100644 index 00000000..1cd723ea --- /dev/null +++ b/TLPhotoPicker/Assets.xcassets/insertPhotoMaterial.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "insertPhotoMaterial@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/TLPhotoPicker/Assets.xcassets/insertPhotoMaterial.imageset/insertPhotoMaterial@3x.png b/TLPhotoPicker/Assets.xcassets/insertPhotoMaterial.imageset/insertPhotoMaterial@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..19a8656929646848f76a5e18066902823ea0e839 GIT binary patch literal 1672 zcmd^==|9v70LFhaV`NMS%NRKl;}|(7SE6y7Msh834zkEK61ho^9Jw~v5>YwA$jzb# zX@zx7V-|yC*~S$a!;-Q3JNCu%e4iK3+voG7Sy`I#aEo#S0KkJYH?}!t#1CLT$_p0n(Tl0{}P;amEIA5unYd8F{6e=S+IrwZexjQU9K}k5a<(!b-I#Jsj-D zFR46mW70`e7qJP45=l;pvt7|mK`KVM9a6n8hQ7=+uKAEVhNn;_7RCrQ=exP?p%!?b zQj*$$jX8NDobKn~1=UYp{}nhHT?Htf@mx5iz2e)hLBLk9)MTZ~26b?DdAR%af!Yh5 z1Hn{ZTQ4YKFVK8vN6-ErQB~qw$$fOFCN$!k8@4@R1~-!b)ET5LkaYa;d{eeJu3T}q zf-G{)gls&b_H|%zjs-4I6@Qkc*wK)t`!&@R?ou|RUe4VERmIr-AV`&xeM&l{NM^T| zj0dq`no$}+mZH-YJ8ZU3s#OCX96%)&AqfAw_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}D>q`P9{>OV M07*qoM6N<$g4GI$?EnA( literal 0 HcmV?d00001 diff --git a/TLPhotoPicker/Classes/TLBundle.swift b/TLPhotoPicker/Classes/TLBundle.swift index dca3da27..2d924e2a 100644 --- a/TLPhotoPicker/Classes/TLBundle.swift +++ b/TLPhotoPicker/Classes/TLBundle.swift @@ -6,14 +6,18 @@ // // -import Foundation +import UIKit open class TLBundle { open class func podBundleImage(named: String) -> UIImage? { let podBundle = Bundle(for: TLBundle.self) if let url = podBundle.url(forResource: "TLPhotoPickerController", withExtension: "bundle") { let bundle = Bundle(url: url) - return UIImage(named: named, in: bundle, compatibleWith: nil)! + return UIImage(named: named, in: bundle, compatibleWith: nil) + } + if let url = podBundle.url(forResource: named, withExtension: "png") { + let bundle = Bundle(url: url) + return UIImage(named: named, in: bundle, compatibleWith: nil) } return nil } diff --git a/TLPhotoPicker/Classes/TLCollectionTableViewCell.xib b/TLPhotoPicker/Classes/TLCollectionTableViewCell.xib index 7eab2b77..e8c682c2 100644 --- a/TLPhotoPicker/Classes/TLCollectionTableViewCell.xib +++ b/TLPhotoPicker/Classes/TLCollectionTableViewCell.xib @@ -1,15 +1,15 @@ - + - + - + @@ -24,16 +24,16 @@ - +