Skip to content

Commit 3e20067

Browse files
committed
Hello world
1 parent b2e1ba7 commit 3e20067

34 files changed

+753
-921
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.DS_Store
22
/.build
33
/Packages
4-
/*.xcodeproj
54
xcuserdata/
65
DerivedData/
76
.swiftpm/config/registries.json

Contributors Guide.rtf

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{\rtf1\ansi\ansicpg1252\cocoartf2639
2+
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;}
3+
{\colortbl;\red255\green255\blue255;}
4+
{\*\expandedcolortbl;;}
5+
\margl1440\margr1440\vieww17120\viewh8400\viewkind0
6+
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
7+
8+
\f0\fs24 \cf0 For all changes, I recommend you make a
9+
\f1\b new branch
10+
\f0\b0 . We won\'92t approve any commits or PRs made directly to main.\
11+
\
12+
Once finished, make a
13+
\f1\b pull request (PR)
14+
\f0\b0 so your change can be reviewed in our
15+
\f1\b staging branch
16+
\f0\b0 .\
17+
\
18+
Include a detailed discussion in the PR why you want to make a change and how it will benefit other developers and users.\
19+
\
20+
We highly recommend uploading a video or photo showing the impact of your changes.\
21+
\
22+
\'97\
23+
\
24+
If you are introducing a bug fix:\
25+
\
26+
Upload a
27+
\f1\b video
28+
\f0\b0 or screenshot of how the current change you introduced implements the iOS device running in the Simulator. We want to see the Simulator running in your video.\
29+
\
30+
Example: If you fixed an issue with how cells are dequeued, show a video of the before and after of your changes. Show the simulator running.\
31+
\
32+
\'97\
33+
\
34+
\
35+
\
36+
Here is a guide for adding new public methods:\
37+
\
38+
(1) Add a default value for each variable at the top of Table.swift. Variables are recommended to be private.\
39+
\
40+
(2) Apply the value wherever it should be used in the TableView (ie. cellForRowAt method, didSelectRow method or anywhere else).\
41+
\
42+
(3) Add a setter method to allow users to change the values used by the TableView.\
43+
\
44+
(4) Add an appropriate comment using Documentation Compiler to your new method. It should start with /// (three forward slashes).\
45+
\
46+
\
47+
\
48+
\
49+
\
50+
\
51+
}

Example/Example.xcodeproj/project.pbxproj

Lines changed: 62 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@
1212
AE5B965B28A24F690055CB00 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AE5B965928A24F690055CB00 /* Main.storyboard */; };
1313
AE5B965D28A24F6A0055CB00 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AE5B965C28A24F6A0055CB00 /* Assets.xcassets */; };
1414
AE5B966028A24F6A0055CB00 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AE5B965E28A24F6A0055CB00 /* LaunchScreen.storyboard */; };
15-
AE5B967028A24F810055CB00 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5B966828A24F810055CB00 /* ViewController.swift */; };
16-
AE5B967128A24F810055CB00 /* ThirdViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5B966928A24F810055CB00 /* ThirdViewController.swift */; };
17-
AE5B967228A24F810055CB00 /* Person.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5B966A28A24F810055CB00 /* Person.swift */; };
18-
AE5B967328A24F810055CB00 /* SecondViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5B966B28A24F810055CB00 /* SecondViewController.swift */; };
19-
AE5B967428A24F810055CB00 /* Table.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5B966D28A24F810055CB00 /* Table.swift */; };
20-
AE5B967528A24F810055CB00 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5B966E28A24F810055CB00 /* Extensions.swift */; };
21-
AE5B967628A24F810055CB00 /* TableData.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE5B966F28A24F810055CB00 /* TableData.swift */; };
15+
AE880F0428A61B8F001336CE /* Table.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE880F0128A61B8F001336CE /* Table.swift */; };
16+
AE880F0528A61B8F001336CE /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE880F0228A61B8F001336CE /* Extensions.swift */; };
17+
AE880F0628A61B8F001336CE /* TableData.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE880F0328A61B8F001336CE /* TableData.swift */; };
18+
AE880F0828A61BBD001336CE /* Methods.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE880F0728A61BBD001336CE /* Methods.swift */; };
19+
AEDA940028A8417000488C62 /* ContactListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDA93FF28A8417000488C62 /* ContactListViewController.swift */; };
20+
AEDA940228A843D900488C62 /* TodoListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDA940128A843D900488C62 /* TodoListViewController.swift */; };
21+
AEDA940428A8498000488C62 /* Todo.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDA940328A8498000488C62 /* Todo.swift */; };
22+
AEDA940628A849C300488C62 /* WeatherViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDA940528A849C300488C62 /* WeatherViewController.swift */; };
23+
AEDA940828A84B8700488C62 /* Weather.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDA940728A84B8700488C62 /* Weather.swift */; };
24+
AEDA940A28A87A1000488C62 /* PostsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDA940928A87A1000488C62 /* PostsViewController.swift */; };
25+
AEDA940C28A87A1900488C62 /* Post.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDA940B28A87A1900488C62 /* Post.swift */; };
2226
/* End PBXBuildFile section */
2327

