Post not yet marked as solved
For me it was the name of an CoreData entity attribute. It is not allowed to start an attribute name with "new...".
Nothing in Xcode does tell you that and it took me days to find out. I just got the EXC_BAD_ACCESS error.
Just wanted to leave this here for the next poor soul facing my specific problem ;)
The reason for this is explained here: https://developer.apple.com/library/archive/releasenotes/ObjectiveC/RN-TransitioningToARC/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011226-CH1-SW14
I came across this article that lead me to the solution:
https://alexj.org/11/core-data-attribute-naming
Post not yet marked as solved
Same error here, since iOS 16. The crashed for my app in the AppStore increased by almost a few 100% since iOS 16 (and still in 16.1). I have absolutely no indication why this is happening. I can't reproduce this error at all.
Post not yet marked as solved
Please fill a feedback so Apple becomes more aware of that. So many people are asking for e.g. 'becomeFirstResponder' (https://developer.apple.com/forums/thread/650263) but I would also like to see things like (part of my feedback): It would be great to be able to set the first responder manually in SwiftUI (e.g. focus TextField or dismiss the keyboard).
It would be great to be able to add a toolbar above the keyboard (add custom buttons like a ready or next button)
It would be great to be able to automatically shrink the visible view when the keyboard comes in to view. Like a VStack with the view and the keyboard.
So please fill a feedback. I would love to become a native solution.
Post not yet marked as solved
Maybe there's a better way to do it, but have a look: https://github.com/AlmightyBeaver/Dynamic-Predicate-CoreData-SwiftUI
Post not yet marked as solved
A lot of people asking for it: https://developer.apple.com/forums/thread/650263
Please fill a feedback so Apple becomes more aware of it. The more the better.
Post not yet marked as solved
Hopefully they will add this in the beta phase.
Post not yet marked as solved
Not yet
https://developer.apple.com/forums/thread/651193
Post not yet marked as solved
This works...at least in most cases, e.g. only some symbol will work with .font(.largeTitle). I think it's not yet fully implemented.
struct SFSymbols2V: View {
		let symbols: [String] = ["sun.max.fill",
														 "sunrise.fill",
														 "cloud.sun.rain.fill",
														 "cloud.heavyrain.fill",
														 "thermometer.sun.fill",
														 "thermometer.snowflake",
														 "exclamationmark.triangle.fill",
														 "star.fill","pencil.tip.crop.circle.badge.plus"]
		
		var body: some View {
				List{
						ForEach(symbols, id: \.self){ symbol in
								Image(systemName: symbol)
										.renderingMode(.original)
										.padding(.all, 10)
						}
						.background(Color.gray)
				}
		}
}
Sorry, I didn't read properly. I couldn't find an official explanation either.
You have to add the BorderlessButtonStyle to each button:
List {
		HStack {
				Button(action: {
						print("button 1 tapped")
				}) {
						Text("One")
				}.buttonStyle(BorderlessButtonStyle())
				Button(action: {
						print("button 2 tapped")
				}) {
						Text("Two")
				}.buttonStyle(BorderlessButtonStyle())
		}
}
Post not yet marked as solved
Unfortunately it does look like, they won't do it.
https://developer.apple.com/forums/thread/650263
But please fill in a feedback. The more people the better. Maybe they will add it in the beta phase.
You can use this approach https://developer.apple.com/forums/thread/650876
and then use the NSPersistentCloudKitContainer instead of NSPersistentContainer.
A good explanation of how to integrate the NSPersistentCloudKitContainer properly is here:
andrewcbancroft.com/blog/ios-development/data-persistence/getting-started-with-nspersistentcloudkitcontainer/
Post not yet marked as solved
It's not really a picker, but you could do this:
struct IngredientsPickerView: View {
		@State var ingredients: [Ingredient] = [Ingredient(name: "Salt"),
																						Ingredient(name: "Pepper"),
																						Ingredient(name: "Chili"),
																						Ingredient(name: "Milk")]
		
		var body: some View{
				List{
						ForEach(0..<ingredients.count){ index in
								HStack {
										Button(action: {
												ingredients[index].isSelected = ingredients[index].isSelected ? false : true
										}) {
												HStack{
														if ingredients[index].isSelected {
																Image(systemName: "checkmark.circle.fill")
																		.foregroundColor(.green)
																		.animation(.easeIn)
														} else {
																Image(systemName: "circle")
																		.foregroundColor(.primary)
																		.animation(.easeOut)
														}
														Text(ingredients[index].name)
												}
										}.buttonStyle(BorderlessButtonStyle())
								}
						}
				}
		}
}
struct Ingredient{
		var id = UUID()
		var name: String
		var isSelected: Bool = false
}
Post not yet marked as solved
I would also love to see a native solution.
I did one on my own. Maybe you can use it too.
https://github.com/AlmightyBeaver/MultiPicker