Skip to content

Commit f270ec1

Browse files
kahayashkahayash
authored andcommitted
add new sample vc
1 parent 21269ee commit f270ec1

File tree

5 files changed

+333
-5
lines changed

5 files changed

+333
-5
lines changed

iOS Sample/iOS Sample.xcodeproj/project.pbxproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
2B47E7341F109DE400D67C04 /* OverlayFocusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B47E7331F109DE400D67C04 /* OverlayFocusView.swift */; };
1414
2B47E7361F10A15700D67C04 /* OverlayMenuCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B47E7351F10A15700D67C04 /* OverlayMenuCell.swift */; };
1515
2B47E7401F10C08C00D67C04 /* PagingKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2B47E73F1F10C08C00D67C04 /* PagingKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
16+
2BC1B4181F19F29800829D1A /* TagViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BC1B4171F19F29800829D1A /* TagViewController.swift */; };
17+
2BC1B41A1F19F4CB00829D1A /* TagMenuCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BC1B4191F19F4CB00829D1A /* TagMenuCell.swift */; };
18+
2BC1B41C1F19F4DF00829D1A /* TagMenuCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2BC1B41B1F19F4DF00829D1A /* TagMenuCell.xib */; };
1619
2BFA4AC31F0CEC39001B9BCA /* ModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BFA4AC21F0CEC39001B9BCA /* ModalViewController.swift */; };
1720
6E98277A1F0A91F400860828 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E9827791F0A91F400860828 /* AppDelegate.swift */; };
1821
6E98277C1F0A91F400860828 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E98277B1F0A91F400860828 /* ViewController.swift */; };
@@ -65,6 +68,9 @@
6568
2B47E7331F109DE400D67C04 /* OverlayFocusView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OverlayFocusView.swift; sourceTree = "<group>"; };
6669
2B47E7351F10A15700D67C04 /* OverlayMenuCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OverlayMenuCell.swift; sourceTree = "<group>"; };
6770
2B47E73F1F10C08C00D67C04 /* PagingKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PagingKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
71+
2BC1B4171F19F29800829D1A /* TagViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TagViewController.swift; sourceTree = "<group>"; };
72+
2BC1B4191F19F4CB00829D1A /* TagMenuCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TagMenuCell.swift; sourceTree = "<group>"; };
73+
2BC1B41B1F19F4DF00829D1A /* TagMenuCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TagMenuCell.xib; sourceTree = "<group>"; };
6874
2BFA4AC21F0CEC39001B9BCA /* ModalViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ModalViewController.swift; sourceTree = "<group>"; };
6975
6E9827761F0A91F400860828 /* iOS Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Sample.app"; sourceTree = BUILT_PRODUCTS_DIR; };
7076
6E9827791F0A91F400860828 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -135,6 +141,16 @@
135141
name = Overlay;
136142
sourceTree = "<group>";
137143
};
144+
2BC1B4161F19E75A00829D1A /* Tag */ = {
145+
isa = PBXGroup;
146+
children = (
147+
2BC1B4171F19F29800829D1A /* TagViewController.swift */,
148+
2BC1B4191F19F4CB00829D1A /* TagMenuCell.swift */,
149+
2BC1B41B1F19F4DF00829D1A /* TagMenuCell.xib */,
150+
);
151+
name = Tag;
152+
sourceTree = "<group>";
153+
};
138154
6E98276D1F0A91F400860828 = {
139155
isa = PBXGroup;
140156
children = (
@@ -160,6 +176,7 @@
160176
6E9827781F0A91F400860828 /* iOS Sample */ = {
161177
isa = PBXGroup;
162178
children = (
179+
2BC1B4161F19E75A00829D1A /* Tag */,
163180
2B47E7421F10C13600D67C04 /* Overlay */,
164181
2B47E7411F10C12400D67C04 /* Simple */,
165182
6E9827791F0A91F400860828 /* AppDelegate.swift */,
@@ -311,6 +328,7 @@
311328
buildActionMask = 2147483647;
312329
files = (
313330
6E9827841F0A91F400860828 /* LaunchScreen.storyboard in Resources */,
331+
2BC1B41C1F19F4DF00829D1A /* TagMenuCell.xib in Resources */,
314332
2B47E72C1F0FB89200D67C04 /* OverlayMenuCell.xib in Resources */,
315333
6E9827811F0A91F400860828 /* Assets.xcassets in Resources */,
316334
6E9827BD1F0A947B00860828 /* MenuCell.xib in Resources */,
@@ -347,6 +365,8 @@
347365
6E98277C1F0A91F400860828 /* ViewController.swift in Sources */,
348366
6E98277A1F0A91F400860828 /* AppDelegate.swift in Sources */,
349367
2B47E7341F109DE400D67C04 /* OverlayFocusView.swift in Sources */,
368+
2BC1B4181F19F29800829D1A /* TagViewController.swift in Sources */,
369+
2BC1B41A1F19F4CB00829D1A /* TagMenuCell.swift in Sources */,
350370
6E9827BC1F0A947B00860828 /* MenuCell.swift in Sources */,
351371
2B47E7361F10A15700D67C04 /* OverlayMenuCell.swift in Sources */,
352372
);

iOS Sample/iOS Sample/Base.lproj/Main.storyboard

Lines changed: 98 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
</viewController>
152152
<placeholder placeholderIdentifier="IBFirstResponder" id="IZ0-r7-U6t" userLabel="First Responder" sceneMemberID="firstResponder"/>
153153
</objects>
154-
<point key="canvasLocation" x="92" y="1118"/>
154+
<point key="canvasLocation" x="42" y="1877"/>
155155
</scene>
156156
<!--Modal View Controller-->
157157
<scene sceneID="70g-9e-3TU">
@@ -178,7 +178,7 @@
178178
<placeholder placeholderIdentifier="IBFirstResponder" id="a2d-nm-4aZ" userLabel="First Responder" sceneMemberID="firstResponder"/>
179179
<exit id="RWi-X7-NgC" userLabel="Exit" sceneMemberID="exit"/>
180180
</objects>
181-
<point key="canvasLocation" x="1662" y="1118"/>
181+
<point key="canvasLocation" x="1678" y="1877"/>
182182
</scene>
183183
<!--Paging Menu View Controller-->
184184
<scene sceneID="8Ou-uv-ZeZ">
@@ -216,6 +216,51 @@
216216
</objects>
217217
<point key="canvasLocation" x="2897" y="367"/>
218218
</scene>
219+
<!--Tag View Controller-->
220+
<scene sceneID="oPV-AN-WU2">
221+
<objects>
222+
<viewController id="3sV-FM-ucq" customClass="TagViewController" customModule="iOS_Sample" customModuleProvider="target" sceneMemberID="viewController">
223+
<layoutGuides>
224+
<viewControllerLayoutGuide type="top" id="fEE-Oe-Who"/>
225+
<viewControllerLayoutGuide type="bottom" id="3uf-OA-APB"/>
226+
</layoutGuides>
227+
<view key="view" contentMode="scaleToFill" id="hgl-ic-oJD">
228+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
229+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
230+
<subviews>
231+
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UFx-uA-H3W">
232+
<rect key="frame" x="0.0" y="64" width="375" height="44"/>
233+
<constraints>
234+
<constraint firstAttribute="height" constant="44" id="y1O-TT-vXM"/>
235+
</constraints>
236+
<connections>
237+
<segue destination="1Uq-X9-N93" kind="embed" id="wte-H8-uDl"/>
238+
</connections>
239+
</containerView>
240+
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JU9-0f-zGi">
241+
<rect key="frame" x="0.0" y="108" width="375" height="559"/>
242+
<connections>
243+
<segue destination="LHN-Hm-I08" kind="embed" id="gFh-bG-zJt"/>
244+
</connections>
245+
</containerView>
246+
</subviews>
247+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
248+
<constraints>
249+
<constraint firstAttribute="trailing" secondItem="UFx-uA-H3W" secondAttribute="trailing" id="2K7-Iw-Lux"/>
250+
<constraint firstAttribute="trailing" secondItem="JU9-0f-zGi" secondAttribute="trailing" id="2nY-A4-Hdy"/>
251+
<constraint firstItem="JU9-0f-zGi" firstAttribute="top" secondItem="UFx-uA-H3W" secondAttribute="bottom" id="BMf-Mt-nWC"/>
252+
<constraint firstItem="JU9-0f-zGi" firstAttribute="leading" secondItem="hgl-ic-oJD" secondAttribute="leading" id="Ti5-6q-qQa"/>
253+
<constraint firstItem="3uf-OA-APB" firstAttribute="top" secondItem="JU9-0f-zGi" secondAttribute="bottom" id="YDT-yP-Kqb"/>
254+
<constraint firstItem="UFx-uA-H3W" firstAttribute="leading" secondItem="hgl-ic-oJD" secondAttribute="leading" id="uZc-Uo-RT8"/>
255+
<constraint firstItem="UFx-uA-H3W" firstAttribute="top" secondItem="fEE-Oe-Who" secondAttribute="bottom" id="w64-GO-vfx"/>
256+
</constraints>
257+
</view>
258+
<navigationItem key="navigationItem" id="OGo-Bo-YGc"/>
259+
</viewController>
260+
<placeholder placeholderIdentifier="IBFirstResponder" id="mWQ-LO-F1f" userLabel="First Responder" sceneMemberID="firstResponder"/>
261+
</objects>
262+
<point key="canvasLocation" x="1897" y="920"/>
263+
</scene>
219264
<!--Navigation Controller-->
220265
<scene sceneID="jJk-sC-SVx">
221266
<objects>
@@ -232,7 +277,7 @@
232277
</navigationController>
233278
<placeholder placeholderIdentifier="IBFirstResponder" id="nVP-xC-vdk" userLabel="First Responder" sceneMemberID="firstResponder"/>
234279
</objects>
235-
<point key="canvasLocation" x="821.60000000000002" y="1117.6911544227887"/>
280+
<point key="canvasLocation" x="866" y="1877"/>
236281
</scene>
237282
<!--Item-->
238283
<scene sceneID="yoN-o2-z1r">
@@ -304,13 +349,25 @@
304349
<segue destination="gb8-QE-wcY" kind="push" id="gGP-JO-Sbr"/>
305350
</connections>
306351
</tableViewCell>
307-
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KuI-vC-s6a">
352+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="kAV-9h-jYM" style="IBUITableViewCellStyleDefault" id="KuI-vC-s6a">
308353
<rect key="frame" x="0.0" y="88" width="375" height="44"/>
309354
<autoresizingMask key="autoresizingMask"/>
310355
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KuI-vC-s6a" id="aCH-Pd-QgG">
311-
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
356+
<rect key="frame" x="0.0" y="0.0" width="342" height="43.5"/>
312357
<autoresizingMask key="autoresizingMask"/>
358+
<subviews>
359+
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="tag" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kAV-9h-jYM">
360+
<rect key="frame" x="15" y="0.0" width="325" height="43.5"/>
361+
<autoresizingMask key="autoresizingMask"/>
362+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
363+
<nil key="textColor"/>
364+
<nil key="highlightedColor"/>
365+
</label>
366+
</subviews>
313367
</tableViewCellContentView>
368+
<connections>
369+
<segue destination="3sV-FM-ucq" kind="push" id="nQX-4L-VEr"/>
370+
</connections>
314371
</tableViewCell>
315372
</cells>
316373
</tableViewSection>
@@ -330,6 +387,10 @@
330387
<scene sceneID="QmH-At-Ehq">
331388
<objects>
332389
<viewController id="lQ9-Z3-8GP" customClass="PagingMenuViewController" customModule="PagingKit" sceneMemberID="viewController">
390+
<layoutGuides>
391+
<viewControllerLayoutGuide type="top" id="vHK-Dw-M25"/>
392+
<viewControllerLayoutGuide type="bottom" id="dB3-VM-fa3"/>
393+
</layoutGuides>
333394
<view key="view" contentMode="scaleToFill" id="icH-NR-T2e">
334395
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
335396
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -344,6 +405,10 @@
344405
<scene sceneID="YZ9-WH-ozQ">
345406
<objects>
346407
<viewController id="shz-gM-gB2" customClass="PagingContentViewController" customModule="PagingKit" sceneMemberID="viewController">
408+
<layoutGuides>
409+
<viewControllerLayoutGuide type="top" id="AV4-hi-FSH"/>
410+
<viewControllerLayoutGuide type="bottom" id="ovu-Kk-WLC"/>
411+
</layoutGuides>
347412
<view key="view" contentMode="scaleToFill" id="9Yr-k9-rCe">
348413
<rect key="frame" x="0.0" y="0.0" width="375" height="559"/>
349414
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -354,5 +419,33 @@
354419
</objects>
355420
<point key="canvasLocation" x="2655" y="-663"/>
356421
</scene>
422+
<!--Paging Menu View Controller-->
423+
<scene sceneID="bI2-7n-YZh">
424+
<objects>
425+
<viewController id="1Uq-X9-N93" customClass="PagingMenuViewController" customModule="PagingKit" sceneMemberID="viewController">
426+
<view key="view" contentMode="scaleToFill" id="LsX-7e-2FP">
427+
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
428+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
429+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
430+
</view>
431+
</viewController>
432+
<placeholder placeholderIdentifier="IBFirstResponder" id="LEd-K4-uKb" userLabel="First Responder" sceneMemberID="firstResponder"/>
433+
</objects>
434+
<point key="canvasLocation" x="2897" y="730"/>
435+
</scene>
436+
<!--Paging Content View Controller-->
437+
<scene sceneID="fQz-dM-x4j">
438+
<objects>
439+
<viewController id="LHN-Hm-I08" customClass="PagingContentViewController" customModule="PagingKit" sceneMemberID="viewController">
440+
<view key="view" contentMode="scaleToFill" id="MNe-g4-cJ4">
441+
<rect key="frame" x="0.0" y="0.0" width="375" height="559"/>
442+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
443+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
444+
</view>
445+
</viewController>
446+
<placeholder placeholderIdentifier="IBFirstResponder" id="XdD-cD-lxD" userLabel="First Responder" sceneMemberID="firstResponder"/>
447+
</objects>
448+
<point key="canvasLocation" x="2897" y="1118"/>
449+
</scene>
357450
</scenes>
358451
</document>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//
2+
// TagMenuCell.swift
3+
// iOS Sample
4+
//
5+
// Created by kahayash on 2017/07/15.
6+
// Copyright © 2017年 Kazuhiro Hayashi. All rights reserved.
7+
//
8+
9+
import UIKit
10+
import PagingKit
11+
12+
class TagMenuCell: PagingMenuCell {
13+
static let sizingCell = UINib(nibName: "TagMenuCell", bundle: nil).instantiate(withOwner: self, options: nil).first as! TagMenuCell
14+
15+
@IBOutlet weak var contentViewTopConstraint: NSLayoutConstraint!
16+
@IBOutlet weak var titieLabel: UILabel!
17+
@IBOutlet weak var contentView: UIView!
18+
19+
func focus(percent: CGFloat, animated: Bool = false) {
20+
contentViewTopConstraint.constant = 6 * (1 - percent) + 2
21+
if animated {
22+
UIView.perform(
23+
.delete,
24+
on: [],
25+
options: UIViewAnimationOptions(rawValue: 0),
26+
animations: { [weak self] in
27+
self?.contentView.setNeedsLayout()
28+
self?.contentView.layoutIfNeeded()
29+
},
30+
completion: { (finish) in }
31+
)
32+
}
33+
}
34+
35+
override func draw(_ rect: CGRect) {
36+
super.draw(rect)
37+
38+
let path = UIBezierPath(
39+
roundedRect: rect,
40+
byRoundingCorners: [.topLeft, .topRight],
41+
cornerRadii: CGSize(width: 6, height: 6)
42+
)
43+
let shapeLayer = CAShapeLayer()
44+
shapeLayer.frame = contentView.bounds
45+
shapeLayer.path = path.cgPath
46+
contentView.layer.mask = shapeLayer
47+
}
48+
}

0 commit comments

Comments
 (0)