@@ -20,7 +20,7 @@ final class AppRouter {
2020 self . persistence = persistence
2121 }
2222
23- func createPlayground( with options: MenuOptions ) {
23+ func createPlayground( with options: MenuOptions , contents : String = " " ) {
2424 let platform : PlaygroundPlatform
2525 var showOptions = false
2626
@@ -57,16 +57,16 @@ final class AppRouter {
5757
5858 guard let url = panel. url else { return }
5959
60- createPlayground ( for: platform, at: url, usingDefaultName: false )
60+ createPlayground ( for: platform, at: url, usingDefaultName: false , contents : contents )
6161 } else {
6262 let url = storageLocationShowingPanelIfNeeded ( )
6363
64- createPlayground ( for: platform, at: url, usingDefaultName: true )
64+ createPlayground ( for: platform, at: url, usingDefaultName: true , contents : contents )
6565 }
6666
6767 }
6868
69- private func createPlayground( for platform: PlaygroundPlatform , at location: URL ? , usingDefaultName defaultName: Bool ) {
69+ private func createPlayground( for platform: PlaygroundPlatform , at location: URL ? , usingDefaultName defaultName: Bool , contents : String ) {
7070 var playgroundUrl : URL ?
7171
7272 guard let location = location else {
@@ -85,7 +85,7 @@ final class AppRouter {
8585 }
8686
8787 do {
88- playgroundUrl = try playgroundMaker. createPlayground ( named: name, at: directory, platform: platform)
88+ playgroundUrl = try playgroundMaker. createPlayground ( named: name, at: directory, platform: platform, contents : contents )
8989 } catch {
9090 handle ( error)
9191 }
0 commit comments