Skip to content

Commit d87cbb8

Browse files
committed
added example again
1 parent 1a9ff4d commit d87cbb8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1470
-18
lines changed

.travis.yml

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

Example/Presentables.xcodeproj/project.pbxproj

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

Example/Presentables.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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Example/Presentables.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1240"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
18+
BuildableName = "Presentables_Example.app"
19+
BlueprintName = "Presentables_Example"
20+
ReferencedContainer = "container:Presentables.xcodeproj">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "607FACE41AFB9204008FA782"
32+
BuildableName = "Presentables_Tests.xctest"
33+
BlueprintName = "Presentables_Tests"
34+
ReferencedContainer = "container:Presentables.xcodeproj">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
</BuildActionEntries>
38+
</BuildAction>
39+
<TestAction
40+
buildConfiguration = "Debug"
41+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
42+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
shouldUseLaunchSchemeArgsEnv = "YES">
44+
<MacroExpansion>
45+
<BuildableReference
46+
BuildableIdentifier = "primary"
47+
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
48+
BuildableName = "Presentables_Example.app"
49+
BlueprintName = "Presentables_Example"
50+
ReferencedContainer = "container:Presentables.xcodeproj">
51+
</BuildableReference>
52+
</MacroExpansion>
53+
<Testables>
54+
<TestableReference
55+
skipped = "NO">
56+
<BuildableReference
57+
BuildableIdentifier = "primary"
58+
BlueprintIdentifier = "607FACE41AFB9204008FA782"
59+
BuildableName = "Presentables_Tests.xctest"
60+
BlueprintName = "Presentables_Tests"
61+
ReferencedContainer = "container:Presentables.xcodeproj">
62+
</BuildableReference>
63+
</TestableReference>
64+
</Testables>
65+
</TestAction>
66+
<LaunchAction
67+
buildConfiguration = "Debug"
68+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
69+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
70+
launchStyle = "0"
71+
useCustomWorkingDirectory = "NO"
72+
ignoresPersistentStateOnLaunch = "NO"
73+
debugDocumentVersioning = "YES"
74+
debugServiceExtension = "internal"
75+
allowLocationSimulation = "YES">
76+
<BuildableProductRunnable
77+
runnableDebuggingMode = "0">
78+
<BuildableReference
79+
BuildableIdentifier = "primary"
80+
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
81+
BuildableName = "Presentables_Example.app"
82+
BlueprintName = "Presentables_Example"
83+
ReferencedContainer = "container:Presentables.xcodeproj">
84+
</BuildableReference>
85+
</BuildableProductRunnable>
86+
</LaunchAction>
87+
<ProfileAction
88+
buildConfiguration = "Release"
89+
shouldUseLaunchSchemeArgsEnv = "YES"
90+
savedToolIdentifier = ""
91+
useCustomWorkingDirectory = "NO"
92+
debugDocumentVersioning = "YES">
93+
<BuildableProductRunnable
94+
runnableDebuggingMode = "0">
95+
<BuildableReference
96+
BuildableIdentifier = "primary"
97+
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
98+
BuildableName = "Presentables_Example.app"
99+
BlueprintName = "Presentables_Example"
100+
ReferencedContainer = "container:Presentables.xcodeproj">
101+
</BuildableReference>
102+
</BuildableProductRunnable>
103+
</ProfileAction>
104+
<AnalyzeAction
105+
buildConfiguration = "Debug">
106+
</AnalyzeAction>
107+
<ArchiveAction
108+
buildConfiguration = "Release"
109+
revealArchiveInOrganizer = "YES">
110+
</ArchiveAction>
111+
</Scheme>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import UIKit
2+
3+
@UIApplicationMain
4+
class AppDelegate: UIResponder, UIApplicationDelegate {
5+
6+
var window: UIWindow?
7+
8+
9+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
10+
window = UIWindow(frame: UIScreen.main.bounds)
11+
12+
let homeViewController = ViewController()
13+
let nc = UINavigationController(rootViewController: homeViewController)
14+
15+
window!.rootViewController = nc
16+
window!.makeKeyAndVisible()
17+
18+
return true
19+
}
20+
21+
func applicationWillResignActive(_ application: UIApplication) {
22+
// 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.
23+
// 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.
24+
}
25+
26+
func applicationDidEnterBackground(_ application: UIApplication) {
27+
// 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.
28+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29+
}
30+
31+
func applicationWillEnterForeground(_ application: UIApplication) {
32+
// 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.
33+
}
34+
35+
func applicationDidBecomeActive(_ application: UIApplication) {
36+
// 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.
37+
}
38+
39+
func applicationWillTerminate(_ application: UIApplication) {
40+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
41+
}
42+
43+
44+
}
45+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="12121" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES">
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="12089"/>
9+
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
10+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
11+
</dependencies>
12+
<objects>
13+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
14+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
15+
<view contentMode="scaleToFill" id="iN0-l3-epB">
16+
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
17+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
18+
<subviews>
19+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2017 manGoweb UK. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
20+
<rect key="frame" x="20" y="439" width="441" height="21"/>
21+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
22+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
23+
<nil key="highlightedColor"/>
24+
</label>
25+
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Presentables" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
26+
<rect key="frame" x="20" y="140" width="441" height="43"/>
27+
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
28+
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
29+
<nil key="highlightedColor"/>
30+
</label>
31+
</subviews>
32+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
33+
<constraints>
34+
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/>
35+
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/>
36+
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/>
37+
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/>
38+
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/>
39+
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/>
40+
</constraints>
41+
<nil key="simulatedStatusBarMetrics"/>
42+
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
43+
<point key="canvasLocation" x="548" y="455"/>
44+
</view>
45+
</objects>
46+
</document>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import Presentables
2+
3+
4+
class CollectionDataManager: PresentableCollectionViewDataManager {
5+
6+
// MARK: Initialization
7+
8+
override init() {
9+
super.init()
10+
11+
let section = PresentableSection()
12+
13+
for i in 2...51 {
14+
let presentable = Presentable<CollectionViewCell>.create({ (cell) in
15+
cell.titleLabel.text = "Col Id: \((i))"
16+
}).cellSelected {
17+
print("Selected: \(i)")
18+
}
19+
section.append(presentable)
20+
}
21+
22+
data.append(section)
23+
}
24+
25+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import Presentables
2+
import SnapKit
3+
4+
5+
class CollectionViewCell: UICollectionViewCell {
6+
7+
let titleLabel = UILabel()
8+
9+
func configure() {
10+
contentView.backgroundColor = .white
11+
12+
contentView.addSubview(titleLabel)
13+
14+
titleLabel.snp.makeConstraints { (make) in
15+
make.edges.equalToSuperview()
16+
}
17+
18+
titleLabel.textColor = .black
19+
titleLabel.textAlignment = .center
20+
}
21+
22+
override init(frame: CGRect) {
23+
super.init(frame: frame)
24+
25+
configure()
26+
}
27+
28+
required init?(coder aDecoder: NSCoder) {
29+
fatalError("init(coder:) has not been implemented")
30+
}
31+
32+
}
33+

0 commit comments

Comments
 (0)