Skip to content

Commit

Permalink
add new sample vc
Browse files Browse the repository at this point in the history
  • Loading branch information
kahayash authored and kahayash committed Jul 15, 2017
1 parent 21269ee commit f270ec1
Show file tree
Hide file tree
Showing 5 changed files with 333 additions and 5 deletions.
20 changes: 20 additions & 0 deletions iOS Sample/iOS Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
2B47E7341F109DE400D67C04 /* OverlayFocusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B47E7331F109DE400D67C04 /* OverlayFocusView.swift */; };
2B47E7361F10A15700D67C04 /* OverlayMenuCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B47E7351F10A15700D67C04 /* OverlayMenuCell.swift */; };
2B47E7401F10C08C00D67C04 /* PagingKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2B47E73F1F10C08C00D67C04 /* PagingKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
2BC1B4181F19F29800829D1A /* TagViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BC1B4171F19F29800829D1A /* TagViewController.swift */; };
2BC1B41A1F19F4CB00829D1A /* TagMenuCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BC1B4191F19F4CB00829D1A /* TagMenuCell.swift */; };
2BC1B41C1F19F4DF00829D1A /* TagMenuCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2BC1B41B1F19F4DF00829D1A /* TagMenuCell.xib */; };
2BFA4AC31F0CEC39001B9BCA /* ModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BFA4AC21F0CEC39001B9BCA /* ModalViewController.swift */; };
6E98277A1F0A91F400860828 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E9827791F0A91F400860828 /* AppDelegate.swift */; };
6E98277C1F0A91F400860828 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E98277B1F0A91F400860828 /* ViewController.swift */; };
Expand Down Expand Up @@ -65,6 +68,9 @@
2B47E7331F109DE400D67C04 /* OverlayFocusView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OverlayFocusView.swift; sourceTree = "<group>"; };
2B47E7351F10A15700D67C04 /* OverlayMenuCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OverlayMenuCell.swift; sourceTree = "<group>"; };
2B47E73F1F10C08C00D67C04 /* PagingKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PagingKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2BC1B4171F19F29800829D1A /* TagViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TagViewController.swift; sourceTree = "<group>"; };
2BC1B4191F19F4CB00829D1A /* TagMenuCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TagMenuCell.swift; sourceTree = "<group>"; };
2BC1B41B1F19F4DF00829D1A /* TagMenuCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TagMenuCell.xib; sourceTree = "<group>"; };
2BFA4AC21F0CEC39001B9BCA /* ModalViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ModalViewController.swift; sourceTree = "<group>"; };
6E9827761F0A91F400860828 /* iOS Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "iOS Sample.app"; sourceTree = BUILT_PRODUCTS_DIR; };
6E9827791F0A91F400860828 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -135,6 +141,16 @@
name = Overlay;
sourceTree = "<group>";
};
2BC1B4161F19E75A00829D1A /* Tag */ = {
isa = PBXGroup;
children = (
2BC1B4171F19F29800829D1A /* TagViewController.swift */,
2BC1B4191F19F4CB00829D1A /* TagMenuCell.swift */,
2BC1B41B1F19F4DF00829D1A /* TagMenuCell.xib */,
);
name = Tag;
sourceTree = "<group>";
};
6E98276D1F0A91F400860828 = {
isa = PBXGroup;
children = (
Expand All @@ -160,6 +176,7 @@
6E9827781F0A91F400860828 /* iOS Sample */ = {
isa = PBXGroup;
children = (
2BC1B4161F19E75A00829D1A /* Tag */,
2B47E7421F10C13600D67C04 /* Overlay */,
2B47E7411F10C12400D67C04 /* Simple */,
6E9827791F0A91F400860828 /* AppDelegate.swift */,
Expand Down Expand Up @@ -311,6 +328,7 @@
buildActionMask = 2147483647;
files = (
6E9827841F0A91F400860828 /* LaunchScreen.storyboard in Resources */,
2BC1B41C1F19F4DF00829D1A /* TagMenuCell.xib in Resources */,
2B47E72C1F0FB89200D67C04 /* OverlayMenuCell.xib in Resources */,
6E9827811F0A91F400860828 /* Assets.xcassets in Resources */,
6E9827BD1F0A947B00860828 /* MenuCell.xib in Resources */,
Expand Down Expand Up @@ -347,6 +365,8 @@
6E98277C1F0A91F400860828 /* ViewController.swift in Sources */,
6E98277A1F0A91F400860828 /* AppDelegate.swift in Sources */,
2B47E7341F109DE400D67C04 /* OverlayFocusView.swift in Sources */,
2BC1B4181F19F29800829D1A /* TagViewController.swift in Sources */,
2BC1B41A1F19F4CB00829D1A /* TagMenuCell.swift in Sources */,
6E9827BC1F0A947B00860828 /* MenuCell.swift in Sources */,
2B47E7361F10A15700D67C04 /* OverlayMenuCell.swift in Sources */,
);
Expand Down
103 changes: 98 additions & 5 deletions iOS Sample/iOS Sample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="IZ0-r7-U6t" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="92" y="1118"/>
<point key="canvasLocation" x="42" y="1877"/>
</scene>
<!--Modal View Controller-->
<scene sceneID="70g-9e-3TU">
Expand All @@ -178,7 +178,7 @@
<placeholder placeholderIdentifier="IBFirstResponder" id="a2d-nm-4aZ" userLabel="First Responder" sceneMemberID="firstResponder"/>
<exit id="RWi-X7-NgC" userLabel="Exit" sceneMemberID="exit"/>
</objects>
<point key="canvasLocation" x="1662" y="1118"/>
<point key="canvasLocation" x="1678" y="1877"/>
</scene>
<!--Paging Menu View Controller-->
<scene sceneID="8Ou-uv-ZeZ">
Expand Down Expand Up @@ -216,6 +216,51 @@
</objects>
<point key="canvasLocation" x="2897" y="367"/>
</scene>
<!--Tag View Controller-->
<scene sceneID="oPV-AN-WU2">
<objects>
<viewController id="3sV-FM-ucq" customClass="TagViewController" customModule="iOS_Sample" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="fEE-Oe-Who"/>
<viewControllerLayoutGuide type="bottom" id="3uf-OA-APB"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="hgl-ic-oJD">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UFx-uA-H3W">
<rect key="frame" x="0.0" y="64" width="375" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="y1O-TT-vXM"/>
</constraints>
<connections>
<segue destination="1Uq-X9-N93" kind="embed" id="wte-H8-uDl"/>
</connections>
</containerView>
<containerView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="JU9-0f-zGi">
<rect key="frame" x="0.0" y="108" width="375" height="559"/>
<connections>
<segue destination="LHN-Hm-I08" kind="embed" id="gFh-bG-zJt"/>
</connections>
</containerView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="UFx-uA-H3W" secondAttribute="trailing" id="2K7-Iw-Lux"/>
<constraint firstAttribute="trailing" secondItem="JU9-0f-zGi" secondAttribute="trailing" id="2nY-A4-Hdy"/>
<constraint firstItem="JU9-0f-zGi" firstAttribute="top" secondItem="UFx-uA-H3W" secondAttribute="bottom" id="BMf-Mt-nWC"/>
<constraint firstItem="JU9-0f-zGi" firstAttribute="leading" secondItem="hgl-ic-oJD" secondAttribute="leading" id="Ti5-6q-qQa"/>
<constraint firstItem="3uf-OA-APB" firstAttribute="top" secondItem="JU9-0f-zGi" secondAttribute="bottom" id="YDT-yP-Kqb"/>
<constraint firstItem="UFx-uA-H3W" firstAttribute="leading" secondItem="hgl-ic-oJD" secondAttribute="leading" id="uZc-Uo-RT8"/>
<constraint firstItem="UFx-uA-H3W" firstAttribute="top" secondItem="fEE-Oe-Who" secondAttribute="bottom" id="w64-GO-vfx"/>
</constraints>
</view>
<navigationItem key="navigationItem" id="OGo-Bo-YGc"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="mWQ-LO-F1f" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="1897" y="920"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="jJk-sC-SVx">
<objects>
Expand All @@ -232,7 +277,7 @@
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="nVP-xC-vdk" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="821.60000000000002" y="1117.6911544227887"/>
<point key="canvasLocation" x="866" y="1877"/>
</scene>
<!--Item-->
<scene sceneID="yoN-o2-z1r">
Expand Down Expand Up @@ -304,13 +349,25 @@
<segue destination="gb8-QE-wcY" kind="push" id="gGP-JO-Sbr"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KuI-vC-s6a">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" textLabel="kAV-9h-jYM" style="IBUITableViewCellStyleDefault" id="KuI-vC-s6a">
<rect key="frame" x="0.0" y="88" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KuI-vC-s6a" id="aCH-Pd-QgG">
<rect key="frame" x="0.0" y="0.0" width="375" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="342" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="tag" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kAV-9h-jYM">
<rect key="frame" x="15" y="0.0" width="325" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="3sV-FM-ucq" kind="push" id="nQX-4L-VEr"/>
</connections>
</tableViewCell>
</cells>
</tableViewSection>
Expand All @@ -330,6 +387,10 @@
<scene sceneID="QmH-At-Ehq">
<objects>
<viewController id="lQ9-Z3-8GP" customClass="PagingMenuViewController" customModule="PagingKit" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="vHK-Dw-M25"/>
<viewControllerLayoutGuide type="bottom" id="dB3-VM-fa3"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="icH-NR-T2e">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand All @@ -344,6 +405,10 @@
<scene sceneID="YZ9-WH-ozQ">
<objects>
<viewController id="shz-gM-gB2" customClass="PagingContentViewController" customModule="PagingKit" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="AV4-hi-FSH"/>
<viewControllerLayoutGuide type="bottom" id="ovu-Kk-WLC"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="9Yr-k9-rCe">
<rect key="frame" x="0.0" y="0.0" width="375" height="559"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand All @@ -354,5 +419,33 @@
</objects>
<point key="canvasLocation" x="2655" y="-663"/>
</scene>
<!--Paging Menu View Controller-->
<scene sceneID="bI2-7n-YZh">
<objects>
<viewController id="1Uq-X9-N93" customClass="PagingMenuViewController" customModule="PagingKit" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="LsX-7e-2FP">
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="LEd-K4-uKb" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2897" y="730"/>
</scene>
<!--Paging Content View Controller-->
<scene sceneID="fQz-dM-x4j">
<objects>
<viewController id="LHN-Hm-I08" customClass="PagingContentViewController" customModule="PagingKit" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="MNe-g4-cJ4">
<rect key="frame" x="0.0" y="0.0" width="375" height="559"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="XdD-cD-lxD" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2897" y="1118"/>
</scene>
</scenes>
</document>
48 changes: 48 additions & 0 deletions iOS Sample/iOS Sample/TagMenuCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// TagMenuCell.swift
// iOS Sample
//
// Created by kahayash on 2017/07/15.
// Copyright © 2017年 Kazuhiro Hayashi. All rights reserved.
//

import UIKit
import PagingKit

class TagMenuCell: PagingMenuCell {
static let sizingCell = UINib(nibName: "TagMenuCell", bundle: nil).instantiate(withOwner: self, options: nil).first as! TagMenuCell

@IBOutlet weak var contentViewTopConstraint: NSLayoutConstraint!
@IBOutlet weak var titieLabel: UILabel!
@IBOutlet weak var contentView: UIView!

func focus(percent: CGFloat, animated: Bool = false) {
contentViewTopConstraint.constant = 6 * (1 - percent) + 2
if animated {
UIView.perform(
.delete,
on: [],
options: UIViewAnimationOptions(rawValue: 0),
animations: { [weak self] in
self?.contentView.setNeedsLayout()
self?.contentView.layoutIfNeeded()
},
completion: { (finish) in }
)
}
}

override func draw(_ rect: CGRect) {
super.draw(rect)

let path = UIBezierPath(
roundedRect: rect,
byRoundingCorners: [.topLeft, .topRight],
cornerRadii: CGSize(width: 6, height: 6)
)
let shapeLayer = CAShapeLayer()
shapeLayer.frame = contentView.bounds
shapeLayer.path = path.cgPath
contentView.layer.mask = shapeLayer
}
}
Loading

0 comments on commit f270ec1

Please sign in to comment.