Skip to content

Commit 8089ee0

Browse files
committed
Rewrote sample app, to be more modern
1 parent d891e1e commit 8089ee0

40 files changed

Lines changed: 806 additions & 1022 deletions

TPKeyboardAvoidingSample.xcodeproj/project.pbxproj

Lines changed: 184 additions & 190 deletions
Large diffs are not rendered by default.

TPKeyboardAvoidingSample/.DS_Store

-6 KB
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// AppDelegate.h
3+
// TPKeyboardAvoidingSample
4+
//
5+
// Created by Michael Tyson on 26/06/2015.
6+
// Copyright (c) 2015 A Tasty Pixel. All rights reserved.
7+
//
8+
9+
#import <UIKit/UIKit.h>
10+
11+
@interface AppDelegate : UIResponder <UIApplicationDelegate>
12+
13+
@property (strong, nonatomic) UIWindow *window;
14+
15+
16+
@end
17+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//
2+
// AppDelegate.m
3+
// TPKeyboardAvoidingSample
4+
//
5+
// Created by Michael Tyson on 26/06/2015.
6+
// Copyright (c) 2015 A Tasty Pixel. All rights reserved.
7+
//
8+
9+
#import "AppDelegate.h"
10+
11+
@interface AppDelegate ()
12+
13+
@end
14+
15+
@implementation AppDelegate
16+
17+
18+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19+
// Override point for customization after application launch.
20+
return YES;
21+
}
22+
23+
- (void)applicationWillResignActive:(UIApplication *)application {
24+
// 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.
25+
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
26+
}
27+
28+
- (void)applicationDidEnterBackground:(UIApplication *)application {
29+
// 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.
30+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
31+
}
32+
33+
- (void)applicationWillEnterForeground:(UIApplication *)application {
34+
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
35+
}
36+
37+
- (void)applicationDidBecomeActive:(UIApplication *)application {
38+
// 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.
39+
}
40+
41+
- (void)applicationWillTerminate:(UIApplication *)application {
42+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
43+
}
44+
45+
@end
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6214" systemVersion="14A314h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6207"/>
5+
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
6+
</dependencies>
7+
<objects>
8+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
9+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
10+
<view contentMode="scaleToFill" id="iN0-l3-epB">
11+
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
12+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
13+
<subviews>
14+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 A Tasty Pixel. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
15+
<rect key="frame" x="20" y="439" width="441" height="21"/>
16+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
17+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
18+
<nil key="highlightedColor"/>
19+
</label>
20+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="TPKeyboardAvoidingSample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
21+
<rect key="frame" x="20" y="140" width="441" height="43"/>
22+
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
23+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
24+
<nil key="highlightedColor"/>
25+
</label>
26+
</subviews>
27+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
28+
<constraints>
29+
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
30+
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
31+
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
32+
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
33+
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
34+
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
35+
</constraints>
36+
<nil key="simulatedStatusBarMetrics"/>
37+
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
38+
<point key="canvasLocation" x="548" y="455"/>
39+
</view>
40+
</objects>
41+
</document>
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="7702" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="49e-Tb-3d3">
3+
<dependencies>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
5+
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
6+
</dependencies>
7+
<scenes>
8+
<!--Scroll-->
9+
<scene sceneID="hNz-n2-bh7">
10+
<objects>
11+
<viewController id="9pv-A4-QxB" customClass="TPKAScrollViewController" sceneMemberID="viewController">
12+
<layoutGuides>
13+
<viewControllerLayoutGuide type="top" id="Ia1-K6-d13"/>
14+
<viewControllerLayoutGuide type="bottom" id="4ug-Mw-9AY"/>
15+
</layoutGuides>
16+
<view key="view" contentMode="scaleToFill" id="tsR-hK-woN">
17+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
18+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19+
<subviews>
20+
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="E74-nH-O4B" customClass="TPKeyboardAvoidingScrollView">
21+
<rect key="frame" x="0.0" y="20" width="600" height="531"/>
22+
</scrollView>
23+
</subviews>
24+
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
25+
<constraints>
26+
<constraint firstItem="4ug-Mw-9AY" firstAttribute="top" secondItem="E74-nH-O4B" secondAttribute="bottom" id="HmI-ZY-YxY"/>
27+
<constraint firstItem="E74-nH-O4B" firstAttribute="top" secondItem="Ia1-K6-d13" secondAttribute="bottom" id="P8E-if-QEZ"/>
28+
<constraint firstItem="E74-nH-O4B" firstAttribute="leading" secondItem="tsR-hK-woN" secondAttribute="leading" id="WAd-ly-XuT"/>
29+
<constraint firstItem="4ug-Mw-9AY" firstAttribute="top" secondItem="E74-nH-O4B" secondAttribute="bottom" id="l8y-cP-Yyr"/>
30+
<constraint firstAttribute="trailing" secondItem="E74-nH-O4B" secondAttribute="trailing" id="oM3-hS-qbB"/>
31+
<constraint firstItem="E74-nH-O4B" firstAttribute="top" secondItem="Ia1-K6-d13" secondAttribute="bottom" id="tHq-AE-aRh"/>
32+
</constraints>
33+
<variation key="default">
34+
<mask key="constraints">
35+
<exclude reference="tHq-AE-aRh"/>
36+
<exclude reference="HmI-ZY-YxY"/>
37+
</mask>
38+
</variation>
39+
</view>
40+
<tabBarItem key="tabBarItem" title="Scroll" image="Scroll" id="acW-dT-cKf"/>
41+
<connections>
42+
<outlet property="scrollView" destination="E74-nH-O4B" id="wsR-7e-f5z"/>
43+
</connections>
44+
</viewController>
45+
<placeholder placeholderIdentifier="IBFirstResponder" id="W5J-7L-Pyd" sceneMemberID="firstResponder"/>
46+
</objects>
47+
<point key="canvasLocation" x="756" y="-348"/>
48+
</scene>
49+
<!--Table-->
50+
<scene sceneID="jS5-zt-VOk">
51+
<objects>
52+
<tableViewController id="pEE-Ob-lyd" customClass="TPKATableViewController" sceneMemberID="viewController">
53+
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="ahS-NI-zlB" customClass="TPKeyboardAvoidingTableView">
54+
<rect key="frame" x="0.0" y="0.0" width="600" height="551"/>
55+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
56+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
57+
<connections>
58+
<outlet property="dataSource" destination="pEE-Ob-lyd" id="Ngk-8P-HKu"/>
59+
<outlet property="delegate" destination="pEE-Ob-lyd" id="puz-CJ-lq6"/>
60+
</connections>
61+
</tableView>
62+
<extendedEdge key="edgesForExtendedLayout"/>
63+
<tabBarItem key="tabBarItem" title="Table" image="Table" id="DNu-iW-4QD"/>
64+
</tableViewController>
65+
<placeholder placeholderIdentifier="IBFirstResponder" id="D2s-eh-Dyt" userLabel="First Responder" sceneMemberID="firstResponder"/>
66+
</objects>
67+
<point key="canvasLocation" x="756" y="344"/>
68+
</scene>
69+
<!--Collection-->
70+
<scene sceneID="O96-Rr-SQZ">
71+
<objects>
72+
<collectionViewController id="q15-mF-pHj" customClass="TPKACollectionViewController" sceneMemberID="viewController">
73+
<collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="2cU-1T-ab4" customClass="TPKeyboardAvoidingCollectionView">
74+
<rect key="frame" x="0.0" y="0.0" width="600" height="551"/>
75+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
76+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
77+
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="DdR-bh-XrQ">
78+
<size key="itemSize" width="180" height="40"/>
79+
<size key="headerReferenceSize" width="0.0" height="0.0"/>
80+
<size key="footerReferenceSize" width="0.0" height="0.0"/>
81+
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
82+
</collectionViewFlowLayout>
83+
<cells>
84+
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="Cell" id="09N-1j-am2" customClass="TPKACollectionViewControllerCell">
85+
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
86+
<autoresizingMask key="autoresizingMask"/>
87+
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
88+
<rect key="frame" x="0.0" y="0.0" width="180" height="40"/>
89+
<autoresizingMask key="autoresizingMask"/>
90+
<subviews>
91+
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="AlF-cg-smg">
92+
<rect key="frame" x="96" y="5" width="76" height="30"/>
93+
<fontDescription key="fontDescription" type="system" pointSize="14"/>
94+
<textInputTraits key="textInputTraits"/>
95+
</textField>
96+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fxd-1t-Dug">
97+
<rect key="frame" x="8" y="9" width="80" height="21"/>
98+
<constraints>
99+
<constraint firstAttribute="width" priority="750" constant="80" id="Nk8-YF-zCy"/>
100+
</constraints>
101+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
102+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
103+
<nil key="highlightedColor"/>
104+
</label>
105+
</subviews>
106+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
107+
</view>
108+
<constraints>
109+
<constraint firstAttribute="centerY" secondItem="Fxd-1t-Dug" secondAttribute="centerY" constant="0.5" id="95S-oP-X1S"/>
110+
<constraint firstItem="AlF-cg-smg" firstAttribute="leading" secondItem="Fxd-1t-Dug" secondAttribute="trailing" constant="8" id="9zS-zl-it9"/>
111+
<constraint firstItem="AlF-cg-smg" firstAttribute="centerY" secondItem="Fxd-1t-Dug" secondAttribute="centerY" constant="0.5" id="IBM-iZ-StW"/>
112+
<constraint firstItem="Fxd-1t-Dug" firstAttribute="leading" secondItem="09N-1j-am2" secondAttribute="leadingMargin" id="QpX-YU-gWs"/>
113+
<constraint firstItem="AlF-cg-smg" firstAttribute="trailing" secondItem="09N-1j-am2" secondAttribute="trailingMargin" id="nSa-U0-2re"/>
114+
</constraints>
115+
<connections>
116+
<outlet property="label" destination="Fxd-1t-Dug" id="BEh-ci-n4Q"/>
117+
<outlet property="textField" destination="AlF-cg-smg" id="uMb-PR-PWy"/>
118+
</connections>
119+
</collectionViewCell>
120+
</cells>
121+
<connections>
122+
<outlet property="dataSource" destination="q15-mF-pHj" id="ZaU-ze-PWD"/>
123+
<outlet property="delegate" destination="q15-mF-pHj" id="bPS-eh-h5x"/>
124+
</connections>
125+
</collectionView>
126+
<extendedEdge key="edgesForExtendedLayout"/>
127+
<tabBarItem key="tabBarItem" title="Collection" image="Collection" id="8xg-gb-NzT"/>
128+
</collectionViewController>
129+
<placeholder placeholderIdentifier="IBFirstResponder" id="0DB-aZ-Ecj" userLabel="First Responder" sceneMemberID="firstResponder"/>
130+
</objects>
131+
<point key="canvasLocation" x="752" y="1022"/>
132+
</scene>
133+
<!--Tab Bar Controller-->
134+
<scene sceneID="yl2-sM-qoP">
135+
<objects>
136+
<tabBarController id="49e-Tb-3d3" sceneMemberID="viewController">
137+
<nil key="simulatedBottomBarMetrics"/>
138+
<tabBar key="tabBar" contentMode="scaleToFill" id="W28-zg-YXA">
139+
<rect key="frame" x="0.0" y="975" width="768" height="49"/>
140+
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
141+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
142+
</tabBar>
143+
<connections>
144+
<segue destination="9pv-A4-QxB" kind="relationship" relationship="viewControllers" id="u7Y-xg-7CH"/>
145+
<segue destination="pEE-Ob-lyd" kind="relationship" relationship="viewControllers" id="fDP-Lv-Sem"/>
146+
<segue destination="q15-mF-pHj" kind="relationship" relationship="viewControllers" id="AtV-gv-0j1"/>
147+
</connections>
148+
</tabBarController>
149+
<placeholder placeholderIdentifier="IBFirstResponder" id="HuB-VB-40B" sceneMemberID="firstResponder"/>
150+
</objects>
151+
<point key="canvasLocation" x="-256" y="320"/>
152+
</scene>
153+
</scenes>
154+
<resources>
155+
<image name="Collection" width="27" height="27"/>
156+
<image name="Scroll" width="26" height="27"/>
157+
<image name="Table" width="26" height="27"/>
158+
</resources>
159+
</document>
-18.2 KB
Binary file not shown.

TPKeyboardAvoidingSample/FirstViewController.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)