Add CollectionPicker view for testing collection-selection functionality

This commit is contained in:
Angelo Stavrow 2020-07-31 16:26:37 -04:00
parent f8de848400
commit 97a02b8530
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import SwiftUI
struct CollectionPicker: View {
@Binding var selectedCollection: PostCollection
private let collections = [
defaultDraftCollection,
testPostCollection1,
testPostCollection2,
testPostCollection3
]
var body: some View {
Picker("Collection", selection: $selectedCollection) {
ForEach(collections) { collection in
Text(collection.title).tag(collection)
}
}
}
}

View File

@ -9,6 +9,8 @@
/* Begin PBXBuildFile section */
171BFDF724D49FD400888236 /* PostCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 171BFDF624D49FD400888236 /* PostCollection.swift */; };
171BFDF824D49FD400888236 /* PostCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 171BFDF624D49FD400888236 /* PostCollection.swift */; };
171BFDFA24D4AF8300888236 /* CollectionPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 171BFDF924D4AF8300888236 /* CollectionPicker.swift */; };
171BFDFB24D4AF8300888236 /* CollectionPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 171BFDF924D4AF8300888236 /* CollectionPicker.swift */; };
1756AE6B24CB1E4B00FD7257 /* Post.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756AE6A24CB1E4B00FD7257 /* Post.swift */; };
1756AE6C24CB1E4B00FD7257 /* Post.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756AE6A24CB1E4B00FD7257 /* Post.swift */; };
1756AE6E24CB255B00FD7257 /* PostStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1756AE6D24CB255B00FD7257 /* PostStore.swift */; };
@ -53,6 +55,7 @@
/* Begin PBXFileReference section */
171BFDF624D49FD400888236 /* PostCollection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostCollection.swift; sourceTree = "<group>"; };
171BFDF924D4AF8300888236 /* CollectionPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionPicker.swift; sourceTree = "<group>"; };
1756AE6A24CB1E4B00FD7257 /* Post.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Post.swift; sourceTree = "<group>"; };
1756AE6D24CB255B00FD7257 /* PostStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostStore.swift; sourceTree = "<group>"; };
1756AE7324CB26FA00FD7257 /* PostCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostCell.swift; sourceTree = "<group>"; };
@ -241,6 +244,7 @@
isa = PBXGroup;
children = (
171BFDF624D49FD400888236 /* PostCollection.swift */,
171BFDF924D4AF8300888236 /* CollectionPicker.swift */,
);
path = PostCollection;
sourceTree = "<group>";
@ -459,6 +463,7 @@
files = (
17DF32AC24C87D3500BCE2E3 /* ContentView.swift in Sources */,
1756AE8124CB844500FD7257 /* View+Keyboard.swift in Sources */,
171BFDFA24D4AF8300888236 /* CollectionPicker.swift in Sources */,
1756AE7724CB2EDD00FD7257 /* PostEditor.swift in Sources */,
17DF32D524C8CA3400BCE2E3 /* PostStatusBadge.swift in Sources */,
1756AE7A24CB65DF00FD7257 /* PostList.swift in Sources */,
@ -479,6 +484,7 @@
1756AE7824CB2EDD00FD7257 /* PostEditor.swift in Sources */,
17DF32D624C8CA3400BCE2E3 /* PostStatusBadge.swift in Sources */,
1756AE7B24CB65DF00FD7257 /* PostList.swift in Sources */,
171BFDFB24D4AF8300888236 /* CollectionPicker.swift in Sources */,
17DF32AB24C87D3500BCE2E3 /* WriteFreely_MultiPlatformApp.swift in Sources */,
1756AE6F24CB255B00FD7257 /* PostStore.swift in Sources */,
1756AE6C24CB1E4B00FD7257 /* Post.swift in Sources */,