Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- finally: storyboards in playground books
- Loading branch information
1 parent
823a907
commit a13a709
Showing
48 changed files
with
1,031 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...n books/Travel.playgroundbook/Contents/Chapters/Chapter1.playgroundchapter/Manifest.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Version</key> | ||
<string>1.0</string> | ||
<key>Name</key> | ||
<string>Chapter 1</string> | ||
<key>Pages</key> | ||
<array> | ||
<string>Page1.playgroundpage</string> | ||
</array> | ||
</dict> | ||
</plist> |
9 changes: 9 additions & 0 deletions
9
...ok/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page1.playgroundpage/Contents.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/*: | ||
# It's a me, tha storyboard! | ||
Playground Books can do a lot. You might know this already. But have you ever thought of using your already | ||
existing storyboards within your playgrounds and books? If not, now is the time :) | ||
* callout(Storyboards!): | ||
Build your view controller as you are used to and then just use them within your gorgeous Swift Playground Book. | ||
*/ | ||
|
7 changes: 7 additions & 0 deletions
7
...ok/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page1.playgroundpage/LiveView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import PlaygroundSupport | ||
import UIKit | ||
|
||
let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) | ||
let ctrl = storyboard.instantiateViewController(withIdentifier: "view") | ||
|
||
PlaygroundPage.current.liveView = ctrl |
14 changes: 14 additions & 0 deletions
14
...ok/Contents/Chapters/Chapter1.playgroundchapter/Pages/Page1.playgroundpage/Manifest.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Name</key> | ||
<string>Page 1</string> | ||
<key>LiveViewMode</key> | ||
<string>VisibleByDefault</string> | ||
<key>LiveViewEdgeToEdge</key> | ||
<true/> | ||
<key>PlaygroundLoggingMode</key> | ||
<string>Normal</string> | ||
</dict> | ||
</plist> |
8 changes: 8 additions & 0 deletions
8
...apters/Chapter1.playgroundchapter/Pages/Page1.playgroundpage/PrivateResources/Hints.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>Hints</key> | ||
<array/> | ||
</dict> | ||
</plist> |
Empty file.
Empty file.
26 changes: 26 additions & 0 deletions
26
storyboard in books/Travel.playgroundbook/Contents/Manifest.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>SwiftVersion</key> | ||
<string>3.0</string> | ||
<key>ImageReference</key> | ||
<string>Icon.png</string> | ||
<key>Version</key> | ||
<string>3.0</string> | ||
<key>ContentVersion</key> | ||
<string>1.0</string> | ||
<key>Name</key> | ||
<string>Empty</string> | ||
<key>ContentIdentifier</key> | ||
<string>com.ms.demo.TravelLog</string> | ||
<key>DeploymentTarget</key> | ||
<string>ios10.0</string> | ||
<key>DevelopmentRegion</key> | ||
<string>en</string> | ||
<key>Chapters</key> | ||
<array> | ||
<string>Chapter1.playgroundchapter</string> | ||
</array> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+41.7 KB
storyboard in books/Travel.playgroundbook/Contents/PrivateResources/Assets.car
Binary file not shown.
Binary file added
BIN
+74.3 KB
storyboard in books/Travel.playgroundbook/Contents/PrivateResources/Icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.74 KB
....playgroundbook/Contents/PrivateResources/Main.storyboardc/AqW-SP-zhf-view-OCl-26-9ar.nib
Binary file not shown.
Binary file added
BIN
+6.55 KB
....playgroundbook/Contents/PrivateResources/Main.storyboardc/BYZ-38-t0r-view-8bC-Xf-vdC.nib
Binary file not shown.
Binary file added
BIN
+189 Bytes
...oard in books/Travel.playgroundbook/Contents/PrivateResources/Main.storyboardc/Info.plist
Binary file not shown.
Binary file added
BIN
+1001 Bytes
storyboard in books/Travel.playgroundbook/Contents/PrivateResources/Main.storyboardc/log.nib
Binary file not shown.
Binary file added
BIN
+1.26 KB
...yboard in books/Travel.playgroundbook/Contents/PrivateResources/Main.storyboardc/view.nib
Binary file not shown.
Empty file.
Empty file.
32 changes: 32 additions & 0 deletions
32
storyboard in books/Travel.playgroundbook/Contents/Sources/LogController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// LogController.swift | ||
// TravelLog | ||
// | ||
// Created by Manu Rink on 30.08.17. | ||
// Copyright © 2017 microsoft. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
@objc(LogController) | ||
class LogController : UIViewController { | ||
|
||
@IBOutlet weak var greetingsLabel: UILabel! | ||
var greeting : String? | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
if let greetText = greeting { | ||
greetingsLabel.text = "Hola \(greetText) :)" | ||
} else { | ||
greetingsLabel.text = "Hola you :)" | ||
} | ||
} | ||
|
||
override func didReceiveMemoryWarning() { | ||
super.didReceiveMemoryWarning() | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
storyboard in books/Travel.playgroundbook/Contents/Sources/ViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// ViewController.swift | ||
// TravelLog | ||
// | ||
// Created by Manu Rink on 30.08.17. | ||
// Copyright © 2017 microsoft. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
@objc(ViewController) | ||
public class ViewController: UIViewController { | ||
|
||
@IBOutlet weak var usernameTextField: UITextField! | ||
|
||
override public func viewDidLoad() { | ||
super.viewDidLoad() | ||
// Do any additional setup after loading the view, typically from a nib. | ||
} | ||
|
||
override public func didReceiveMemoryWarning() { | ||
super.didReceiveMemoryWarning() | ||
// Dispose of any resources that can be recreated. | ||
} | ||
|
||
override public func prepare(for segue: UIStoryboardSegue, sender: Any?) { | ||
let logCtrl = segue.destination as! LogController | ||
logCtrl.greeting = usernameTextField.text | ||
} | ||
|
||
} |
Oops, something went wrong.