2428
/* Begin PBXFileReference section */
@@ -29,13 +33,17 @@
2933
AE5B965C28A24F6A0055CB00 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3034
AE5B965F28A24F6A0055CB00 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
3135
AE5B966128A24F6A0055CB00 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
32-
AE5B966828A24F810055CB00 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
33-
AE5B966928A24F810055CB00 /* ThirdViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThirdViewController.swift; sourceTree = "<group>"; };
34-
AE5B966A28A24F810055CB00 /* Person.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Person.swift; sourceTree = "<group>"; };
35-
AE5B966B28A24F810055CB00 /* SecondViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SecondViewController.swift; sourceTree = "<group>"; };
36-
AE5B966D28A24F810055CB00 /* Table.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Table.swift; sourceTree = "<group>"; };
37-
AE5B966E28A24F810055CB00 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
38-
AE5B966F28A24F810055CB00 /* TableData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableData.swift; sourceTree = "<group>"; };
36+
AE880F0128A61B8F001336CE /* Table.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Table.swift; sourceTree = "<group>"; };
37+
AE880F0228A61B8F001336CE /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
38+
AE880F0328A61B8F001336CE /* TableData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableData.swift; sourceTree = "<group>"; };
39+
AE880F0728A61BBD001336CE /* Methods.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Methods.swift; sourceTree = "<group>"; };
40+
AEDA93FF28A8417000488C62 /* ContactListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContactListViewController.swift; sourceTree = "<group>"; };
41+
AEDA940128A843D900488C62 /* TodoListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodoListViewController.swift; sourceTree = "<group>"; };
42+
AEDA940328A8498000488C62 /* Todo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Todo.swift; sourceTree = "<group>"; };
43+
AEDA940528A849C300488C62 /* WeatherViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WeatherViewController.swift; sourceTree = "<group>"; };
44+
AEDA940728A84B8700488C62 /* Weather.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Weather.swift; sourceTree = "<group>"; };
45+
AEDA940928A87A1000488C62 /* PostsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostsViewController.swift; sourceTree = "<group>"; };
46+
AEDA940B28A87A1900488C62 /* Post.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Post.swift; sourceTree = "<group>"; };
3947
/* End PBXFileReference section */
4048

