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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
6 changes: 5 additions & 1 deletion TLPhotoPicker/Classes/TLPhotosPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public struct TLPhotosPickerConfigure {
public var muteAudio = true
public var mediaType: PHAssetMediaType? = nil
public var numberOfColumn = 3
public var spacingBetweenItems = CGFloat(5)
public var singleSelectedMode = false
public var maxSelectedAssets: Int? = nil
public var fetchOption: PHFetchOptions? = nil
Expand Down Expand Up @@ -262,9 +263,12 @@ extension TLPhotosPickerViewController {
fileprivate func initItemSize() {
guard let layout = self.collectionView.collectionViewLayout as? UICollectionViewFlowLayout else { return }
let count = CGFloat(self.configure.numberOfColumn)
let width = (self.view.frame.size.width-(5*(count-1)))/count
let spacingBetweenItems = max(0, configure.spacingBetweenItems)
let width = (self.view.frame.size.width - (spacingBetweenItems * (count - 1))) / count
self.thumbnailSize = CGSize(width: width, height: width)
layout.itemSize = self.thumbnailSize
layout.minimumInteritemSpacing = spacingBetweenItems
layout.minimumLineSpacing = spacingBetweenItems
self.collectionView.collectionViewLayout = layout
self.placeholderThumbnail = centerAtRect(image: self.configure.placeholderIcon, rect: CGRect(x: 0, y: 0, width: width, height: width))
self.cameraImage = centerAtRect(image: self.configure.cameraIcon, rect: CGRect(x: 0, y: 0, width: width, height: width), bgColor: self.configure.cameraBgColor)
Expand Down
10 changes: 5 additions & 5 deletions TLPhotoPicker/Classes/TLPhotosPickerViewController.xib
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
Expand Down Expand Up @@ -99,7 +99,7 @@
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" translatesAutoresizingMaskIntoConstraints="NO" id="4gR-Bn-quP">
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="5" minimumInteritemSpacing="5" id="VDa-Pp-VBq">
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="VDa-Pp-VBq">
<size key="itemSize" width="50" height="50"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
Expand Down Expand Up @@ -139,7 +139,7 @@
</constraints>
</view>
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="AEv-G6-dRI">
<rect key="frame" x="177" y="323" width="20" height="20"/>
<rect key="frame" x="177.5" y="323.5" width="20" height="20"/>
</activityIndicatorView>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jcn-hC-Umh" customClass="TLAlbumPopView" customModule="TLPhotoPicker" customModuleProvider="target">
<rect key="frame" x="0.0" y="64" width="375" height="603"/>
Expand All @@ -166,7 +166,7 @@
</constraints>
</view>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="5zn-je-qLx">
<rect key="frame" x="180" y="10" width="14" height="7"/>
<rect key="frame" x="180.5" y="10" width="14" height="7"/>
<constraints>
<constraint firstAttribute="height" constant="7" id="eZN-nB-EHu"/>
<constraint firstAttribute="width" constant="14" id="hWo-ji-iBX"/>
Expand Down