Skip to content

Commit 63563fd

Browse files
committed
Finished writing issue08
1 parent a99c574 commit 63563fd

File tree

6 files changed

+395
-158
lines changed

6 files changed

+395
-158
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ Here are the available issues:
1212
- [Issue 05 - The Builder Pattern and Fluent Interface](issue05/README.md)
1313
- [Issue 06 - The Swift Runtime (Part 4) - Generics](issue06/README.md)
1414
- [Issue 07 - The Swift Runtime (Part 5) - Operators](issue07/README.md)
15-
15+
- [Issue 08 - The Swift Runtime (Part 6) - Type Casting](issue08/README.md)

issue08/README.md

+378-4
Large diffs are not rendered by default.

issue08/exampleCode/swift-weekly.xcodeproj/project.pbxproj

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
/* End PBXContainerItemProxy section */
2727

2828
/* Begin PBXFileReference section */
29-
9DA78DE61A63A0920018D1DE /* dummy */ = {isa = PBXFileReference; lastKnownFileType = text; path = dummy; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.asm.i386; };
3029
9DB1E34A1A48323C006CE680 /* swift-weekly.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "swift-weekly.app"; sourceTree = BUILT_PRODUCTS_DIR; };
3130
9DB1E34E1A48323C006CE680 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
3231
9DB1E34F1A48323C006CE680 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -84,7 +83,6 @@
8483
9DB1E3561A48323C006CE680 /* Images.xcassets */,
8584
9DB1E3581A48323C006CE680 /* LaunchScreen.xib */,
8685
9DB1E34D1A48323C006CE680 /* Supporting Files */,
87-
9DA78DE61A63A0920018D1DE /* dummy */,
8886
);
8987
path = "swift-weekly";
9088
sourceTree = "<group>";

issue08/exampleCode/swift-weekly/ViewController.swift

+16-16
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@ class ViewController: UIViewController {
3131

3232
}
3333

34-
class Vehicle{
35-
func id() -> Int{
36-
return 0xabcdefa
34+
class Vehicle{
35+
func id() -> Int{
36+
return 0xabcdefa
37+
}
3738
}
38-
}
39-
40-
class Car : Vehicle{
41-
override func id() -> Int {
42-
return 0xabcdefc
39+
40+
class Car : Vehicle{
41+
override func id() -> Int {
42+
return 0xabcdefc
43+
}
44+
}
45+
46+
func example2(){
47+
let v: Vehicle = Car()
48+
let c = [v][0] as Car
49+
println(c)
4350
}
44-
}
45-
46-
func example2(){
47-
let v: Vehicle = Car()
48-
let c = [v][0] as Car
49-
println(c)
50-
}
5151

5252
class Bicycle : Vehicle{
5353
override func id() -> Int {
@@ -73,6 +73,6 @@ func example2(){
7373

7474
example2()
7575
}
76-
76+
7777
}
7878

issue08/exampleCode/swift-weekly/dummy

-135
This file was deleted.

0 commit comments

Comments
 (0)