4149
/* Begin PBXFrameworksBuildPhase section */
@@ -52,6 +60,7 @@
5260
AE5B964728A24F690055CB00 = {
5361
isa = PBXGroup;
5462
children = (
63+
AE880EFF28A61B8F001336CE /* Sources */,
5564
AE5B965228A24F690055CB00 /* Example */,
5665
AE5B965128A24F690055CB00 /* Products */,
5766
);
@@ -69,7 +78,6 @@
6978
isa = PBXGroup;
7079
children = (
7180
AE5B966728A24F810055CB00 /* Examples */,
72-
AE5B966C28A24F810055CB00 /* Library */,
7381
AE5B965328A24F690055CB00 /* AppDelegate.swift */,
7482
AE5B965528A24F690055CB00 /* SceneDelegate.swift */,
7583
AE5B965928A24F690055CB00 /* Main.storyboard */,
@@ -83,22 +91,35 @@
8391
AE5B966728A24F810055CB00 /* Examples */ = {
8492
isa = PBXGroup;
8593
children = (
86-
AE5B966828A24F810055CB00 /* ViewController.swift */,
87-
AE5B966928A24F810055CB00 /* ThirdViewController.swift */,
88-
AE5B966A28A24F810055CB00 /* Person.swift */,
89-
AE5B966B28A24F810055CB00 /* SecondViewController.swift */,
94+
AEDA93FF28A8417000488C62 /* ContactListViewController.swift */,
95+
AEDA940128A843D900488C62 /* TodoListViewController.swift */,
96+
AEDA940328A8498000488C62 /* Todo.swift */,
97+
AEDA940528A849C300488C62 /* WeatherViewController.swift */,
98+
AEDA940728A84B8700488C62 /* Weather.swift */,
99+
AEDA940928A87A1000488C62 /* PostsViewController.swift */,
100+
AEDA940B28A87A1900488C62 /* Post.swift */,
90101
);
91102
path = Examples;
92103
sourceTree = "<group>";
93104
};
94-
AE5B966C28A24F810055CB00 /* Library */ = {
105+
AE880EFF28A61B8F001336CE /* Sources */ = {
95106
isa = PBXGroup;
96107
children = (
97-
AE5B966D28A24F810055CB00 /* Table.swift */,
98-
AE5B966E28A24F810055CB00 /* Extensions.swift */,
99-
AE5B966F28A24F810055CB00 /* TableData.swift */,
108+
AE880F0028A61B8F001336CE /* Swift Table */,
100109
);
101-
path = Library;
110+
name = Sources;
111+
path = ../Sources;
112+
sourceTree = "<group>";
113+
};
114+
AE880F0028A61B8F001336CE /* Swift Table */ = {
115+
isa = PBXGroup;
116+
children = (
117+
AE880F0128A61B8F001336CE /* Table.swift */,
118+
AE880F0728A61BBD001336CE /* Methods.swift */,
119+
AE880F0228A61B8F001336CE /* Extensions.swift */,
120+
AE880F0328A61B8F001336CE /* TableData.swift */,
121+
);
122+
path = "Swift Table";
102123
sourceTree = "<group>";
103124
};
104125
/* End PBXGroup section */
@@ -172,15 +193,19 @@
172193
isa = PBXSourcesBuildPhase;
173194
buildActionMask = 2147483647;
174195
files = (
175-
AE5B967328A24F810055CB00 /* SecondViewController.swift in Sources */,
176-
AE5B967428A24F810055CB00 /* Table.swift in Sources */,
177-
AE5B967228A24F810055CB00 /* Person.swift in Sources */,
178-
AE5B967628A24F810055CB00 /* TableData.swift in Sources */,
179-
AE5B967528A24F810055CB00 /* Extensions.swift in Sources */,
180-
AE5B967028A24F810055CB00 /* ViewController.swift in Sources */,
196+
AEDA940A28A87A1000488C62 /* PostsViewController.swift in Sources */,
197+
AEDA940228A843D900488C62 /* TodoListViewController.swift in Sources */,
198+
AEDA940628A849C300488C62 /* WeatherViewController.swift in Sources */,
199+
AE880F0428A61B8F001336CE /* Table.swift in Sources */,
200+
AEDA940C28A87A1900488C62 /* Post.swift in Sources */,
201+
AEDA940828A84B8700488C62 /* Weather.swift in Sources */,
202+
AE880F0628A61B8F001336CE /* TableData.swift in Sources */,
203+
AE880F0528A61B8F001336CE /* Extensions.swift in Sources */,
181204
AE5B965428A24F690055CB00 /* AppDelegate.swift in Sources */,
182-
AE5B967128A24F810055CB00 /* ThirdViewController.swift in Sources */,
205+
AEDA940428A8498000488C62 /* Todo.swift in Sources */,
206+
AE880F0828A61BBD001336CE /* Methods.swift in Sources */,
183207
AE5B965628A24F690055CB00 /* SceneDelegate.swift in Sources */,
208+
AEDA940028A8417000488C62 /* ContactListViewController.swift in Sources */,
184209
);
185210
runOnlyForDeploymentPostprocessing = 0;
186211
};
@@ -325,6 +350,7 @@
325350
buildSettings = {
326351
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
327352
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
353+
CODE_SIGN_IDENTITY = "Apple Development";
328354
CODE_SIGN_STYLE = Automatic;
329355
CURRENT_PROJECT_VERSION = 1;
330356
DEVELOPMENT_TEAM = 9QVBLDBX4H;
@@ -340,8 +366,9 @@
340366
"@executable_path/Frameworks",
341367
);
342368
MARKETING_VERSION = 1.0;
343-
PRODUCT_BUNDLE_IDENTIFIER = alemu.ben.Example;
369+
PRODUCT_BUNDLE_IDENTIFIER = alemusood.benyam.Example;
344370
PRODUCT_NAME = "$(TARGET_NAME)";
371+
PROVISIONING_PROFILE_SPECIFIER = "";
345372
SWIFT_EMIT_LOC_STRINGS = YES;
346373
SWIFT_VERSION = 5.0;
347374
TARGETED_DEVICE_FAMILY = "1,2";
@@ -353,6 +380,7 @@
353380
buildSettings = {
354381
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
355382
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
383+
CODE_SIGN_IDENTITY = "Apple Development";
356384
CODE_SIGN_STYLE = Automatic;
357385
CURRENT_PROJECT_VERSION = 1;
358386
DEVELOPMENT_TEAM = 9QVBLDBX4H;
@@ -368,8 +396,9 @@
368396
"@executable_path/Frameworks",
369397
);
370398
MARKETING_VERSION = 1.0;
371-
PRODUCT_BUNDLE_IDENTIFIER = alemu.ben.Example;
399+
PRODUCT_BUNDLE_IDENTIFIER = alemusood.benyam.Example;
372400
PRODUCT_NAME = "$(TARGET_NAME)";
401+
PROVISIONING_PROFILE_SPECIFIER = "";
373402
SWIFT_EMIT_LOC_STRINGS = YES;
374403
SWIFT_VERSION = 5.0;
375404
TARGETED_DEVICE_FAMILY = "1,2";

Example/Example/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// AppDelegate.swift
33
// Example
44
//
5-
// Created by Ben Alemu on 8/9/22.
5+
// Created by Benyam Alemu Sood on 8/9/22.
66
//
77

88
import UIKit

Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
"scale" : "2x",
7171
"size" : "40x40"
7272
},
73+
{
74+
"idiom" : "ipad",
75+
"scale" : "1x",
76+
"size" : "76x76"
77+
},
7378
{
7479
"idiom" : "ipad",
7580
"scale" : "2x",
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "media.beach.jpeg",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"filename" : "media.hike.jpeg",
5+
"idiom" : "universal",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"author" : "xcode",
19+
"version" : 1
20+
}
21+
}
Loading

