Post

Replies

Boosts

Views

Activity

How to add a .sks file to a playground?
Hi, I'm using the Swift Playground Author Template and I would like to use a .sks file. I added my .sks under the PrivateResources folder and with the Playground as target but when I run the playground the Tile Set from the file is not found. I checked my code in an Xcode project and it worked perfectly, so I'm sure it's something with the playground. Maybe it's not possible?
1
0
968
Apr ’21
SwiftUI toolbar not showing on a NavigationLink view
I'm trying to show a toolbar on a view that is inside to navigation links. When I navigate to the third view I get the following message: "2020-09-15 23:09:31.097289-0500 CountTime[35018:3542166] [Assert] displayModeButtonItem is internally managed and not exposed for DoubleColumn style. Returning an empty, disconnected UIBarButtonItem to fulfill the non-null contract." And the toolbar is not shown. This happens only on iPhone, not iPad. I'm using Xcode 12 GM. Here is the code: struct ContentView: View { 		var body: some View { 				NavigationView { 						NavigationLink( 								destination: SecondView(), 								label: { 										Text("Navigate") 								}) 				} 		} } struct SecondView: View { 		var body: some View { 				ZStack { 						NavigationLink( 								destination: Text("Destination") 										.toolbar { 												ToolbarItem(placement: ToolbarItemPlacement.bottomBar) { 																Button(action: { 																		print("sharing") 																}) { 																		Image(systemName: "square.and.arrow.up") 																} 												} 										}, 								label: { 										Text("Navigate") 								}) 				} 		} }
1
0
6.6k
Sep ’20
How to filter a segmented picker in SwiftUI?
I'm trying to change change the segmented picker options depending on other user selection. But the segmented picker is not even showing. @Environment(\.managedObjectContext) var managedObjectContext @FetchRequest(entity: GameDeck.entity(), sortDescriptors: []) var decks: FetchedResults&lt;GameDeck&gt; @State private var yourClass: String? @State private var selectedDeck = 0 Picker(selection: $selectedDeck, label: Text("")) { ForEach(0..<decks.filter{$0.heroClass == yourClass}.count) { Text(self.decks[$0].wrappedName) } } .pickerStyle(SegmentedPickerStyle()) What I'm trying to do is filtering the decks in which "heroClass" equals "yourClass" to show all those decks in the picker. "yourClass" selection is working properly. I'm using CoreData for the decks.
1
0
1.2k
Jun ’20