Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e257bad

Browse files
author
aney
committed
Added Custom Table Cell Example
1 parent a12755c commit e257bad

File tree

34 files changed

+980
-0
lines changed

34 files changed

+980
-0
lines changed

‎iOS10 Custom Table Example/iOS10 Custom Table Example.xcodeproj/project.pbxproj

Lines changed: 419 additions & 0 deletions
Large diffs are not rendered by default.

‎iOS10 Custom Table Example/iOS10 Custom Table Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//
2+
// AppDelegate.swift
3+
// iOS10 Custom Table Example
4+
//
5+
// Created by aney on 2017. 2. 5..
6+
// Copyright © 2017년 aney. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
@UIApplicationMain
12+
class AppDelegate: UIResponder, UIApplicationDelegate {
13+
14+
var window: UIWindow?
15+
16+
17+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18+
// Override point for customization after application launch.
19+
return true
20+
}
21+
22+
func applicationWillResignActive(_ application: UIApplication) {
23+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24+
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
25+
}
26+
27+
func applicationDidEnterBackground(_ application: UIApplication) {
28+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30+
}
31+
32+
func applicationWillEnterForeground(_ application: UIApplication) {
33+
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
34+
}
35+
36+
func applicationDidBecomeActive(_ application: UIApplication) {
37+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38+
}
39+
40+
func applicationWillTerminate(_ application: UIApplication) {
41+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42+
}
43+
44+
45+
}
46+
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"size" : "20x20",
6+
"scale" : "2x"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"size" : "20x20",
11+
"scale" : "3x"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"size" : "29x29",
16+
"scale" : "2x"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"size" : "29x29",
21+
"scale" : "3x"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"size" : "40x40",
26+
"scale" : "2x"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"size" : "40x40",
31+
"scale" : "3x"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"size" : "60x60",
36+
"scale" : "2x"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"size" : "60x60",
41+
"scale" : "3x"
42+
},
43+
{
44+
"idiom" : "ipad",
45+
"size" : "20x20",
46+
"scale" : "1x"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"size" : "20x20",
51+
"scale" : "2x"
52+
},
53+
{
54+
"idiom" : "ipad",
55+
"size" : "29x29",
56+
"scale" : "1x"
57+
},
58+
{
59+
"idiom" : "ipad",
60+
"size" : "29x29",
61+
"scale" : "2x"
62+
},
63+
{
64+
"idiom" : "ipad",
65+
"size" : "40x40",
66+
"scale" : "1x"
67+
},
68+
{
69+
"idiom" : "ipad",
70+
"size" : "40x40",
71+
"scale" : "2x"
72+
},
73+
{
74+
"idiom" : "ipad",
75+
"size" : "76x76",
76+
"scale" : "1x"
77+
},
78+
{
79+
"idiom" : "ipad",
80+
"size" : "76x76",
81+
"scale" : "2x"
82+
},
83+
{
84+
"idiom" : "ipad",
85+
"size" : "83.5x83.5",
86+
"scale" : "2x"
87+
}
88+
],
89+
"info" : {
90+
"version" : 1,
91+
"author" : "xcode"
92+
}
93+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
5+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
6+
</dependencies>
7+
<scenes>
8+
<!--View Controller-->
9+
<scene sceneID="EHf-IW-A2E">
10+
<objects>
11+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
14+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
17+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
20+
</view>
21+
</viewController>
22+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
23+
</objects>
24+
<point key="canvasLocation" x="53" y="375"/>
25+
</scene>
26+
</scenes>
27+
</document>
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="bem-wV-lQb">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
6+
<dependencies>
7+
<deployment identifier="iOS"/>
8+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
9+
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
10+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
11+
</dependencies>
12+
<scenes>
13+
<!--Album-->
14+
<scene sceneID="tne-QT-ifu">
15+
<objects>
16+
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="iOS10_Custom_Table_Example" customModuleProvider="target" sceneMemberID="viewController">
17+
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" id="x78-Db-Kqw">
18+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
19+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
20+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
21+
<prototypes>
22+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" id="xBu-0D-OVA" customClass="CustomTableViewCell" customModule="iOS10_Custom_Table_Example" customModuleProvider="target">
23+
<rect key="frame" x="0.0" y="28" width="375" height="44"/>
24+
<autoresizingMask key="autoresizingMask"/>
25+
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="xBu-0D-OVA" id="TqU-Mh-tY6">
26+
<rect key="frame" x="0.0" y="0.0" width="375" height="43"/>
27+
<autoresizingMask key="autoresizingMask"/>
28+
<subviews>
29+
<imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="bNC-7z-cCw">
30+
<rect key="frame" x="0.0" y="0.0" width="375" height="43"/>
31+
</imageView>
32+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nEV-Md-xT2">
33+
<rect key="frame" x="306" y="0.0" width="61" height="30"/>
34+
<fontDescription key="fontDescription" type="system" pointSize="25"/>
35+
<nil key="textColor"/>
36+
<nil key="highlightedColor"/>
37+
</label>
38+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RMC-EX-FYK">
39+
<rect key="frame" x="325" y="22" width="42" height="21"/>
40+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
41+
<nil key="textColor"/>
42+
<nil key="highlightedColor"/>
43+
</label>
44+
</subviews>
45+
<constraints>
46+
<constraint firstAttribute="bottom" secondItem="bNC-7z-cCw" secondAttribute="bottom" id="3jP-jv-c4y"/>
47+
<constraint firstItem="nEV-Md-xT2" firstAttribute="top" secondItem="TqU-Mh-tY6" secondAttribute="top" id="7oT-GY-8CQ"/>
48+
<constraint firstAttribute="trailing" secondItem="bNC-7z-cCw" secondAttribute="trailing" id="AA5-Om-ucA"/>
49+
<constraint firstAttribute="trailing" secondItem="RMC-EX-FYK" secondAttribute="trailing" constant="8" id="DfP-VW-oQ9"/>
50+
<constraint firstItem="bNC-7z-cCw" firstAttribute="leading" secondItem="TqU-Mh-tY6" secondAttribute="leading" id="Fyb-y4-Y0q"/>
51+
<constraint firstAttribute="trailing" secondItem="nEV-Md-xT2" secondAttribute="trailing" constant="8" id="Vue-2v-jcj"/>
52+
<constraint firstItem="bNC-7z-cCw" firstAttribute="top" secondItem="TqU-Mh-tY6" secondAttribute="top" id="gQ3-Kd-yUQ"/>
53+
<constraint firstAttribute="bottom" secondItem="RMC-EX-FYK" secondAttribute="bottom" id="rui-nP-9Rm"/>
54+
</constraints>
55+
</tableViewCellContentView>
56+
<connections>
57+
<outlet property="backgroundImageView" destination="bNC-7z-cCw" id="OCK-Jv-dda"/>
58+
<outlet property="detailLabel" destination="RMC-EX-FYK" id="Bmj-jQ-AI7"/>
59+
<outlet property="titleLabel" destination="nEV-Md-xT2" id="owe-dl-Lc7"/>
60+
</connections>
61+
</tableViewCell>
62+
</prototypes>
63+
<connections>
64+
<outlet property="dataSource" destination="BYZ-38-t0r" id="ecl-rx-V7f"/>
65+
<outlet property="delegate" destination="BYZ-38-t0r" id="6er-VO-la0"/>
66+
</connections>
67+
</tableView>
68+
<navigationItem key="navigationItem" title="Album" id="Qoe-Ve-jJP"/>
69+
<connections>
70+
<segue destination="Lte-Iz-1QT" kind="show" identifier="detailSegue" id="Xe9-RG-XRf"/>
71+
</connections>
72+
</viewController>
73+
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
74+
</objects>
75+
<point key="canvasLocation" x="869.60000000000002" y="-559.07046476761627"/>
76+
</scene>
77+
<!--Detail View Controller-->
78+
<scene sceneID="XXf-qG-eyd">
79+
<objects>
80+
<viewController id="Lte-Iz-1QT" customClass="DetailViewController" customModule="iOS10_Custom_Table_Example" customModuleProvider="target" sceneMemberID="viewController">
81+
<layoutGuides>
82+
<viewControllerLayoutGuide type="top" id="uSa-Mf-0RN"/>
83+
<viewControllerLayoutGuide type="bottom" id="jhf-lh-Rgi"/>
84+
</layoutGuides>
85+
<view key="view" contentMode="scaleToFill" id="izp-dR-hev">
86+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
87+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
88+
<subviews>
89+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="08a-Za-1NK">
90+
<rect key="frame" x="166.5" y="127" width="42" height="20.5"/>
91+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
92+
<nil key="textColor"/>
93+
<nil key="highlightedColor"/>
94+
</label>
95+
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="04.jpg" translatesAutoresizingMaskIntoConstraints="NO" id="1Nq-Ne-LWy">
96+
<rect key="frame" x="37.5" y="183.5" width="300" height="300"/>
97+
<constraints>
98+
<constraint firstAttribute="height" constant="300" id="I10-EO-AW5"/>
99+
<constraint firstAttribute="width" constant="300" id="dFj-6B-6Zm"/>
100+
</constraints>
101+
</imageView>
102+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="W0N-w0-86X">
103+
<rect key="frame" x="111" y="535" width="153" height="21"/>
104+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
105+
<nil key="textColor"/>
106+
<nil key="highlightedColor"/>
107+
</label>
108+
</subviews>
109+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
110+
<constraints>
111+
<constraint firstItem="jhf-lh-Rgi" firstAttribute="top" secondItem="W0N-w0-86X" secondAttribute="bottom" constant="111" id="HQy-ji-EX6"/>
112+
<constraint firstAttribute="trailingMargin" secondItem="W0N-w0-86X" secondAttribute="trailing" constant="95" id="MuR-1r-XoX"/>
113+
<constraint firstItem="08a-Za-1NK" firstAttribute="top" secondItem="uSa-Mf-0RN" secondAttribute="bottom" constant="63" id="Tbk-lG-rox"/>
114+
<constraint firstItem="W0N-w0-86X" firstAttribute="leading" secondItem="izp-dR-hev" secondAttribute="leadingMargin" constant="95" id="Up3-Qt-VcC"/>
115+
<constraint firstItem="1Nq-Ne-LWy" firstAttribute="centerX" secondItem="izp-dR-hev" secondAttribute="centerX" id="d24-y8-L0V"/>
116+
<constraint firstItem="1Nq-Ne-LWy" firstAttribute="centerY" secondItem="izp-dR-hev" secondAttribute="centerY" id="fKS-QD-2Tu"/>
117+
<constraint firstItem="08a-Za-1NK" firstAttribute="centerX" secondItem="izp-dR-hev" secondAttribute="centerX" id="mSf-Lk-xXm"/>
118+
<constraint firstItem="1Nq-Ne-LWy" firstAttribute="centerX" secondItem="08a-Za-1NK" secondAttribute="centerX" id="r1q-bz-BQD"/>
119+
</constraints>
120+
</view>
121+
<connections>
122+
<outlet property="dateLabel" destination="W0N-w0-86X" id="xQP-1M-ts2"/>
123+
<outlet property="imageView" destination="1Nq-Ne-LWy" id="mne-xF-hQN"/>
124+
<outlet property="titleLabel" destination="08a-Za-1NK" id="DID-gA-3XT"/>
125+
</connections>
126+
</viewController>
127+
<placeholder placeholderIdentifier="IBFirstResponder" id="Ncb-BF-3H0" userLabel="First Responder" sceneMemberID="firstResponder"/>
128+
</objects>
129+
<point key="canvasLocation" x="1668" y="-559.07046476761627"/>
130+
</scene>
131+
<!--Navigation Controller-->
132+
<scene sceneID="F8R-vK-G5D">
133+
<objects>
134+
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="bem-wV-lQb" sceneMemberID="viewController">
135+
<toolbarItems/>
136+
<navigationBar key="navigationBar" contentMode="scaleToFill" id="xhx-dJ-Xn5">
137+
<rect key="frame" x="0.0" y="0.0" width="375" height="44"/>
138+
<autoresizingMask key="autoresizingMask"/>
139+
</navigationBar>
140+
<nil name="viewControllers"/>
141+
<connections>
142+
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="P7V-0H-Ui8"/>
143+
</connections>
144+
</navigationController>
145+
<placeholder placeholderIdentifier="IBFirstResponder" id="gZI-dC-yi1" userLabel="First Responder" sceneMemberID="firstResponder"/>
146+
</objects>
147+
<point key="canvasLocation" x="117.59999999999999" y="-559.07046476761627"/>
148+
</scene>
149+
</scenes>
150+
<resources>
151+
<image name="04.jpg" width="714" height="1024"/>
152+
</resources>
153+
</document>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// CustomTableViewCell.swift
3+
// iOS10 Custom Table Example
4+
//
5+
// Created by aney on 2017. 2. 5..
6+
// Copyright © 2017년 aney. All rights reserved.
7+
//
8+
9+
import UIKit
10+
11+
class CustomTableViewCell: UITableViewCell {
12+
13+
@IBOutlet weak var titleLabel: UILabel!
14+
15+
@IBOutlet weak var detailLabel: UILabel!
16+
17+
@IBOutlet weak var backgroundImageView: UIImageView!
18+
19+
override func awakeFromNib() {
20+
super.awakeFromNib()
21+
// Initialization code
22+
}
23+
24+
override func setSelected(_ selected: Bool, animated: Bool) {
25+
super.setSelected(selected, animated: animated)
26+
27+
// Configure the view for the selected state
28+
}
29+
30+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /