Skip to content

Commit

Permalink
Make playground great again!
Browse files Browse the repository at this point in the history
Add info
  • Loading branch information
Czajnikowski committed Jul 8, 2019
1 parent 8bca847 commit 5d00d57
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 19 deletions.
16 changes: 0 additions & 16 deletions Babylon.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
remoteGlobalIDString = AE9FC0D322D338060095633E;
remoteInfo = View;
};
AE9FC13822D340580095633E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = AE9FC11022D3396F0095633E /* View.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = AE9FC0D222D338060095633E;
remoteInfo = View;
};
AE9FC21F22D343E50095633E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = AE9FC21B22D343E50095633E /* Networking.xcodeproj */;
Expand Down Expand Up @@ -205,7 +198,6 @@
buildRules = (
);
dependencies = (
AE9FC13922D340580095633E /* PBXTargetDependency */,
);
name = Babylon;
productName = Babylon;
Expand Down Expand Up @@ -316,14 +308,6 @@
};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
AE9FC13922D340580095633E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = View;
targetProxy = AE9FC13822D340580095633E /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
AE97770E22C2195F003C943B /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import PlaygroundSupport
import View

PlaygroundPage.current.liveView = PostListViewBuilder
PlaygroundPage.current.liveView = MockedPostListViewBuilder
.buildMocked()
.wrappedInHostingController
19 changes: 19 additions & 0 deletions View/Experiences/PostList/PostListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ struct PostListView<ViewModel>: View
where ViewModel: PostListViewModelRepresenting {
@ObjectBinding private var viewModel: ViewModel

@State private var isInfoPresented: Bool = false

private let listDestinationViewBuilder: ViewForPostWithIdBuilding

var body: some View {
Expand All @@ -39,11 +41,28 @@ where ViewModel: PostListViewModelRepresenting {
Text("Posts".localized(comment: "Navigation bar title"))
)
.navigationBarItems(
leading: Button(action: { self.isInfoPresented = true }) {
Image(systemName: "info")
},
trailing: Button(action: viewModel.loadData) {
Image(systemName: "arrow.counterclockwise")
}
)
.alertPresentation(using: viewModel)
.presentation($isInfoPresented) {
return ActionSheet(
title: Text(
"""
\("Babylon health demo submision by Maciek Czarnik"
.localized(
comment: "Info section"
)
)
@czajnikowski
"""
)
)
}
}
.onAppear(perform: viewModel.loadData)
}
Expand Down
1 change: 1 addition & 0 deletions View/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
"by: %@" = "by: %@";
"Error" = "Error";
"Unknown error" = "Unknown error";
"Babylon health demo submision by Maciek Czarnik" = "Babylon health demo submision by Maciek Czarnik";
1 change: 1 addition & 0 deletions View/Resources/es.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
"by: %@" = "por: %@";
"Error" = "Error";
"Unknown error" = "Error desconocido";
"Babylon health demo submision by Maciek Czarnik" = "Babylon health presentación de la demo por Maciek Czarnik";
4 changes: 2 additions & 2 deletions View/View.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
AE9FC0F022D338880095633E /* MockedPostDetailsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockedPostDetailsViewModel.swift; sourceTree = "<group>"; };
AE9FC0F122D338880095633E /* PostDetailsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostDetailsView.swift; sourceTree = "<group>"; };
AE9FC0F222D338880095633E /* PostDetailsViewBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostDetailsViewBuilder.swift; sourceTree = "<group>"; };
AE9FC0F322D338880095633E /* PostDetailsExperience.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = PostDetailsExperience.playground; sourceTree = "<group>"; };
AE9FC0F322D338880095633E /* PostDetailsExperience.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = PostDetailsExperience.playground; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
AE9FC0F622D338880095633E /* MockedPostListViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockedPostListViewModel.swift; sourceTree = "<group>"; };
AE9FC0F722D338880095633E /* PostListView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostListView.swift; sourceTree = "<group>"; };
AE9FC0F822D338880095633E /* PostListViewBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostListViewBuilder.swift; sourceTree = "<group>"; };
AE9FC0F922D338880095633E /* PostListExperience.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = PostListExperience.playground; sourceTree = "<group>"; };
AE9FC0F922D338880095633E /* PostListExperience.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = PostListExperience.playground; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.swift; };
AE9FC0FC22D338880095633E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
AE9FC0FD22D338880095633E /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down

0 comments on commit 5d00d57

Please sign in to comment.