Example/Example/Base.lproj/Main.storyboard

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<!--View Controller-->
1212
<scene sceneID="tne-QT-ifu">
1313
<objects>
14-
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="Example" customModuleProvider="target" sceneMemberID="viewController">
14+
<viewController modalPresentationStyle="fullScreen" id="BYZ-38-t0r" sceneMemberID="viewController">
1515
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
1616
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
1717
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// ContactListViewController.swift
3+
// Example
4+
//
5+
// Created by Benyam Alemu Sood on 8/13/22.
6+
//
7+
8+
import UIKit
9+
10+
class ContactListViewController: UIViewController {
11+
12+
let table = Table(data: ["Adam", "Juan", "Kate", "Siddharth", "Mary", "Zhao"])
13+
14+
15+
override func viewDidLoad() {
16+
super.viewDidLoad()
17+
18+
19+
// Creating table
20+
let tableView = table.show()
21+
view.addSubview(tableView)
22+
23+
24+
// Customization
25+
table.setHeader(title: "Contacts")
26+
table.setAccessory(style: .disclosureIndicator)
27+
28+
table.setAction { indexPath, element, cell in
29+
self.showAlert(title: "Sending call", message: "Calling \(element) ...")
30+
}
31+
32+
33+
}
34+
35+
36+
37+
}

Example/Example/Examples/Post.swift

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
// Weather.swift
3+
// Example
4+
//
5+
// Created by Benyam Alemu Sood on 8/13/22.
6+
//
7+
8+
import Foundation
9+
10+
import UIKit
11+
12+
struct Post {
13+
let name: String
14+
let description: String
15+
let imageSource: String
16+
}
17+
18+
19+
extension Post: TableData {
20+
var title: String {
21+
return self.name
22+
}
23+
24+
var subtitle: String? {
25+
return self.description
26+
}
27+
28+
var image: UIImage? {
29+
return UIImage(named: imageSource) ?? nil
30+
31+
}
32+
33+
}

0 commit comments

Comments
 (0)