Hi,
I want to generate some sample datas for demonstrating the functions of my app when the app launched. My codes are as followings:
func generateSampleData() {
let hasLaunchedKey = "HasLaunchedBefore"
let defaults = UserDefaults.standard
if !defaults.bool(forKey: hasLaunchedKey) {
//generate the demo data
}
defaults.set(true, forKey: hasLaunchedKey)
}
And I put the func in a view's onAppear modifier. I found every time I go the view, it generates the demo data again, which results in producing a lot of demo data. But I have set the status of the function running in the userdefault. Why did it happen?
Best Wishes,
General
RSS for tagExplore the art and science of app design. Discuss user interface (UI) design principles, user experience (UX) best practices, and share design resources and inspiration.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
[Iphone11]
I’m developing an app that includes a navigation bar with a centered title and a single right bar button item. I’ve noticed that when both the navigation bar title and the right bar button item’s title are relatively long, the navigation bar title becomes hidden.
This issue only occurs on iOS 26. When running the same code on iOS 18, the layout behaves as expected, with both elements visible.
Has anyone else experienced this behavior on iOS 26? Is this a known layout change or a possible bug?
i am struggling to get my tab view to work, when i call views in the action part of my tab view, my background creates issue? does anyone know how to fix this?
struct ContentView: View {
@Environment(.colorScheme) var colorMode
let Color1: Color = .cyan
var Color2: Color {
colorMode == .dark ? .black : .white
}
var TextColor: Color{
colorMode == .dark ? .black : .black
}
let tax: Double = 0.0875
var OptionTypes: [String] = ["Breakfeast", "Lunch", "Dinner", "Dessert", "Drinks"]
var BreakfeastFoods: [Food] = [
Food(Name: "Eggs Benedict", Price: 9.50),
Food(Name: "Avocado Toast", Price: 5.75),
Food(Name: "French Toast", Price: 12.50),
Food(Name: "Waffles", Price: 7.25),
Food(Name: "Pancakes", Price: 8.60)
]
var LunchFoods: [Food] = [
Food(Name: "Tuna Salad", Price: 11.25),
Food(Name: "Pizza", Price: 22.50),
Food(Name: "Chicken Sandwitch", Price: 8.95),
Food(Name: "French Fries", Price: 5.15),
Food(Name: "Macaroni and Cheese", Price: 7.50)
]
var DinnerFoods: [Food] = [
Food(Name: "Ribeye Steak", Price: 18.99),
Food(Name: "Pork Ribs", Price: 21.75),
Food(Name: "Salmon", Price: 15.00),
Food(Name: "Burrito Bowl", Price: 13.99),
Food(Name: "Chicken Fajitas", Price: 20.50)
]
var DessertFoods: [Food] = [
Food(Name: "Ice Cream Sundae", Price: 10.00),
Food(Name: "Fudge Brownie", Price: 4.85),
Food(Name: "Chocolate Cake Slice", Price: 6.10),
Food(Name: "Pumpkin Pie", Price: 6.10),
Food(Name: "Ice Cream Float", Price: 3.50)
]
var Drinks: [Food] = [
Food(Name: "Water", Price: 0.00),
Food(Name: "Sparkling Water", Price: 2.15),
Food(Name: "Soda", Price: 3.00),
Food(Name: "Coffee", Price: 2.50),
Food(Name: "Hot Chocolate", Price: 3.50)
]
@State var MyCart: [Food] = []
var body: some View {
NavigationStack{
ZStack{
LinearGradient(colors: [Color1, Color2], startPoint: .top, endPoint: .bottom).ignoresSafeArea()
VStack(spacing: 40){
ForEach(OptionTypes, id: \.self){
OptionType in
NavigationLink(value: OptionType){
Text(OptionType)
}.frame(width: 250, height: 70).background(LinearGradient(colors: [.cyan, .white,.cyan], startPoint: .topLeading, endPoint: .bottom)).foregroundStyle(TextColor).cornerRadius(100).font(.system(size: 25, weight: .medium)).padding(.top, 16)
}
}.navigationDestination(for: String.self) {
OptionType in
switch OptionType{
case "Breakfeast":
BreakFeastView(BreakfeastList: BreakfeastFoods, Color1: Color1, Color2: Color2)
case "Lunch":
LunchView(LunchList: LunchFoods, Color1: Color1, Color2: Color2)
case "Dinner":
DinnerView(DinnerList: DinnerFoods, Color1: Color1, Color2: Color2)
case "Dessert":
DessertView(DessertList: DessertFoods, Color1: Color1, Color2: Color2)
case "Drinks":
DrinksView(DrinksList: Drinks, Color1: Color1, Color2: Color2)
// case "My Cart":
// MyCartView(MyCartList: MyCart, Color1: Color1, Color2: Color2)
default:
Text("Error")
}
}
} .navigationTitle("Choose Menu")
TabView{
Tab("Menu", systemImage: "fork.knife"){
}
Tab("My-Cart", systemImage: "cart.fill"){
}
Tab("Store Location", systemImage: "mappin"){
}
}
}
}
}
We're using StoreKit for in-app purchases on iOS, and our backend has the server notification URL configured. However, during subscription renewals, Apple's server doesn't send any requests to our endpoint. What could be causing this?
Hello Apple Developer Support,
We initially uploaded our INRx App on a different Apple Developer account for internal testing purposes.
Now, we would like to publish the same app under a new Apple Developer account for production, but we're currently facing a design-related rejection during the review process.
We believe the app meets all guidelines, and there were no design issues flagged previously when submitted from the testing account.
Could you please help us understand:
Why the same app is now being rejected for design issues?
Is there a way to resolve this while moving the app to the new account?
Any advice or clarification would be greatly appreciated so we can successfully proceed with publishing.
Thank you!
Building an app to edit the various parameters of digital musical instruments. A typical user would have perhaps max 6 instruments, out of the hundreds of possibilities.
Would like to structure the app with a global window, menu, etc which would be a free download. The user could download editor inserts for their particular set of instruments and ignore all of the others. The downloaded editors would show as options in a menu.
It seem like more than a widget but less than a library. Building a monolithic app containing all possible editors doesn't seem like an option, but separate full-app editors for each piece of gear doesn't sound right either.
Any suggestions out there?
Thanks very much
Brian
I can't find any documentation on design guidelines for "Login with Game Center" button. My app allows users to "Play as Guest" or "Login with Game Center". Since Apple provides somewhat strict guidelines for designing "Sign in with Apple" button, i was wondering how to design the button for Game Center login. Should i use Game Center icon. And will Apple review reject this?
What is the step-by-step process to run an iOS application paired with the Mac in my MAUI project?
I am using Windows with Visual Studio 2022 V17.13.5.
Application: Multiplatform;
Language: C#;
Framework: MAUI 8;
Xcode: 16.2;
Objective: Identify and fix the issue to allow the application to run correctly.
Hey, everyone. I'm having an issue with my modal shadows when building for macOS. I've attached an image to show you what's going on.
I have a rounded corner window, and when the In-App Purchase overlay opens, the modal shadow of that rounded window is square (which doesn't make sense, and looks bad).
Can somebody please help me address this? I've tried searching high and low for a solution but I can't find anything :-(
I really appreciate you taking a look! -Logan
I've been playing around with the recently published iPad PRO M5 13" and it's awesome in most ways I've been able to think of. But this video capture of the app I'm developing, for example, lacks it the app icon "should" be just slightly translucent as I see it.
https://youtube.com/CAukICBrVzw
However I'm not and UI/X person and this is primarily my personal preference only for an option to allow for devs.
Feedback for iPhone and iPad – Display Technology
Dear Apple Team,
Currently, the mainstream display technology used in iPhone and iPad is OLED. However, OLED panels produce significant PWM flickering, which strongly irritates the human eye. Many users, especially in China, experience eye strain, tearing, and discomfort after using OLED devices for a period of time.
There is a large group of users here who are highly sensitive to screen flicker and therefore cannot use OLED-based devices at all. What they truly need is an eye-friendly device with either LCD or flicker-free Mini-LED display technology.
I sincerely recommend that Apple consider offering iPhone and iPad models with LCD or Mini-LED panels. Such displays could provide better eye comfort, no flicker, and a healthier experience. Currently, almost no smartphone manufacturers in China provide such options, and even if they do, their devices often come with outdated chipsets and cannot be used as a reliable daily driver.
This presents a valuable opportunity for Apple: by addressing this demand, Apple could attract a unique customer base, increase sales, and even justify a slightly higher price, as many customers would be willing to pay more for the sake of their eye health. In the Chinese market, a truly flicker-free iPhone or iPad would be incredibly rare and highly desired.
Thank you for considering this suggestion. I truly hope Apple will take this into account.
I'm developing an iPadOS 18+ application that uses a UITabBarController, styled as a sidebar, to serve as the primary navigation interface. This setup includes 20 different tabs, each representing a distinct section of the app.
For the user experience, each tab needs to present a master-detail interface, implemented using a UISplitViewController. The goal is to allow users to navigate between tabs via the sidebar, and within each tab, access related content through the split view's list-detail pattern.
The Problem:
Currently, my implementation involves instantiating a separate UISplitViewController for each tab, resulting in 20 unique split view instances embedded inside the UITabBarController. While this works functionally, it leads to significant memory usage, especially after the user opens each tab at least once. The accumulation of all these instantiated view controllers in memory eventually causes performance degradation or even memory warnings/crashes on lower-end iPads.
The Question:
What is the best approach to implement this type of architecture without running into memory management issues?
Specifically:
Is there a way to reuse or lazily load the UISplitViewController instances only when needed?
Can we unload or release split view controllers that haven't been used for a while to reduce memory pressure?
Would a custom container controller be more appropriate than using UITabBarController in this case?
Are there iPadOS 18+ best practices or newer APIs that support this kind of complex multi-tab, multi-split-view structure efficiently?
Any advice on how to optimize memory usage while preserving the sidebar navigation and split view layout would be highly appreciated.
Hi everyone,
I’m currently testing iOS 26 on my iPhone as part of the developer program. According to Apple’s documentation and demo materials, a new screenshot animation was introduced in this version. However, when I take a screenshot on my device, the animation remains the same as in previous iOS versions.
I’ve double-checked that I’m running the correct build of iOS 26, and I haven’t found any settings that might enable or disable this feature.
Is anyone else experiencing the same issue? Could this new animation be device-specific, region-limited, or require additional configuration?
Any insight would be appreciated!
Thanks in advance,
Alonso Rivera
I am trying to resize a Window Form after it loads and have done quite a bit of searching for code to do it.
Here is one code snippet that works to size the form during the design phase.
self.view.window?.contentMinSize = CGSize(width: 1100, height: 310)
I have tried code like below to increase the window size after the Form loads
if let myWindow = self.view.window ?? NSApplication.shared.mainWindow
{
// Increase window size and position after it loads
let newRect = NSRect(x: 100, y: 100, width: 1400, height: 900)
}
It seems that this code not only changes the Form size after loading, but also changes the size of the Form in Main.swift, which is something I don't want.
I read elsewhere that I had to disable constraints to resize the Form, so I tried code below.
let tableView = NSTableView()
tableView.translatesAutoresizingMaskIntoConstraints = false
let newRect = NSRect(x: 100, y: 0, width: 1100, height: 600)
myWindow?.setFrame(newRect, display: true)
That code did not seem to do anything as well.
Also, the Form displays in the lower left of the screen.
Note that main reason I want to resize the Form after loading is to keep it smaller during design development. The same goes for the NSTableView, which I have not gotten to yet.
1/自从更新26.0版本 页面好看但是应用和主界面使用体验非常差很卡
2/苹果键盘功能有待优化 表情和语音文字识别还有键盘设置
3/还有手机发热卡顿 导致非常多的使用不方便 苹果官方请优化以上问题
I have really examined the swipe left Camera function mode and sincerely believe it is no more important especially when there no option in the settings to turn it on or off.
I will highly recommend a total scrap in the iOS 26 or if possible a function to activate and deactivate it.
Existing smartphones store multiple NFC card information. When the NFC antenna of the phone is close to the card reader, it is usually necessary to open the APP to select NFC card information or default to one card information to be transmitted to the card reader. It is not possible to quickly select or switch cards among multiple cards. For example, after using the NFC function to swipe the subway card, the phone needs to open the car access control and community access control again. It is necessary to open the mobile NFC card information management APP to select the community access control card and then swipe the mobile NFC access control, which causes inconvenience.
(现有的智能手机存储多个 NFC 卡信息。当手机的NFC天线靠近读卡器时,通常需要打开APP选择NFC卡信息或默认一个卡信息传输到读卡器。无法在多张卡之间快速选择或切换卡。例如,使用NFC功能刷完地铁卡后,手机需要重新打开车内门禁和小区门禁。需要打开手机NFC卡信息管理APP选择社区门禁卡,然后刷手机NFC门禁,造成不便。)
Divide the smartphone screen into multiple areas, and users can freely define corresponding NFC information for each area. When the screen is turned off and not unlocked, select NFC card information by pressing different screen areas with your fingers. When the mobile NFC is close to the card reader, the selected card information will be transmitted to the reader(将智能手机屏幕划分多个区域,每个区域手机用户可以自由定义对应NFC信息。在熄屏’不解锁的情况下,通过手指按压不同屏幕区域选择NFC卡片信息,手机NFC贴近读卡器时将选择的卡片信息传递给读卡器。)
Below, the method will be further explained in conjunction with the accompanying drawings and embodiments.
Figure 1 is a schematic diagram of a utility model;
Figure 2 is the flowchart of the present utility model;
NFC reader, 2. Mobile screen partition, 3. NFC signal in Figure 1.
In Figure 2, 1. Press the area of the screen partition with your finger. 2. Place the phone close to the NFC reader. 3. The phone senses the returned NFC signal. 4. The phone detects the pressed area.(
下面结合附图和实施例对方法进一步说明。
图1为实用新型示意图;
图2为本实用新型流程图;
图1中1.NFC读取器,2.手机屏幕分区,3.NFC信号。
图2中1.手指按压屏幕分区的区域2.手机贴近NFC读取器3.手机感应到返回的NFC信号4.手机检测到按压的区域,5.是否检测到手机用户按压区域的动作,6.检测到按压区域,根据按压区域做出匹配相对应的NFC的动作7.选择用户所需的NFC卡8.NFC卡收到信息并发出卡片信息9.NFC读卡器收到NFC卡的信息。)
For example, a smartphone user has N NFC virtual cards in their phone. Users can divide the smartphone screen into N areas, distinguished as A area, B area, C area..., each area controls different NFC. When a smartphone user holds down the B area that controls NFC (such as virtual access cards) and brings the phone close to the NFC card reader (such as access control). The mobile phone will sense NFC signals (access control signals), triggering the phone to detect the area that the user is pressing. There are two possibilities. Firstly, if the user's pressing action is not detected, the NFC card corresponding to the default A zone (set as the default here) will be selected. If the user's pressing action is detected and it is detected that the pressing is in Zone B (the partition corresponding to the access card), then the NFC information corresponding to Zone B is triggered. The smartphone receives this message, and the corresponding NFC sends out a card message. The NFC card reader (access control device) receives the message and reacts (door opens).(例如,一智能手机用户手机中有N个NFC虚拟卡。用户可以将智能手机屏幕分为N个区域,分辨为A区、B区、C区······,每个区域分别控制不同的NFC。当智能手机用户按住控制NFC(如虚拟门禁卡)的B区域并将手机靠近NFC读卡器(如门禁)。手机将会感应到NFC信号(门禁信号),触发手机检测用户正在按压的区域。有两种可能性,第一没有检测到用户的按压动作则选择默认的A区(这里把A区设为默认)所对应的NFC卡。第二检测到用户的按压动作并检测出按压的是B区域(门禁卡所对应的分区),则触发B区域所对应的NFC信息。智能手机收到此信息,相对应的NFC发出卡片信息,NFC读卡器(门禁设备)收到信息,做出反应(门打开)。)
图1 image1
图2 image2
Post:
In macOS 26 Betas 1–3, the system applied an automatic dark-mode fallback for app icons. This ensured consistency across the Dock and Finder even when developers hadn’t provided dark assets.
Since Beta 4, this fallback was removed. As of Beta 7, icons now rely entirely on developer-updated assets. The result is mixed light and dark icons in the Dock, breaking visual consistency and making app recognition slower in dark mode.
Observed behavior:
• Icons without dark assets are displayed in their original light version.
• Some apps (e.g. Final Cut Pro) show a gray border treatment that feels inconsistent with the rest of the UI.
• The fallback applied in Betas 1–3 is completely absent.
Expected behavior:
System should provide a fallback rendering until developers supply proper dark assets, or offer a toggle in System Settings → Appearance (e.g. “Force Dark Icons”).
This is still present in Beta 7. Is there any plan to restore the fallback mechanism or provide a user option?
Hi everyone, I'm currently working on my own Apple TV app. So far, things are going pretty well, but right now, I'm stuck on the design of the categories or selection menus.
Here's a screenshot of how it looks right now:
The green color and the border are intentionally added for now so I can see what is where. My actual goal is to remove the gray bar (or is this the "main bar"?). The pink bar and its border are just design elements that can be removed if needed. I want it to look more "original," like this:
Here is the code:
let title: String
let isSelected: Bool
var body: some View {
HStack {
Text(title)
.foregroundColor(isSelected ? .black : .white)
.font(.system(size: 22, weight: .regular))
.padding(.leading, 20)
Spacer()
Image(systemName: "chevron.right")
.foregroundColor(isSelected ? .black : .gray)
.padding(.trailing, 20)
}
.frame(height: 50) // Einheitliche Höhe für die Kategorien
.background(Color.pink) // Innerer Hintergrund auf pink gesetzt
.cornerRadius(10) // Abrundung direkt auf den Hintergrund anwenden
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color.green, lineWidth: 3) // Äußerer Rahmen auf grün gesetzt
)
.padding(.horizontal, 0) // Entferne äußere Ränder
.background(Color.clear) // Entferne alle anderen Hintergründe
}
}
struct SettingsView_Previews: PreviewProvider {
static var previews: some View {
SettingsView()
}
}
I’ve adjusted the code, but it’s still not quite right. When a category is not selected, it appears black instead of gray, like in the original design
Here is the code:
struct SettingsView: View {
@State private var selectedCategory: String?
var body: some View {
NavigationStack {
ZStack {
Color.black
.edgesIgnoringSafeArea(.all)
VStack(spacing: 0) {
// Überschrift oben in der Mitte
Text("Einstellungen")
.font(.system(size: 40, weight: .semibold))
.foregroundColor(.white)
.padding(.top, 30)
HStack {
// Linke Seite mit Logo
VStack {
Spacer()
Image(systemName: "applelogo")
.resizable()
.scaledToFit()
.frame(width: 120, height: 120)
.foregroundColor(.white)
Spacer()
}
.frame(width: UIScreen.main.bounds.width * 0.4)
// Rechte Seite mit Kategorien
VStack(spacing: 15) {
ForEach(categories, id: \.self) { category in
NavigationLink(
value: category,
label: {
SettingsCategoryView(
title: category,
isSelected: selectedCategory == category
)
}
)
.buttonStyle(PlainButtonStyle())
}
}
.frame(width: UIScreen.main.bounds.width * 0.5)
}
}
}
.navigationDestination(for: String.self) { value in
Text("\(value)-Ansicht")
.font(.title)
.foregroundColor(.white)
.navigationTitle(value)
}
}
}
private var categories: [String] {
["Allgemein", "Benutzer:innen und Accounts", "Video und Audio", "Bildschirmschoner", "AirPlay und HomeKit", "Fernbedienungen und Geräte", "Apps", "Netzwerk", "System", "Entwickler"]
}
}
struct SettingsCategoryView: View {
let title: String
let isSelected: Bool
var body: some View {
HStack {
Text(title)
.foregroundColor(.white)
.font(.system(size: 22, weight: .medium))
.padding(.leading, 20)
Spacer()
Image(systemName: "chevron.right")
.foregroundColor(.gray)
.padding(.trailing, 20)
}
.frame(height: 50) // Einheitliche Höhe für die Kategorien
.background(isSelected ? Color.gray.opacity(0.3) : Color.clear) // Hervorhebung des ausgewählten Elements
.cornerRadius(8) // Abgerundete Ecken
.scaleEffect(isSelected ? 1.05 : 1.0) // Fokus-Animation
.animation(.easeInOut, value: isSelected)
}
}
struct SettingsView_Previews: PreviewProvider {
static var previews: some View {
SettingsView()
}
}