Skip to content

Commit e697701

Browse files
committed
Part 1
1 parent a5709b9 commit e697701

File tree

4 files changed

+203
-5
lines changed

4 files changed

+203
-5
lines changed

.gitignore

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
Pods/
2+
3+
#########################
4+
# .gitignore file for Xcode4 and Xcode5 Source projects
5+
#
6+
# Apple bugs, waiting for Apple to fix/respond:
7+
#
8+
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
9+
#
10+
# Version 2.1
11+
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
12+
#
13+
# 2013 updates:
14+
# - fixed the broken "save personal Schemes"
15+
# - added line-by-line explanations for EVERYTHING (some were missing)
16+
#
17+
# NB: if you are storing "built" products, this WILL NOT WORK,
18+
# and you should use a different .gitignore (or none at all)
19+
# This file is for SOURCE projects, where there are many extra
20+
# files that we want to exclude
21+
#
22+
#########################
23+
24+
#####
25+
# OS X temporary files that should never be committed
26+
#
27+
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
28+
29+
.DS_Store
30+
31+
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
32+
33+
.Trashes
34+
35+
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
36+
37+
*.swp
38+
39+
# *.lock - this is used and abused by many editors for many different things.
40+
# For the main ones I use (e.g. Eclipse), it should be excluded
41+
# from source-control, but YMMV
42+
43+
*.lock
44+
45+
#
46+
# profile - REMOVED temporarily (on double-checking, this seems incorrect; I can't find it in OS X docs?)
47+
#profile
48+
49+
50+
####
51+
# Xcode temporary files that should never be committed
52+
#
53+
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...
54+
55+
*~.nib
56+
57+
58+
####
59+
# Xcode build files -
60+
#
61+
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"
62+
63+
DerivedData/
64+
65+
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"
66+
67+
build/
68+
69+
70+
#####
71+
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
72+
#
73+
# This is complicated:
74+
#
75+
# SOMETIMES you need to put this file in version control.
76+
# Apple designed it poorly - if you use "custom executables", they are
77+
# saved in this file.
78+
# 99% of projects do NOT use those, so they do NOT want to version control this file.
79+
# ..but if you're in the 1%, comment out the line "*.pbxuser"
80+
81+
# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html
82+
83+
*.pbxuser
84+
85+
# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html
86+
87+
*.mode1v3
88+
89+
# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html
90+
91+
*.mode2v3
92+
93+
# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file
94+
95+
*.perspectivev3
96+
97+
# NB: also, whitelist the default ones, some projects need to use these
98+
!default.pbxuser
99+
!default.mode1v3
100+
!default.mode2v3
101+
!default.perspectivev3
102+
103+
104+
####
105+
# Xcode 4 - semi-personal settings
106+
#
107+
#
108+
# OPTION 1: ---------------------------------
109+
# throw away ALL personal settings (including custom schemes!
110+
# - unless they are "shared")
111+
#
112+
# NB: this is exclusive with OPTION 2 below
113+
xcuserdata
114+
115+
# OPTION 2: ---------------------------------
116+
# get rid of ALL personal settings, but KEEP SOME OF THEM
117+
# - NB: you must manually uncomment the bits you want to keep
118+
#
119+
# NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X,
120+
# or manually install git over the top of the OS X version
121+
# NB: this is exclusive with OPTION 1 above
122+
#
123+
#xcuserdata/**/*
124+
125+
# (requires option 2 above): Personal Schemes
126+
#
127+
#!xcuserdata/**/xcschemes/*
128+
129+
####
130+
# XCode 4 workspaces - more detailed
131+
#
132+
# Workspaces are important! They are a core feature of Xcode - don't exclude them :)
133+
#
134+
# Workspace layout is quite spammy. For reference:
135+
#
136+
# /(root)/
137+
# /(project-name).xcodeproj/
138+
# project.pbxproj
139+
# /project.xcworkspace/
140+
# contents.xcworkspacedata
141+
# /xcuserdata/
142+
# /(your name)/xcuserdatad/
143+
# UserInterfaceState.xcuserstate
144+
# /xcsshareddata/
145+
# /xcschemes/
146+
# (shared scheme name).xcscheme
147+
# /xcuserdata/
148+
# /(your name)/xcuserdatad/
149+
# (private scheme).xcscheme
150+
# xcschememanagement.plist
151+
#
152+
#
153+
154+
####
155+
# Xcode 4 - Deprecated classes
156+
#
157+
# Allegedly, if you manually "deprecate" your classes, they get moved here.
158+
#
159+
# We're using source-control, so this is a "feature" that we do not want!
160+
161+
*.moved-aside
162+
163+
####
164+
# Xcode 5 - VCS file
165+
# The data in this file not represent state of your project.
166+
# If you'll leave this file in git - you will have merge conflicts during
167+
# pull your cahnges to other's repo
168+
#
169+
*.xccheckout
170+
171+
####
172+
# UNKNOWN: recommended by others, but I can't discover what these files are
173+
#
174+
# ...none. Everything is now explained.

SwiftTutorial/AppDelegate.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1616

1717
func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {
1818
// Override point for customization after application launch.
19+
println("Hello World")
1920
return true
2021
}
2122

SwiftTutorial/Base.lproj/Main.storyboard

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6162" systemVersion="14A238h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6206.8" systemVersion="13E28" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6160"/>
4+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7026.1"/>
55
</dependencies>
66
<scenes>
77
<!--View Controller-->
88
<scene sceneID="ufC-wZ-h7g">
99
<objects>
10-
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
10+
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="SwiftTutorial" customModuleProvider="target" sceneMemberID="viewController">
1111
<layoutGuides>
1212
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
1313
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
1414
</layoutGuides>
1515
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
16-
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
16+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
1717
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
18+
<subviews>
19+
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="uSB-Wx-Ygo">
20+
<rect key="frame" x="0.0" y="28" width="600" height="572"/>
21+
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
22+
<connections>
23+
<outlet property="dataSource" destination="vXZ-lx-hvc" id="kG3-L6-sl2"/>
24+
<outlet property="delegate" destination="vXZ-lx-hvc" id="yvw-kU-NYD"/>
25+
</connections>
26+
</tableView>
27+
</subviews>
1828
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
1929
</view>
2030
</viewController>

SwiftTutorial/ViewController.swift

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import UIKit
1010

11-
class ViewController: UIViewController {
11+
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
1212

1313
override func viewDidLoad() {
1414
super.viewDidLoad()
@@ -19,6 +19,19 @@ class ViewController: UIViewController {
1919
super.didReceiveMemoryWarning()
2020
// Dispose of any resources that can be recreated.
2121
}
22+
23+
func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int {
24+
return 10
25+
}
26+
27+
func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
28+
let cell: UITableViewCell = UITableViewCell(style: UITableViewCellStyle.Subtitle, reuseIdentifier: "MyTestCell")
29+
30+
cell.textLabel.text = "Row #\(indexPath.row)"
31+
cell.detailTextLabel.text = "Subtitle #\(indexPath.row)"
32+
33+
return cell
34+
}
2235

2336

2437
}

0 commit comments

Comments
 (0)