Explore the art and science of app design. Discuss user interface (UI) design principles, user experience (UX) best practices, and share design resources and inspiration.

Learn about designing great app and game experiences

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

Novice SwiftUI developer can't make network call
I'm trying to use URL structure in the foundation framework and it is failing to build, returning a nil value. Could it be trying to evaluate the string I am giving it as a variable for its argument at build time? Is there a test argument I can give URL to see if it can return a non-nil value? (of URL type)?
Topic: Design SubTopic: General
17
0
1.6k
Sep ’25
@State variable returns empty despite being set in .onAppear function
With the code below, JSON data is parsed and is stored in the variable data in the .onAppear function, however an empty set of data is passed to the Content view. How can that be fixed so that the JSON data passes to the DataView? struct ContentView: View { @State var data: [Data] @State var index: Int = 0 var body: some View { VStack { DataView(data: data[index]) } .onAppear { let filePath = Bundle.main.path(forResource: "data", ofType: "json") let url = URL(fileURLWithPath: filePath!) data = getData(url: url) } } func getData(url: URL) -> [Data] { do { let data = try Data(contentsOf: url) let jsonDecoded = try JSONDecoder().decode([Data].self, from: data) return jsonDecoded } catch let error as NSError { print("Fail: \(error.localizedDescription)") } catch { print("Fail: \(error)") } return [] } }
17
1
508
Aug ’25
Testing In-App Purchases
Hi, I have a couple of questions in regards to testing in-app purchases. I tested the subscription on a device but I'm not sure how to reset so I can test again. I didn't see the subscription in device settings or in Debug -> StoreKit -> Manage Subscriptions window. Additionally, I was wondering if there was a way to detect the subscription being made. I implemented this, but I'm not sure if that will work: .onChange(of: Product.SubscriptionInfo.RenewalState.subscribed) { if Product.SubscriptionInfo.RenewalState.subscribed == .subscribed { } }
13
0
286
Jul ’25
Video Playback on iOS 18 public release is seriously flawed
Video Playback on iOS 18 public release is asinine. I use video playback to show slow-motion video frame by frame to my students and the video can only be shown at like 3/5 of the screen size (just like Apple fouled up screenshot editing about a year ago) If you try to view video in the full screen you can’t scrub through and see time stamps or play frame by frame sliding left to right. It’s absolutely ridiculous. 2 out of 3x the video timeline finishes fully right and I haven’t watched the full clip. Here’s a video showing the issue how at the small default size I can see the entire timeline and play the full video from beginning to end, but when I go to full screen and/or zoom in or move the screen around the timeline doesn’t work and you can’t scroll through the full video! Need the video to not condense in size on the screen and play the full height / width of the screen. Also not have the text of the location showing above the screen. Way too much clutter. The reduced size of the video for editing issue started with photos several updates ago and now Apple idiotically brought a terrible flaw from photos to videos as well. Ugh.
Topic: Design SubTopic: General
12
16
5.5k
Dec ’24
NavigationStack Fatal error: ‘try!
I am struggling to get pickers work in a form. I add NavigationStack and get this error Fatal error: 'try!' expression unexpectedly raised an error: SwiftUI.AnyNavigationPath.Error.comparisonTypeMismatch I have tried most every format or picker setup as well as DatePicker and can’t seem to determine how to get the selected item in a picker list saved. running: Xcode 16.1 import SwiftUI import SwiftData struct RoundsEditView: View { @Bindable var roundsdata: RoundsData @Environment(.modelContext) private var modelContext // @Environment(.dismiss) var dismiss @State private var playDate = Date.now @State private var selectedTee = "Gold" let tees = ["Black", "Blue", "White", "Gold", "Red", "Silver"] @Query(sort: \PlayerData.playerHandle) private var players: [PlayerData] @State private var selectedHandle: PlayerData? = nil var body: some View { NavigationStack { Form { HStack { Text("Course:") TextField("Course Name", text: $roundsdata.roundscourseName) .textContentType(.name) } HStack { // DatePicker("Date:", selection: $playDate, in: ...Date(), DatePicker("Date:", selection: $playDate, displayedComponents: [.date]) // DatePicker("Date:", selection: $playDate, in: ...Date(), // displayedComponents: .date).onChange(of: playDate) { oldState, newState in model.youDidChangeMethod(from: oldState, to: newState) } Section { Picker("Handle:", selection: $selectedHandle) { Text("Select a Handle").tag(nil as PlayerData?) ForEach(players, id: \.self) { player in HStack { Text(player.playerHandle) .frame(maxWidth: .infinity, alignment: .leading) .tag(player as PlayerData?) } .frame(maxWidth: .infinity, alignment: .leading) .tag(player as PlayerData?) } } // .pickerStyle(.inline) this does not fix issue or design wise work } // HStack { // Text("Tee:") // TextField("Tee", text: $roundsdata.roundsTee) // .textContentType(.name) // } HStack { Picker("Tee:", selection: $selectedTee) { ForEach(tees, id: \.self) { Text($0) } } } HStack { Text("Handicap:") TextField("Handicap", value: $roundsdata.roundsHandicap, format: .number) .textContentType(.name) } HStack { Text("Gross:") TextField("Gross", value: $roundsdata.roundsGross, format: .number) } HStack { Text("Net:") TextField("Net", value: $roundsdata.roundsNet, format: .number) .textContentType(.name) } HStack { Text("Rating:") TextField("Rating", value: $roundsdata.roundsRating, format: .number) .textContentType(.name) } HStack { Text("Slope:") TextField("Slope", value: $roundsdata.roundsSlope, format: .number) .textContentType(.name) } } .navigationTitle("Edit Rounds") } } }
Topic: Design SubTopic: General
10
0
1.2k
Nov ’24
IOS 18 Update - Emoji Keyboard
I don't typically write reviews on new updates as they typically are fine. For once I did want to mention one thing that bothers me and hoping it can be changed. I greatly dislike the new emoji keyboard and how its become bigger. I don't like the large keyboard layout and they kind of hurt my eyes. I'm near sighted and so its not needed for me to have them so big. Is there a way to revert them to the previous version? I don't know if anyone else has the same thoughts on this subject. Maybe a possible option to have the ability to switch the keyboard size to which ever suits the user? Anything would be helpful as I do enjoy using the emojis but now I'm avoiding them. Thank you for your time and consideration.
Topic: Design SubTopic: General
8
7
7.0k
Nov ’24
Our app rejected by Guideline 4.3 - Design Please Help!
Hello, Our app rejected by following reason: Guideline 4.3 - Design We noticed your app shares a similar binary, metadata, and/or concept as apps previously submitted by a terminated Apple Developer Program account. Submitting similar or repackaged apps is a form of spam that creates clutter and makes it difficult for users to discover new apps. Next Steps Since we do not accept spam apps on the App Store, we encourage you to review your app concept and submit a unique app with distinct content and functionality. Resources Some factors that contribute to a spam rejection may include: Submitting an app with the same source code or assets as other apps already submitted to the App Store Creating and submitting multiple similar apps using a repackaged app template Purchasing an app template with problematic code from a third party Submitting several similar apps across multiple accounts Learn more about our requirements to prevent spam in App Store Review Guideline 4.3. iOS App 1.0App Version Rejection Reasons: 4.3.0 Design: Spam The application is 100% developed by our team and I am 100% sure of it. How can we do it ? Please help.
Topic: Design SubTopic: General Tags:
7
0
3.9k
Dec ’24
Complex Swift Data Relationships...
I am struggling with exactly how to set up SwiftData relationships, beyond the single relationship model... Let's say I have a school. Each school offers a set of classes. Each class is taught by one teacher and attended by several students. Teachers may teach more than one class, but only at one school. Similarly students may attend more than one class, but only at one school. Classes themselves may be offered at more than one school. Can someone create a class for School, SchoolClass, Teacher, and Student with id, name, and relationships... I have tried it unsuccessfully about 10 different ways at this point. My most recent is below... I am struggling getting beyond a school listing in the app, and I'll cross that bridge next. I am just wondering if all the trouble I am having is because I am not smart with the class definitions. And wondering if this is to complex for SwiftData and CoreData is the requirement. This is not a real app, just my way of really trying to get a handle on Swift Data models and Navigation. I am very new to Swift, and will take any and all suggestions with enthusiasm! Thanks for taking the time. import Foundation import SwiftData @Model class School: Identifiable { var id: UUID = UUID() var name: String var mascot: String var teachers: [Teacher] var schoolClasses: [SchoolClass] init (name: String, mascot: String = "", teachers: [Teacher] = [], schoolClasses: [SchoolClass] = []) { self.name = name self.mascot = mascot self.teachers = teachers } class SchoolClass: Identifiable { var id: UUID = UUID() var name: String var teacher: Teacher? var students: [Student] = [] init (name: String, teacher: Teacher? = nil, students: [Student] = []) { self.name = name self.teacher = teacher self.students = students } } class Teacher: Identifiable { var id: UUID = UUID() var name: String var tenured: Bool var school: School? var students: [Student] = [] init (name: String, tenured: Bool = false, students: [Student] = []) { self.name = name self.tenured = tenured self.students = students } } class Student: Identifiable { var id: UUID = UUID() var name: String var grade: Int? var teacher: Teacher? init (name: String, grade: Int? = nil, teacher: Teacher? = nil) { self.name = name self.grade = grade self.teacher = teacher } } }
Topic: Design SubTopic: General Tags:
6
0
740
Jul ’25
ipados 26 and xib
hi, i have an objc ipad application that use xib with zooming for adapt to the screen (until ios18) but with ipad os 26 will be displayed wrong
Topic: Design SubTopic: General
6
0
164
Jul ’25
Design Spam 4.3
Hello So I have an application which is in the Apple store. I wanted to fixe some issue therefore i created update build with the following: • Reworked Character Physics: Improved responsiveness and movement for smoother, more controlled gameplay. • Bug Fixes & Performance Enhancements: Fixed critical issues affecting gameplay consistency and stability. Players will now experience better performance and more accurate controls. • Mac Catalyst Fixes: Improved support for macOS, fixing issues related to UI scaling and responsiveness. The changes above are basically all there is. Now it seems that i am not able to pass review as it constantly marks design spam and not give anything in particular. Whats up with that ?
Topic: Design SubTopic: General
6
2
823
Feb ’25
.onAppear and .task code not running
Hi, I have the following code, which for some reason is not working as expected. I have an .onAppear and a .task function that isn't running, which I can see isn't running because nothing is printing. Any guidance would be greatly appreciated. Thank you. struct ContentView: View { var body: some View { ZStack { switch view { case .view1: View1() case .view2: View2() case .view3: View3() case .view4: View4() case .view5: View5() default: SubscriptionStoreView(groupID: "") } } .onAppear() { view = .view6 print("test 1") } .task { print("test") await refreshPurchasedProducts() } } func refreshPurchasedProducts() async { // Iterate through the user's purchased products. for await verificationResult in Transaction.currentEntitlements { switch verificationResult { case .verified(let transaction): print("verified") case .unverified(let unverifiedTransaction, let verificationError): print("unverified") default: print("default") } } } }
Topic: Design SubTopic: General Tags:
6
0
145
Apr ’25
Subscriptions Not Displaying
I have a subscription group with two individual subscriptions configured but when trying to load the SubscriptionStoreView I get the error: "Subscription Unavailable: The subscription is unavailable in the current storefront." When I try to load the ProductView, it appears to be stuck in a loading screen. I am running the app on a device that is signed into a sandbox account. Any guidance would be greatly appreciated. Thank you.
Topic: Design SubTopic: General Tags:
5
0
859
Feb ’25
Launch screen more vibrant in iOS18?
Hi! I've detected that in iOS18 launch screen colors differs from the defined ones, that is, if I create a launch screen with a color like #ff0000 (red) and the initial view controller is a view controller with the same color as background, I can see the transition between launch screen and the initial view controller because the launch screen color is different from the other one (dark in this case). I've tested it with several colors: left side is the launch screen and right side is the initial view controller. Both views created with IB using the same colors (it also happens with background images using colors) Is this an intentionall behavior? If so, theres a way to disable it? I need the transition between the launch screen and my initial view controller to be non perceptible... Thanks!
Topic: Design SubTopic: General Tags:
4
1
651
Jan ’25
How can this be resolved - load_eligibility_plist: Failed to open //private/var/db/os_eligibility/eligibility.plist: Operation not permitted(1)
I'm programming my constraints in my video game, which is working good so far until I ran into my most important interactive storyboard. I have three buttons that move back and forth on the Y position each time they are hit. The buttons Y positions only change to view.safeAreaLayoutGuide.centerYAnchor, constant: 100 or view.safeAreaLayoutGuide.centerYAnchor, constant: 200 or view.safeAreaLayoutGuide.centerYAnchor, constant: 300 The strange part is the button that is in the Y 100 stays visible and I can hit the button that is in the Y 100. The buttons in the Y 200 and Y 300 positions are visible until after one or two hits, then the button that is in Y 300 position disappears, then after another hit or two the button that is in the Y 200 position disappears but the button that is in the Y 100 is still visible. I cleared all my constraints to narrow it down to clear view of the constraints that is causing the problem. I do not think this Log Noise. Below is the error log: load_eligibility_plist: Failed to open //private/var/db/os_eligibility/eligibility.plist: Operation not permitted(1) 1 Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x302aa7610 UIButton:0x10c257600.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 100 (active)>", "<NSLayoutConstraint:0x302acb480 UIButton:0x10c257600.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 300 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x302acb480 UIButton:0x10c257600.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 300 (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x302aa7750 UIButton:0x10c257900.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 200 (active)>", "<NSLayoutConstraint:0x302acb5c0 UIButton:0x10c257900.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 100 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x302aa7750 UIButton:0x10c257900.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 200 (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x302aa7890 UIButton:0x10c257c00.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 300 (active)>", "<NSLayoutConstraint:0x302acb700 UIButton:0x10c257c00.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 200 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x302aa7890 UIButton:0x10c257c00.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 300 (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. 3 Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x302aa7610 UIButton:0x10c257600.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 100 (active)>", "<NSLayoutConstraint:0x302acb480 UIButton:0x10c257600.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 300 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x302acb480 UIButton:0x10c257600.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 300 (active)> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful. Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x302aa7750 UIButton:0x10c257900.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 200 (active)>", "<NSLayoutConstraint:0x302acb5c0 UIButton:0x10c257900.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 100 (active)>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x302aa7750 UIButton:0x10c257900.centerY == UILayoutGuide:0x3030f0c40'UIViewSafeAreaLayoutGuide'.centerY + 200 (active)>
Topic: Design SubTopic: General
4
0
367
Apr ’25
What does Apple use to create SF Symbols?
I've been losing countless hours of work trying to create a variable-width SF Symbol that supports interpolation, no dice. Both Sketch and Figma output SVGs that are not interpolatable. After numerous hours of research, I believe it's due to the fact that when outlining strokes, these editing tools introduce artifacts into the shapes —​ sometimes I get very short line segments where there would not be needed, sometimes a 3-point curve gets expanded to a 4-point curve, but not in all weights. It's always inconsistent. So my only question is rather simple: what's the graphic editing tool Apple uses to create hundreds of symbols? Clearly you cannot edit the stroke of ALL curves by hand, it's inhumane. Sketch? Figma? Illustrator? Inkscape? Affinity? I'd like a definitive answer from someone internal so that I can at least try to use the same tool as you without wasting more hours.
Topic: Design SubTopic: General Tags:
3
2
702
Feb ’25
Scrollview and a background image set to scaledToFill....
I've been beating my head against the wall over a scrollview issue where the top and bottom are cut off in landscape mode. Portrait mode - everything runs swimmingly. The moment I flip the iPad on its side, though, I lose about a quarter of the view on the top and bottom. I thought this was something to do with framing or such; I ran through a myriad of frame, padding, spacer, geometry...I set it static, I set it to dynamically grow, I even created algorithms to try to figure out how to set things to the individual device. Eventually, I separated the tablet and phone views as was suggested here and on the Apple dev forums. That's when I started playing around with the background image. Right now I have.... ZStack { Image("background") .resizable() .scaledToFill() .ignoresSafeArea() ScrollView { VStack(spacing: 24) {.... The problem is the "scaledToFill". In essence, whenever THAT is in the code, the vertical scrollview goes wonky in landscape mode. It, in essence, thinks that it has much more room at the top and the bottom because the background image has been extended at top and bottom to fill the wider screen of the iPad in landscape orientation. Is there any way to get around this issue? The desired behavior is pretty straightforward - the background image fills the entire background, no white bars or such, and the view scrolls against it.
3
0
135
Apr ’25
Picker list based on a selection from another Picker list
I have come quite far with my first app and have various picker lists working well. However, I am stuck thinking through how to do this next picker. My data model has Golf Course name and Tee. For each golf course there are multiple Tees and not all the same across the Courses. Example of Data CourseA RedTee CourseA GreenTee CourseA BlueTee CouseB RedTee CourseB YellowTee CourseB WhiteTee I first give the client the ability to Pick a Course from a picker list. That works fine. Now I want to create a Picker list of Tees but only for that selected Course. So if the client selected CourseB they would be presented with these Tees to select from RedTee YellowTee WhiteTee How do I limit the second picker to only show the Tees for the selected Course? Then in an associated question, once i have the Course and the Tee, I want to Auto fill the rest of a form with Slope, Rating and Yardage. @Model class ScorecardData { var scorecardcourseName: String var scorecardTee: String var scorecardSlope: Double var scorecardRating: Double var scorecardYardage: Int Here is my code for the Course Picker List Picker("", selection: $selectedCourse) { Text("Select a Course").tag(" ") ForEach(courses, id: \.self) { course in Text(course.courseName) .tag(course.courseName) } } .onChange(of: selectedCourse) { if(selectedCourse != nil) { roundsdata.roundscourseName = selectedCourse! } } Here is my current Picker list but its pulling all Tees for all Courses Picker("", selection: $selectedTee) { Text("Select Tee").tag(" ") ForEach (tees, id: \.self) { tee in Text(tee.scorecardTee) .tag(tee.scorecardTee) } } .onChange(of: selectedTee) { if(selectedTee != nil) { roundsdata.roundsTee = selectedTee! } } My @State and @Query statements are as follows in case there is a change there that is needed as well, @State private var selectedTee: String? = "Select Tee" @Query(sort: \ScorecardData.scorecardcourseName) private var tees: [ScorecardData] @State private var selectedCourse: String? = "Select Course" @Query(sort: \CourseData.courseName) private var courses: [CourseData]
Topic: Design SubTopic: General
3
0
477
Dec ’24
Liquid Glass material behaviour question
I have two views I've applied Liquid Glass to in Swift UI. I've noticed that depending on the height of the view the material changes and I'm not sure why. See the attached screenshot. Both views add the liquidGlass style in the same way but behave very differently on the same background. Ideally I'd like them to look the same as the bottom one. Is that the same as the clear style?
3
1
329
Sep ’25
Live Weather Radar Overlay in CarPlay Maps
Hi all — I wanted to share an idea I recently submitted through Feedback Assistant that I think could improve safety and usability for drivers using CarPlay: Add an option to overlay live weather radar (rain, snow, storms, etc.) directly onto CarPlay Maps while navigating. Similar to how traffic conditions are shown now, this would allow drivers to visually track incoming weather in real time without switching apps or relying on separate devices. Why this matters: • Enhances driver safety by increasing situational awareness • Helps with trip planning and route adjustments around severe weather • Reduces distractions by integrating everything into one screen • Useful for everyday drivers, long-haul travelers, and first responders I submitted this via Feedback Assistant, but I’d love to know what others think. If you also see value in this feature, consider submitting your own version via Feedback Assistant so Apple sees there’s interest. Let’s push for smarter, safer navigation — thanks for reading!
3
0
726
Jul ’25