Skip to content

Commit 0918a11

Browse files
committed
收录周五课程
1 parent 0832862 commit 0918a11

File tree

2 files changed

+28
-17
lines changed

2 files changed

+28
-17
lines changed

tools/update/download.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[返回主页](../../README.md) / [Back to Main Page](../../en/README.md)
22

3-
# 课程视频 / Videos
3+
# 课程视频 / Lecture Videos
44

55
1. <details><summary><a href="https://itunesu-assets.itunes.apple.com/apple-assets-us-std-000001/CobaltPublic128/v4/c2/81/f1/c281f1aa-3abd-e87e-e16d-7eb0d4b1a5d8/311-6554896743492737986-01_9_25_17_1080p_CS193p_1080p_3mb_cc.m4v">Introduction to iOS 11, Xcode 9 and Swift 4</a></summary>Paul Hegarty provides an overview of the lecture series and introduces the different components in iOS. He concludes with a demo of Concentration Game.</details>
66
2. <details><summary><a href="https://itunesu-assets.itunes.apple.com/apple-assets-us-std-000001/CobaltPublic118/v4/a3/0f/1e/a30f1e6c-66b6-35da-ca51-321d272f0444/309-2503760600607007728-02_9_27_17_CS193p_720p_3mb_cc.m4v">MVC</a></summary>Paul Hegarty explains the Model-View-Controller (MVC) concept. He then continues the Concentration demo: demonstrating the application of MVC to the Concentration Game.</details>
@@ -19,6 +19,12 @@
1919
15. <details><summary><a href="https://itunesu-assets.itunes.apple.com/apple-assets-us-std-000001/CobaltPublic118/v4/ca/bd/dc/cabddc02-88ed-f3b1-42df-a9efb8271e48/532-3346936006580998385-15_11_13_17_prores_CS193p_1080p_3mb_cc.m4v">Alerts, Notifications, Application Lifecycle</a></summary>Paul Hegarty covers alerts and action sheets, notifications and KVO, and the application lifecycle.</details>
2020
16. <details><summary><a href="https://itunesu-assets.itunes.apple.com/apple-assets-us-std-000001/CobaltPublic118/v4/53/9b/4d/539b4d08-12e4-e0ff-8429-21d3b3df534a/511-8983128522622077657-16_11_15_17_prores_CS193p_1080p_3mb.m4v">More Segues</a></summary>Paul Hegarty talks about modal, popover, unwind, and embed segues.</details>
2121

22+
# 周五课程 / Friday Sessions
23+
24+
1. <details><summary><a href="https://itunesu-assets.itunes.apple.com/apple-assets-us-std-000001/CobaltPublic128/v4/05/6b/ee/056beea1-11c6-13da-e46a-56952ed2c733/504-8815564797834236275-Friday_01_9_29_17_WIP02_CS193p_1080p_3mb_cc.m4v">Debugging and Xcode Tips and Tricks</a></summary>Jason Riggs talks about debugging and shares Xcode tips and tricks.</details>
25+
2. <details><summary><a href="https://itunesu-assets.itunes.apple.com/apple-assets-us-std-000001/CobaltPublic118/v4/7b/61/60/7b616031-b2f8-bf76-5171-9dd7c29109ba/533-6252825471341223932-Friday_02_WIP02_1080p_CS193p_1080p_3mb_cc.m4v">Github and Source Control Workflow</a></summary>Junjie Ke covers Github and the source control workflow.</details>
26+
3. <details><summary><a href="https://itunesu-assets.itunes.apple.com/apple-assets-us-std-000001/CobaltPublic118/v4/30/9a/56/309a56d3-b57a-0bb1-c465-d80ec6740160/531-9139141023410630962-Friday_03_10_27_17_WIP02_CS193p_1080p_3mb_cc.m4v">Instruments</a></summary>Jason Riggs explains instruments.</details>
27+
2228
# 课程讲义 / Slides
2329

