Update podspec only Source
This commit is contained in:
-91
@@ -1,91 +0,0 @@
|
||||
|
||||
|
||||
|
||||
import UIKit
|
||||
import ContainerControllerSwift
|
||||
|
||||
|
||||
class ExampleCollectionItem: CollectionAdapterItem {
|
||||
|
||||
init(width: CGFloat,
|
||||
padding: CGFloat,
|
||||
clickCallback: (() -> Void)? = nil) {
|
||||
|
||||
let cellData = ExampleCollectionCellData(width, padding, clickCallback)
|
||||
|
||||
super.init(cellClass: ExampleCollectionCell.self, cellData: cellData)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ExampleCollectionCellData: CollectionAdapterCellData {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
public var width: CGFloat
|
||||
public var padding: CGFloat
|
||||
public var clickCallback: (() -> Void)?
|
||||
|
||||
// MARK: Inits
|
||||
|
||||
public init (_ width: CGFloat,
|
||||
_ padding: CGFloat,
|
||||
_ clickCallback: (() -> Void)?) {
|
||||
|
||||
self.width = width
|
||||
self.padding = padding
|
||||
self.clickCallback = clickCallback
|
||||
|
||||
super.init()
|
||||
}
|
||||
|
||||
override public func size() -> CGSize {
|
||||
let w = (width / 2) - ((padding / 2) * 3)
|
||||
return CGSize(width: w, height: w)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class ExampleCollectionCell: CollectionAdapterCell {
|
||||
|
||||
// MARK: Outlets
|
||||
|
||||
@IBOutlet weak var imageButton: DesignButton?
|
||||
@IBOutlet weak var titleLabel: UILabel?
|
||||
@IBOutlet weak var subtitleLabel: UILabel?
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
public var data: ExampleCollectionCellData?
|
||||
|
||||
override func awakeFromNib() {
|
||||
|
||||
}
|
||||
|
||||
override func fill(data: Any?) {
|
||||
|
||||
guard let data = data as? ExampleCollectionCellData else { return }
|
||||
self.data = data
|
||||
|
||||
let randomInt = Int.random(in: 0..<6)
|
||||
|
||||
var color: UIColor = .systemBlue
|
||||
|
||||
switch randomInt {
|
||||
case 0: color = .systemBlue
|
||||
case 1: color = .systemRed
|
||||
case 2: color = .systemGray
|
||||
case 3: color = .systemGreen
|
||||
case 4: color = .systemYellow
|
||||
case 5: color = .systemOrange
|
||||
default: break
|
||||
}
|
||||
|
||||
imageButton?.layer.backgroundColor = color.cgColor
|
||||
imageButton?.fillColor = color
|
||||
}
|
||||
|
||||
@IBAction func buttonClickAction(_ sender: Any) {
|
||||
data?.clickCallback?()
|
||||
}
|
||||
}
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<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" id="gTV-IL-0wX" customClass="ExampleCollectionCell" customModule="ContainerController" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="135" height="132"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
|
||||
<rect key="frame" x="0.0" y="0.0" width="135" height="132"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="LEH-bq-86c">
|
||||
<rect key="frame" x="0.0" y="0.0" width="135" height="132"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="gSI-Iw-oJa" customClass="DesignButton" customModule="ContainerController" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="0.0" width="135" height="132"/>
|
||||
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
|
||||
<real key="value" value="12"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="color" keyPath="fillColor">
|
||||
<color key="value" red="0.0" green="0.68235294120000001" blue="0.93725490199999995" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<action selector="buttonClickAction:" destination="gTV-IL-0wX" eventType="touchUpInside" id="h1P-jY-xGs"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="gSI-Iw-oJa" secondAttribute="bottom" id="G8K-Pi-exg"/>
|
||||
<constraint firstItem="gSI-Iw-oJa" firstAttribute="leading" secondItem="LEH-bq-86c" secondAttribute="leading" id="XMR-dX-hy2"/>
|
||||
<constraint firstAttribute="trailing" secondItem="gSI-Iw-oJa" secondAttribute="trailing" id="jgw-rR-x72"/>
|
||||
<constraint firstItem="gSI-Iw-oJa" firstAttribute="top" secondItem="LEH-bq-86c" secondAttribute="top" id="x4f-qZ-COE"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="LEH-bq-86c" secondAttribute="trailing" id="G8N-J0-CSq"/>
|
||||
<constraint firstItem="LEH-bq-86c" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="dbr-mp-YyA"/>
|
||||
<constraint firstAttribute="bottom" secondItem="LEH-bq-86c" secondAttribute="bottom" id="hRo-ja-sYz"/>
|
||||
<constraint firstItem="LEH-bq-86c" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="lyJ-5L-dyH"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
|
||||
<size key="customSize" width="135" height="132"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="hideAnimation" value="NO"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
<connections>
|
||||
<outlet property="imageButton" destination="gSI-Iw-oJa" id="qP3-Hl-7ap"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="113.768115942029" y="78.348214285714278"/>
|
||||
</collectionViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
Reference in New Issue
Block a user