-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wade.hawk
authored and
wade.hawk
committed
May 15, 2017
1 parent
e88fd6f
commit 3070e65
Showing
9 changed files
with
300 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// CustomCell_Instagram.swift | ||
// TLPhotoPicker | ||
// | ||
// Created by wade.hawk on 2017. 5. 15.. | ||
// Copyright © 2017년 CocoaPods. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import TLPhotoPicker | ||
import PhotosUI | ||
|
||
class CustomCell_Instagram: TLPhotoCollectionViewCell { | ||
|
||
let selectedColor = UIColor(red: 88/255, green: 144/255, blue: 255/255, alpha: 1.0) | ||
|
||
override var duration: TimeInterval? { | ||
didSet { | ||
self.durationLabel?.isHidden = self.duration == nil ? true : false | ||
guard let duration = self.duration else { return } | ||
self.durationLabel?.text = timeFormatted(timeInterval: duration) | ||
} | ||
} | ||
|
||
override var isCameraCell: Bool { | ||
didSet { | ||
self.orderLabel?.isHidden = self.isCameraCell | ||
} | ||
} | ||
|
||
override public var selectedAsset: Bool { | ||
willSet(newValue) { | ||
self.orderLabel?.layer.borderColor = newValue ? self.selectedColor.cgColor : UIColor.white.cgColor | ||
self.orderLabel?.backgroundColor = newValue ? self.selectedColor : UIColor(red: 1, green: 1, blue: 1, alpha: 0.3) | ||
} | ||
} | ||
|
||
override func awakeFromNib() { | ||
super.awakeFromNib() | ||
self.durationView?.backgroundColor = UIColor.clear | ||
self.orderLabel?.clipsToBounds = true | ||
self.orderLabel?.layer.cornerRadius = 10 | ||
self.orderLabel?.layer.borderWidth = 1 | ||
self.orderLabel?.layer.borderColor = UIColor.white.cgColor | ||
} | ||
|
||
override open func prepareForReuse() { | ||
super.prepareForReuse() | ||
self.durationView?.backgroundColor = UIColor.clear | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12120" systemVersion="16E195" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> | ||
<device id="retina4_7" orientation="portrait"> | ||
<adaptation id="fullscreen"/> | ||
</device> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/> | ||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CustomCell_Instagram" id="9Rv-Fn-yCT" customClass="CustomCell_Instagram" customModule="TLPhotoPicker_Example" customModuleProvider="target"> | ||
<rect key="frame" x="0.0" y="0.0" width="100" height="100"/> | ||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> | ||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> | ||
<rect key="frame" x="0.0" y="0.0" width="100" height="100"/> | ||
<autoresizingMask key="autoresizingMask"/> | ||
<subviews> | ||
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="rOH-JI-pE1"> | ||
<rect key="frame" x="0.0" y="0.0" width="100" height="100"/> | ||
</imageView> | ||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="uwg-fz-Lnl"> | ||
<rect key="frame" x="0.0" y="0.0" width="100" height="100"/> | ||
<subviews> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JhX-P9-VnM"> | ||
<rect key="frame" x="75" y="5" width="20" height="20"/> | ||
<constraints> | ||
<constraint firstAttribute="width" secondItem="JhX-P9-VnM" secondAttribute="height" multiplier="1:1" id="HyJ-ox-Pd8"/> | ||
<constraint firstAttribute="width" constant="20" id="ZSd-26-g6g"/> | ||
</constraints> | ||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="13"/> | ||
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | ||
<constraints> | ||
<constraint firstAttribute="trailing" secondItem="JhX-P9-VnM" secondAttribute="trailing" constant="5" id="T4h-5Q-DtR"/> | ||
<constraint firstItem="JhX-P9-VnM" firstAttribute="top" secondItem="uwg-fz-Lnl" secondAttribute="top" constant="5" id="hIw-3h-tPP"/> | ||
</constraints> | ||
</view> | ||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="dN5-jZ-SiB"> | ||
<rect key="frame" x="0.0" y="75" width="100" height="25"/> | ||
<subviews> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0:02" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0AD-DJ-hk7"> | ||
<rect key="frame" x="30" y="0.0" width="65" height="25"/> | ||
<constraints> | ||
<constraint firstAttribute="width" constant="65" id="Hky-qZ-eo9"/> | ||
</constraints> | ||
<fontDescription key="fontDescription" type="system" pointSize="12"/> | ||
<color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> | ||
<constraints> | ||
<constraint firstAttribute="bottom" secondItem="0AD-DJ-hk7" secondAttribute="bottom" id="B6M-k2-HZD"/> | ||
<constraint firstAttribute="trailing" secondItem="0AD-DJ-hk7" secondAttribute="trailing" constant="5" id="c2b-dQ-g7Y"/> | ||
<constraint firstAttribute="height" constant="25" id="fEJ-nX-P4S"/> | ||
<constraint firstItem="0AD-DJ-hk7" firstAttribute="top" secondItem="dN5-jZ-SiB" secondAttribute="top" id="uOO-Wg-zvQ"/> | ||
</constraints> | ||
</view> | ||
<activityIndicatorView hidden="YES" opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" hidesWhenStopped="YES" style="gray" translatesAutoresizingMaskIntoConstraints="NO" id="1Zf-X9-xCZ"> | ||
<rect key="frame" x="40" y="40" width="20" height="20"/> | ||
</activityIndicatorView> | ||
</subviews> | ||
</view> | ||
<constraints> | ||
<constraint firstItem="1Zf-X9-xCZ" firstAttribute="centerX" secondItem="9Rv-Fn-yCT" secondAttribute="centerX" id="4EP-vr-Yn3"/> | ||
<constraint firstItem="dN5-jZ-SiB" firstAttribute="leading" secondItem="9Rv-Fn-yCT" secondAttribute="leading" id="81d-II-POL"/> | ||
<constraint firstItem="rOH-JI-pE1" firstAttribute="leading" secondItem="9Rv-Fn-yCT" secondAttribute="leading" id="KJ3-eV-OY7"/> | ||
<constraint firstAttribute="trailing" secondItem="dN5-jZ-SiB" secondAttribute="trailing" id="Mbt-2E-UCm"/> | ||
<constraint firstItem="uwg-fz-Lnl" firstAttribute="leading" secondItem="9Rv-Fn-yCT" secondAttribute="leading" id="N99-b3-cRO"/> | ||
<constraint firstAttribute="trailing" secondItem="rOH-JI-pE1" secondAttribute="trailing" id="Ry1-8z-byA"/> | ||
<constraint firstAttribute="bottom" secondItem="dN5-jZ-SiB" secondAttribute="bottom" id="SQo-t4-jNX"/> | ||
<constraint firstItem="1Zf-X9-xCZ" firstAttribute="centerY" secondItem="9Rv-Fn-yCT" secondAttribute="centerY" id="Ti5-PE-sjK"/> | ||
<constraint firstItem="rOH-JI-pE1" firstAttribute="top" secondItem="9Rv-Fn-yCT" secondAttribute="top" id="ZZd-iV-jqo"/> | ||
<constraint firstAttribute="bottom" secondItem="rOH-JI-pE1" secondAttribute="bottom" id="ZfF-qA-gEg"/> | ||
<constraint firstAttribute="bottom" secondItem="uwg-fz-Lnl" secondAttribute="bottom" id="dGK-ts-Oxc"/> | ||
<constraint firstAttribute="trailing" secondItem="uwg-fz-Lnl" secondAttribute="trailing" id="dkB-IK-EYy"/> | ||
<constraint firstItem="uwg-fz-Lnl" firstAttribute="top" secondItem="9Rv-Fn-yCT" secondAttribute="top" id="izZ-b1-P9h"/> | ||
</constraints> | ||
<connections> | ||
<outlet property="durationLabel" destination="0AD-DJ-hk7" id="fAK-hF-IpB"/> | ||
<outlet property="imageView" destination="rOH-JI-pE1" id="tgu-TV-hTi"/> | ||
<outlet property="indicator" destination="1Zf-X9-xCZ" id="b7n-5J-KNK"/> | ||
<outlet property="orderLabel" destination="JhX-P9-VnM" id="Oev-lS-XRO"/> | ||
</connections> | ||
<point key="canvasLocation" x="32" y="-10"/> | ||
</collectionViewCell> | ||
</objects> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.