Skip to content

Commit

Permalink
example update.
Browse files Browse the repository at this point in the history
  • Loading branch information
tilltue committed Nov 1, 2017
1 parent 5a72b56 commit 70ee382
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
18 changes: 13 additions & 5 deletions Example/TLPhotoPicker/Base.lproj/Main.storyboard
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.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13196" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13174"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand All @@ -22,18 +22,26 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="50" translatesAutoresizingMaskIntoConstraints="NO" id="3bJ-bG-tue">
<rect key="frame" x="73.5" y="272.5" width="227" height="122"/>
<rect key="frame" x="72.5" y="229.5" width="229" height="208"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zpy-9h-CPz">
<rect key="frame" x="0.0" y="0.0" width="227" height="36"/>
<rect key="frame" x="0.0" y="0.0" width="229" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<state key="normal" title="Show Picker"/>
<connections>
<action selector="pickerButtonTap" destination="vXZ-lx-hvc" eventType="touchUpInside" id="0Q7-5M-ogn"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="d6U-qB-bWX">
<rect key="frame" x="0.0" y="86" width="229" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<state key="normal" title="Custom CameraCell (Live)"/>
<connections>
<action selector="pickerWithCustomCameraCell" destination="vXZ-lx-hvc" eventType="touchUpInside" id="fXi-av-gMq"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="icR-mj-SY4">
<rect key="frame" x="0.0" y="86" width="227" height="36"/>
<rect key="frame" x="0.0" y="172" width="229" height="36"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<state key="normal" title="with NavigationController">
<color key="titleColor" red="0.1019607843" green="0.73725490199999999" blue="0.61176470589999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down
15 changes: 14 additions & 1 deletion Example/TLPhotoPicker/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,25 @@ class ViewController: UIViewController,TLPhotosPickerViewControllerDelegate {
configure.numberOfColumn = 3
//configure.maxSelectedAssets = 10
//configure.nibSet = (nibName: "CustomCell_Instagram", bundle: Bundle.main)
viewController.configure = configure
viewController.selectedAssets = self.selectedAssets

self.present(viewController, animated: true, completion: nil)
}

@IBAction func pickerWithCustomCameraCell() {
let viewController = CustomPhotoPickerViewController()
viewController.delegate = self
viewController.didExceedMaximumNumberOfSelection = { [weak self] (picker) in
self?.showAlert(vc: picker)
}
var configure = TLPhotosPickerConfigure()
configure.numberOfColumn = 3
if #available(iOS 10.2, *) {
configure.cameraCellNibSet = (nibName: "CustomCameraCell", bundle: Bundle.main)
}
viewController.configure = configure
viewController.selectedAssets = self.selectedAssets

self.present(viewController.wrapNavigationControllerWithoutBar(), animated: true, completion: nil)
}

Expand Down

0 comments on commit 70ee382

Please sign in to comment.