Posts

Post not yet marked as solved
2 Replies
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
2 Replies
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
6 Replies
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
7 Replies
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
2 Replies
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
2 Replies
Hopefully they will add this in the beta phase.
Post not yet marked as solved
1 Replies
Not yet https://developer.apple.com/forums/thread/651193
Post not yet marked as solved
3 Replies
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) 				} 		} }
Post not yet marked as solved
1 Replies
That would be awesome.
Post marked as solved
3 Replies
Sorry, I didn't read properly. I couldn't find an official explanation either.
Post marked as solved
3 Replies
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
1 Replies
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.
Post marked as solved
1 Replies
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
3 Replies
It's not really a picker, but you could do this: struct IngredientsPickerView: View { &#9;&#9;@State var ingredients: [Ingredient] = [Ingredient(name: "Salt"), &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Ingredient(name: "Pepper"), &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Ingredient(name: "Chili"), &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Ingredient(name: "Milk")] &#9;&#9; &#9;&#9;var body: some View{ &#9;&#9;&#9;&#9;List{ &#9;&#9;&#9;&#9;&#9;&#9;ForEach(0..<ingredients.count){ index in &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;HStack { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Button(action: { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;ingredients[index].isSelected = ingredients[index].isSelected ? false : true &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}) { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;HStack{ &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;if ingredients[index].isSelected { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Image(systemName: "checkmark.circle.fill") &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;.foregroundColor(.green) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;.animation(.easeIn) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} else { &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Image(systemName: "circle") &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;.foregroundColor(.primary) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;.animation(.easeOut) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;Text(ingredients[index].name) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;}.buttonStyle(BorderlessButtonStyle()) &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;&#9;&#9;} &#9;&#9;&#9;&#9;} &#9;&#9;} } struct Ingredient{ &#9;&#9;var id = UUID() &#9;&#9;var name: String &#9;&#9;var isSelected: Bool = false }
Post not yet marked as solved
3 Replies
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