Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
major version: 1.0.0; example improved, readme updated.
- Loading branch information
Showing
15 changed files
with
501 additions
and
136 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 @@ | ||
// | ||
// EmbeddedCell.swift | ||
// UBottomSheet_Example | ||
// | ||
// Created by ugur on 27.04.2020. | ||
// Copyright © 2020 CocoaPods. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class EmbeddedCell: UITableViewCell, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { | ||
@IBOutlet weak var collectionView: UICollectionView! | ||
|
||
var items: [CollectionModel] = [] | ||
|
||
override func awakeFromNib() { | ||
super.awakeFromNib() | ||
// Initialization code | ||
|
||
collectionView.contentInset = UIEdgeInsets(top: 0, left: 15, bottom: 0, right: 0) | ||
collectionView.dataSource = self | ||
collectionView.delegate = self | ||
collectionView.alwaysBounceHorizontal = true | ||
collectionView.showsHorizontalScrollIndicator = false | ||
|
||
if #available(iOS 13.0, *) { | ||
items.append(CollectionModel(image: UIImage(systemName: "house.fill"), title: "Home")) | ||
items.append(CollectionModel(image: UIImage(systemName: "briefcase.fill"), title: "Work")) | ||
items.append(CollectionModel(image: UIImage(systemName: "plus"), title: "Add")) | ||
} else { | ||
items.append(CollectionModel(image: #imageLiteral(resourceName: "heart_icon"), title: "Home")) | ||
items.append(CollectionModel(image: #imageLiteral(resourceName: "heart_icon"), title: "Work")) | ||
items.append(CollectionModel(image: #imageLiteral(resourceName: "heart_icon"), title: "Add")) | ||
} | ||
} | ||
|
||
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { | ||
return CGSize(width: collectionView.frame.width/5, height: collectionView.frame.height) | ||
} | ||
|
||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | ||
return items.count | ||
} | ||
|
||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | ||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "SimpleCollectionCell", for: indexPath) as! SimpleCollectionCell | ||
cell.configure(with: items[indexPath.item]) | ||
return cell | ||
} | ||
|
||
} |
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,27 @@ | ||
// | ||
// LabelViewController.swift | ||
// UBottomSheet_Example | ||
// | ||
// Created by ugur on 27.04.2020. | ||
// Copyright © 2020 CocoaPods. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import UBottomSheet | ||
|
||
class LabelViewController: UIViewController, Draggable { | ||
var sheetCoordinator: UBottomSheetCoordinator? | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
sheetCoordinator?.startTracking(item: self) | ||
|
||
// Do any additional setup after loading the view. | ||
} | ||
|
||
@IBAction func dismissAction(){ | ||
sheetCoordinator?.removeSheetChild(item: self) | ||
} | ||
|
||
} |
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,54 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15705" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES"> | ||
<device id="retina6_1" orientation="portrait" appearance="light"/> | ||
<dependencies> | ||
<deployment identifier="iOS"/> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15706"/> | ||
<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" customClass="LabelViewController" customModule="UBottomSheet_Example" customModuleProvider="target"> | ||
<connections> | ||
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> | ||
</connections> | ||
</placeholder> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT"> | ||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yyc-yZ-Ncs"> | ||
<rect key="frame" x="20" y="94" width="374" height="30"/> | ||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="25"/> | ||
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MU4-6n-lj5"> | ||
<rect key="frame" x="341" y="44" width="73" height="72"/> | ||
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> | ||
<inset key="contentEdgeInsets" minX="20" minY="20" maxX="20" maxY="20"/> | ||
<state key="normal" image="xmark.circle.fill" catalog="system"> | ||
<preferredSymbolConfiguration key="preferredSymbolConfiguration" configurationType="pointSize" pointSize="21" scale="large" weight="black"/> | ||
</state> | ||
<connections> | ||
<action selector="dismissAction" destination="-1" eventType="touchUpInside" id="kja-Lm-Q8G"/> | ||
</connections> | ||
</button> | ||
</subviews> | ||
<color key="backgroundColor" red="0.0" green="0.40000000000000002" blue="1" alpha="1" colorSpace="calibratedRGB"/> | ||
<constraints> | ||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="yyc-yZ-Ncs" secondAttribute="trailing" constant="20" id="HA6-11-WRR"/> | ||
<constraint firstItem="yyc-yZ-Ncs" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="50" id="WHl-cy-Cg1"/> | ||
<constraint firstItem="yyc-yZ-Ncs" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="20" id="abQ-pj-GOi"/> | ||
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="MU4-6n-lj5" secondAttribute="trailing" id="ixT-Z6-cFi"/> | ||
<constraint firstItem="MU4-6n-lj5" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="sI9-pF-UAK"/> | ||
</constraints> | ||
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/> | ||
<point key="canvasLocation" x="139" y="100"/> | ||
</view> | ||
</objects> | ||
<resources> | ||
<image name="xmark.circle.fill" catalog="system" width="64" height="60"/> | ||
</resources> | ||
</document> |
Oops, something went wrong.