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

@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
478
Aug ’25
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.5k
5d
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
240
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.4k
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("*****:") TextField("*****", 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
6.9k
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.8k
Dec ’24
.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
124
Apr ’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
801
Feb ’25
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
719
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
141
Jul ’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
838
Feb ’25
Hardware needed for BLE pairing with iOS
Hi there, I'm working on a product which needs to pair with an iOS device (only iPad and iPhone) via Bluetooth. I already have the device pairing and operating fully with android or Windows hosts and have implemented BLE. Obviously, iOS isn't as simple as those for pairing. The product type is not listed under the MFi accessories. The question I have is what hardware and or firmware needs does the product needs to fulfil in order to pair/bond fully. I've seen some devices have a MFi security chip, some need to be manufactured in a MFi approved facility, I've no idea on the firmware requirements. We're starting the process of joining the MFi program too. So: Do I need the security chip? Where is the pairing process documented? Can I use BLE or do I need to use classic Bluetooth or core Bluetooth? Any help would be greatly appreciated because I'm kind of lost. Thanks, Louis
4
0
898
Oct ’24
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
622
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
339
Apr ’25
Icon for Journals Suggestions API
My app includes use of the new journal suggestions API. I'd like to know what is the official icon for the button in my app which bring up the .journalingSuggestionsPicker Another app, DayOne uses the icon attached. Is this the official icon? If yes, does it have a SFSymbols name? Developer support were unable to help me. Any help appreciated - many thanks
Topic: Design SubTopic: General Tags:
4
0
633
Sep ’24
How to attribute/credit Apple Fonts added to app?
My app lets users create things with text, and I've included Apple fonts so users can format their text with them. These were fonts I found in the Font Book app that comes with macOS. My assumption is that these, like the San Francisco font, can be distributed with apps. Do I need to attribute these fonts to their creators and publish a license in my "About" page? If so, where do I find the license(s) and what is the proper way of publishing them? Is there anything else I should know? Please let me know if this should've been posted under a different topic and tag
Topic: Design SubTopic: General Tags:
3
0
1.1k
Jan ’25
Struggling creating a custom SF Symbol: The provided variants are not interpolatable
Hi, I am trying to create a custom SF Symbol from an SVG file created with Affinity Designer but, even though my SVG file look perfect in Firefox for example compared to the exported custom.circle.svg file (as recommended in Apple's documentation), I fail to get rid of this error: "The provided variants are not interpolatable" My creation process using Affinity Designer is: Export as SVG file Duplicate the custom.circle.svg file exported from the SF Symbols app In the new file, replace the 3 "path" tags in the "g" sections "id="Black-S", "Regular-S", "Ultralight-S" with the paths from the SVG file exported from Affinity designer Set the 3 transform matrices to "matrix(1 0 0 1 0 0)" for the 3 variants to be generated at the correct location. Verify in an SVG viewer that the file looks correct. Import the file via Drag&Drop into the SF Symbols app. What is wrong with my file? Thank you in advance for any help, Marc mySymbol.svg.txt
Topic: Design SubTopic: General Tags:
3
0
124
Jun ’25
Urgent Feature Request: Auto-Hide Home Bar in iOS 18.x Based on iOS 26 Beta Experience
Hello Apple Engineering Team and Fellow Developers, I’ve been using iOS 26 beta from day one and closely following all its improvements. One feature that significantly enhances the user experience is the automatic hiding of the Home Bar (the bottom navigation indicator) after a few seconds of inactivity in menus and apps. This subtle but powerful UI behavior not only increases immersion but also reduces distractions, making navigation smoother and visually cleaner. I strongly urge the Apple team to integrate this feature into the upcoming iOS 18.6 update. Bringing this polished interaction to iOS 18 users would greatly improve usability and keep the interface modern and elegant. Thank you for your continuous efforts in refining iOS. Looking forward to seeing this improvement officially adopted soon! Best regards, [ERFANEX]
Topic: Design SubTopic: General
3
0
527
Jul ’25