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

Post

Replies

Boosts

Views

Activity

Lock Screen Orientation
Looking for code to prevent a user from going landscape on a particular view controller only for an iPhone. The user should be able to rotate the view to landscape on an iPad only on the view controller.
1
0
260
Jul ’24
UICollectionView
I have 12 cells in a collection view. I am trying to find Swift code to make it display (4 rows x 3 columns) when the device is portrait, and then (2 rows by 6 columns) when in landscape. I need each cell to evenly layout within the view and to fill it.
0
0
255
Jul ’24
What is the secret to good UI?
Hello, I’m an aspiring full stack dev and I’m just wondering how the heck you get good UI AND UX. I’m currently moodboarding and seeing how things look in FigJam and then taking that and coding in Swift. I am struggling and my sanity is hanging on by a string 😂. So tell me, how do you get good UI and UX?
2
1
492
Jul ’24
PiPAgent not launching from a Sandboxed app.
Hi, I am developing an app that has a WKWebView and it can open sites like Youtube. The app is sandboxed as it is meant to be uploaded to the mac App Store. It has a feature PiP where we start the native PiP by calling a browser Javascript where we tell the WKWEBView to fire the PiP. It works well when we are running the code from XCODE in Debug scheme. When we run the code from release mode by archiving it or directly from the build folder, the WKWebView is not able to fire the PiP Agent and thus the Native PiP window is not visible, while the site shows that PiP is opened and we can here the sound being played. But PiP window is not visible. I cannot see PiPAgent in activity monitor. Why does it not work from within the release build outside xcode. But when I try to run the build directly from the Finder in builds folder, this PiP feature does not work. Request technical help for this. Thanks!
0
0
337
Jul ’24
Most efficient way to call a function upon variable state change
Hi, I have a button view that is used in many different ways in an app that I'm working on. One of the ways it is used is in an account creation form. Since the button is in a child view, the action: { } button function isn't available in the view where the input field variables are. I could import the class with the function to the button view but I don't want to pass the input field variables into the button view. I tried binding a boolean variable to the button view and checked for it's state change in the parent view using .onChange(), but the use case for that I found was depreciated and I'm unable to revert the state of the variable in the .onChange function. To reiterate, in a main view, I need to call a function in a given class and pass variables to it, upon a button being pressed in a child view. Any help would be greatly appreciated.
2
0
478
Jul ’24
Guideline 4.8 Design Login servies
I have uploaded my app on app store connect but it has been rejected. I received the message about Guideline 4.8 - Design - Login Services. Can you please guide me about how to solve this issue on app store. This is the message i receive from app store: "The app uses a third-party login service, but does not appear to offer an equivalent login option with the following features: -The login option limits data collection to the user’s name and email address. -The login option allows users to keep their email address private as part of setting up their account. -The login option does not collect interactions with the app for advertising purposes without consent. Next Steps Revise the app to offer an equivalent login option that meets all of the above requirements. If the app already includes a login option that meets the above requirements, reply to App Review in App Store Connect, identify which login option meets the requirements, and explain why it meets the requirements. Additionally, it would be appropriate to update the screenshots in the app's metadata to accurately reflect the revised app once another login service has been implemented." Is the problem caused by not having Privacy Policy and Terms of Service when using third-party login service? If it is, then I will add the Privacy Policy and Terms of Service.
2
2
581
Jul ’24
Are default fonts under UIFont.familyNames licensed for use by iOS developers?
This is a follow-up to my previous question: How to attribute/credit Apple Fonts added to app? In that previous post, I misremembered what I did and said I found fonts via macOS' FontBooks, when instead I came acrossUIFont.familyNames. Since these are included via UIKit, the legal implications should be different. I looked at various license agreements that govern iOS app development but haven't found anything mentioning fonts. Since these are included as part of UIKit, its reasonable to assume that developers are allowed to include these fonts--but in what ways? Am I allowed to let users create, say, documents with these fonts? Am I only allowed to display these fonts? There are 84 fonts, and judging by their FontBook entries, there is a wide range of licenses and restrictions. It seems unnecessarily harsh to have every iOS developer verify each one and figure out which they can legally keep if they want to offer their users access to all (for, say, a text-editing app). There must be some overarching rule that supersedes/encapsulates them, but this rule isn't clear to me after hours of research. I'm not a lawyer, and I don't think Apple expects every app developer to consult their lawyers on whether they can use system fonts. I'm about to send an email to Apple's legal team (I will post their response here if allowed), but in the meantime I want to hear what other devs think about this. In Xcode, entering UIFont.familyNames returns the following: ["Academy Engraved LET", "Al Nile", "American Typewriter", "Apple Color Emoji", "Apple SD Gothic Neo", "Apple Symbols", "Arial", "Arial Hebrew", "Arial Rounded MT Bold", "Avenir", "Avenir Next", "Avenir Next Condensed", "Baskerville", "Bodoni 72", "Bodoni 72 Oldstyle", "Bodoni 72 Smallcaps", "Bodoni Ornaments", "Bradley Hand", "Chalkboard SE", "Chalkduster", "Charter", "Cochin", "Copperplate", "Courier New", "Damascus", "Devanagari Sangam MN", "Didot", "DIN Alternate", "DIN Condensed", "Euphemia UCAS", "Farah", "Futura", "Galvji", "Geeza Pro", "Georgia", "Gill Sans", "Grantha Sangam MN", "Helvetica", "Helvetica Neue", "Hiragino Maru Gothic ProN", "Hiragino Mincho ProN", "Hiragino Sans", "Hoefler Text", "Impact", "Kailasa", "Kefa", "Khmer Sangam MN", "Kohinoor Bangla", "Kohinoor Devanagari", "Kohinoor Gujarati", "Kohinoor Telugu", "Lao Sangam MN", "Malayalam Sangam MN", "Marker Felt", "Menlo", "Mishafi", "Mukta Mahee", "Myanmar Sangam MN", "Noteworthy", "Noto Nastaliq Urdu", "Noto Sans Kannada", "Noto Sans Myanmar", "Noto Sans Oriya", "Optima", "Palatino", "Papyrus", "Party LET", "PingFang HK", "PingFang SC", "PingFang TC", "Rockwell", "Savoye LET", "Sinhala Sangam MN", "Snell Roundhand", "STIX Two Math", "STIX Two Text", "Symbol", "Tamil Sangam MN", "Thonburi", "Times New Roman", "Trebuchet MS", "Verdana", "Zapf Dingbats", "Zapfino"]
0
0
374
Jul ’24
Increase vocabulary
It would be nice if the vocabulary utilized by Apple keyboard and swipe would incorporate more medical terminology. It sucks when you’re trying to type in words like gastroenterologist or hepatorenal and my words get autocorrected or misunderstood … thank you!
1
0
246
Jul ’24
Changing Font Size In Drop-Down Picker
I am unable to change the font size with this snippet. The font is correct and used elsewhere in the swiftui file. The build works successfully, but no matter what font size I choose it appears to stick with a default system size. private func holeRow(hole: Int) -> some View { HStack(spacing: 0) { Text("(hole + 1)") .font(.custom("Metropolis-SemiBold", size: 12)) .frame(width: 60, height: 25) .background(Color("PGA_Dark_Cerulean")) .foregroundColor(.white) .border(Color.gray, width: 0.25) Picker("", selection: $parValues[hole]) { ForEach(3..<6) { value in Text("(value)") .font(.custom("Metropolis-SemiBold", size: 12)) .foregroundColor(Color("PGA_Dark_Cerulean")) .tag(value) } } .pickerStyle(MenuPickerStyle()) .frame(width: 50, height: 25) .background(Color.white) .border(Color("PGA_Dark_Cerulean"), width: 0.25) ForEach(golfers.indices, id: \.self) { golferIndex in Picker("", selection: $scores[golferIndex][hole]) { ForEach(1..<11) { value in Text("\(value)") .font(.custom("Metropolis-SemiBold", size: 12)) .foregroundColor(Color("PGA_Dark_Cerulean")) .tag(value) }
0
0
263
Jul ’24
Efficiently accounting for different iOS versions
I one project, using .onChange(), I get an error: 'onChange(of:initial:_:)' is only available in iOS 17.0 or newer The solution provided is to wrap the code in if #available(iOS 17.0, *) { }, but I'm only able to wrap the whole view inside of it, like so: if #available(iOS 17.0, *) { VStack () { // view with .onChange } } else { VStack () { // view with older solution } } The view is quite lengthy so it would be very redundant to have the same view twice, (the same view for each component of the if/else statement). Is there a way to implement an if statement so that I would only need the code for the view once (something like the code below)? VStack { } if #available(iOS 17.0, *) { .onChange() { } } else { // older solution } Additionally, in a newer project, I don't have to include the if #available(iOS 17.0, *) { }, so I'm guessing the build is made for a newer iOS. If that's the case, would it not be compatible with older iOS versions? Any help would be greatly appreciated.
3
0
368
Jul ’24
Center Aligning SF Symbols in Sidebar Menu
Hi, When watching SF Symbols WWDC videos about SF Symbols the recommendations is always to center align them, but suppose we are making sidebar menu items where we have VStack of HStacks , and each Stack have an SF Symbol and a text in this case how can SF Symbols be center aligned ? they will mostly right aligned so will this damage the design ? specially if they have like badges ? -- Kind Regards
0
0
282
Jul ’24
CarPlay navigation app - route planning only on iOS device
We are currently looking into enabling CarPlay for a navigation app. The navigation app allows complex trip planning (not focussed on A-B planning like Apple Maps). As we found the guidelines somewhat loose in this area, we are wondering, if it is allowed to have a navigation app that only offers the navigation feature, so no planning? Any route planning actions needs to be done on the iOS device. So, if you haven't planned/loaded a route, you would only see your location on a map and can drive freely, but without guidance. The Car App programming guideline mentions the select destination as explicit flow of a navigation app. Which makes us think that it might be required to support that flow.
1
0
309
Jul ’24
NSConstraintBasedLayoutDeferOptimization
I am getting one crash with "NSConstraintBasedLayoutDeferOptimization" error. I my app, having one textview with tap gesture which opens pickerview as a inputview added in textview. Whenever, I tap on textview app gets crashed. Not able to find exact reason for this crash.
0
0
368
Jul ’24
AppIntent Title Localization
Does anyone know how to localize the title of the shortcut? I tried to create a localizable file and then do a french translation. However, when I reference it as my shortcut title and change my simulator's language to the translated language (in this case french) it still displays the title in the english translation. for example: my Localizable.strings file says in english: "shortcutTitle" = "Hello!"; in french: "shortcutTitle" = "Bonjour!"; and then my AppIntent says: static var title: LocalizedStringResource{return LocalizedStringResource("shortcutTitle")}
1
0
447
Jul ’24
Undefined symbol and linker command failed errors
Hi, I was searching and replacing code where all of the sudden I got the following errors: Undefined symbol: AppName.Client.init(id: Swift.Int, name: Swift.String, StructVariable: Swift.Int?, structVariable: [Struct]?) -> AppNameStruct Linker command failed with exit code 1 (use -v to see invocation) I replaced the names in the first error message for privacy reasons. I tried quitting Xcode and restarting my computer but the error persisted. Any help on resolving this would be greatly appreciated.
1
0
396
Jul ’24
chartOverlay property
I'm trying to implement interactive graphs, but find that the .chartOverlay property includes the axes and legend. How do I find only the rectangle that contains the data?
0
0
357
Aug ’24