2430
1. [Lecture 1 Slides](https://itunesu-assets.itunes.apple.com/apple-assets-us-std-000001/CobaltPublic118/v4/b8/e3/2e/b8e32eaf-b0c4-4c3c-15e3-047f446b3e39/306-8064245884110005836-CS193P_F17_Lecture_1.pdf)
@@ -53,4 +59,4 @@
5359
5. [Image Gallery](https://itunesu-assets.itunes.apple.com/apple-assets-us-std-000001/CobaltPublic118/v4/22/c3/00/22c30013-28dd-41eb-e104-a4594ec95dad/308-8518403617003934463-CS193P_F17_Assignment_5.pdf)
5460
6. [Persistent Image Gallery](https://itunesu-assets.itunes.apple.com/apple-assets-us-std-000001/CobaltPublic128/v4/5a/46/19/5a4619d5-bee0-1379-e204-731912cea353/307-9138746427331321981-CS193P_F17_Assignment_6.pdf)
5561

56-
<details><summary>已收录 41/41 Entries</summary><script type="text/javascript"> window.onload = function () { document.getElementsByClassName("project-name")[0].innerHTML = "下载列表 / Course Materials"; } </script></details>
62+
<details><summary>已收录 44/44 Entries</summary><script type="text/javascript"> window.onload = function () { document.getElementsByClassName("project-name")[0].innerHTML = "下载列表 / Course Materials"; } </script></details>

tools/update/main.swift

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,24 @@ let iTunesUCourseID = 1309275316
1212

1313
enum ResourceType: String, CustomStringConvertible {
1414
// Raw Type: video/x-m4v, video/mp4
15-
case video = "Video"
15+
case lecture = "Video"
16+
case friday = "Friday Session"
1617
// Raw Type: application/pdf
1718
case slides = "Slides"
18-
case demoCode = "Demo Code"
19-
case readingAssignment = "Reading"
20-
case programmingProject = "Programming Project"
19+
case demo = "Demo Code"
20+
case reading = "Reading"
21+
case project = "Programming Project"
2122

22-
static let all: [ResourceType] = [.video, .slides, .demoCode, .readingAssignment, .programmingProject]
23+
static let all: [ResourceType] = [.lecture, .friday, .slides, .demo, .reading, .project]
2324

2425
var description: String {
2526
switch self {
26-
case .video: return "课程视频 / Videos"
27-
case .slides: return "课程讲义 / Slides"
28-
case .demoCode: return "示例代码 / Demo Code"
29-
case .readingAssignment: return "阅读作业 / Readings"
30-
case .programmingProject: return "编程作业 / Programming Projects"
27+
case .lecture: return "课程视频 / Lecture Videos"
28+
case .friday: return "周五课程 / Friday Sessions"
29+
case .slides: return "课程讲义 / Slides"
30+
case .demo: return "示例代码 / Demo Code"
31+
case .reading: return "阅读作业 / Readings"
32+
case .project: return "编程作业 / Programming Projects"
3133
}
3234
}
3335
}
@@ -43,26 +45,28 @@ struct Resource: CustomStringConvertible {
4345
self.url = url
4446

4547
if rawType.contains("video") {
46-
type = .video
48+
type = title.hasPrefix("Friday") ? .friday : .lecture
4749
} else if let resType = ResourceType.all.first(where: { title.contains($0.rawValue) }) {
4850
type = resType
4951
} else {
5052
fatalError("Unknown Raw Type \(rawType)")
5153
}
5254

5355
var parts: [String]
54-
if type == .video {
56+
switch type {
57+
case .lecture:
5558
// 4. Views -> index: 4, title: Views
5659
parts = title.components(separatedBy: ". ")
57-
} else if type == .readingAssignment {
60+
case .reading:
5861
// Reading 1: Intro to Swift -> index: 1, title: Intro to Swift
5962
parts = title.components(separatedBy: ": ")
6063
parts[0] = parts[0].components(separatedBy: " ")[1]
61-
} else if type == .programmingProject {
64+
case .project, .friday:
6265
// Programming Project 2: Calculator Brain -> index: 2, title: Calculator Brain
66+
// Friday Session 3: Instruments
6367
parts = title.components(separatedBy: ": ")
6468
parts[0] = parts[0].components(separatedBy: " ")[2]
65-
} else {
69+
default:
6670
// Lecture 6 Slides -> index: 6, title: Lecture 6 Slides
6771
// Lecture 9 Demo Code: Smashtag -> index: 9, title: Lecture 9 Demo Code: Smashtag
6872
parts = [title.components(separatedBy: " ")[1], title]
@@ -189,6 +193,7 @@ class ParsingDelegate: NSObject, XMLParserDelegate {
189193
let workspace = NSWorkspace.shared()
190194
#endif
191195
workspace.activateFileViewerSelecting([url])
196+
print("Written to \(url.path)")
192197
} catch {
193198
print(out)
194199
}

0 commit comments

Comments
 (0)