Create elegant and intuitive apps that integrate seamlessly with Apple platforms.

All subtopics
Posts under Design topic

Post

Replies

Boosts

Views

Activity

Extra unwanted space in main window
Hi there! I'm having this issue with my main windows. I'm having a big space on top of that without any logic explanation (at least for my poor knowledge). Using the code below I'm getting this Windows layout: Does anybody have any guidance on how to get out that extra space at the beginning? Thanks a lot! import SwiftUI import SwiftData #if os(macOS) import AppKit #endif // Helper to access and control NSWindow for size/position persistence #if os(macOS) struct WindowAccessor: NSViewRepresentable { let onWindow: (NSWindow) -> Void func makeNSView(context: Context) -> NSView { let view = NSView() DispatchQueue.main.async { if let window = view.window { onWindow(window) } } return view } func updateNSView(_ nsView: NSView, context: Context) { DispatchQueue.main.async { if let window = nsView.window { onWindow(window) } } } } #endif @main struct KaraoPartyApp: App { @StateObject private var songsModel = SongsModel() @Environment(\.openWindow) private var openWindow var body: some Scene { Group { WindowGroup { #if os(macOS) WindowAccessor { window in window.minSize = NSSize(width: 900, height: 700) // Configure window to eliminate title bar space window.titleVisibility = .hidden window.titlebarAppearsTransparent = true window.styleMask.insert(.fullSizeContentView) } #endif ContentView() .environmentObject(songsModel) } .windowToolbarStyle(.unifiedCompact) .windowResizability(.contentSize) .defaultSize(width: 1200, height: 900) .windowStyle(.titleBar) #if os(macOS) .windowToolbarStyle(.unified) #endif WindowGroup("CDG Viewer", id: "cdg-viewer", for: CDGWindowParams.self) { $params in if let params = params { ZStack { #if os(macOS) WindowAccessor { window in window.minSize = NSSize(width: 600, height: 400) // Restore window frame if available let key = "cdgWindowFrame" let defaults = UserDefaults.standard if let frameString = defaults.string(forKey: key) { let frame = NSRectFromString(frameString) if window.frame != frame { window.setFrame(frame, display: true) } } else { // Open CDG window offset from main window if let mainWindow = NSApp.windows.first { let mainFrame = mainWindow.frame let offsetFrame = NSRect(x: mainFrame.origin.x + 60, y: mainFrame.origin.y - 60, width: 800, height: 600) window.setFrame(offsetFrame, display: true) } } // Observe frame changes and save NotificationCenter.default.addObserver(forName: NSWindow.didMoveNotification, object: window, queue: .main) { _ in let frameStr = NSStringFromRect(window.frame) defaults.set(frameStr, forKey: key) } NotificationCenter.default.addObserver(forName: NSWindow.didEndLiveResizeNotification, object: window, queue: .main) { _ in let frameStr = NSStringFromRect(window.frame) defaults.set(frameStr, forKey: key) } } #endif CDGView( cancion: Cancion( title: params.title ?? "", artist: params.artist ?? "", album: "", genre: "", year: "", bpm: "", playCount: 0, folderPath: params.cdgURL.deletingLastPathComponent().path, trackName: params.cdgURL.deletingPathExtension().lastPathComponent + ".mp3" ), backgroundType: params.backgroundType, videoURL: params.videoURL, cdfContent: params.cdfContent.flatMap { String(data: $0, encoding: .utf8) }, artist: params.artist, title: params.title ) } } else { Text("No se pudo abrir el archivo CDG.") } } .windowResizability(.contentSize) .defaultSize(width: 800, height: 600) WindowGroup("Metadata Editor", id: "metadata-editor") { MetadataEditorView() .environmentObject(songsModel) } .windowResizability(.contentSize) .defaultSize(width: 400, height: 400) WindowGroup("Canciones DB", id: "canciones-db") { CancionesDBView() } .windowResizability(.contentSize) .defaultSize(width: 800, height: 500) WindowGroup("Importar canciones desde carpeta", id: "folder-song-importer") { FolderSongImporterView() } .windowResizability(.contentSize) .defaultSize(width: 500, height: 350) } .modelContainer(for: Cancion.self) // Add menu command under Edit .commands { CommandGroup(replacing: .pasteboard) { } CommandMenu("Edit") { Button("Actualizar Metadatos") { openWindow(id: "metadata-editor") } .keyboardShortcut(",", modifiers: [.command, .shift]) } CommandMenu("Base de Datos") { Button("Ver Base de Datos de Canciones") { openWindow(id: "canciones-db") } .keyboardShortcut("D", modifiers: [.command, .shift]) } } } init() { print("\n==============================") print("[KaraoParty] Nueva ejecución iniciada: \(Date())") print("==============================\n") } }
0
0
33
3w
TabView Background Color
Hello I'm trying to use a TabView inside of the Sidebar in a NavigationSplitView. I'm wanting to use .listStyle(.sidebar) in order to get the Liquid Glass effect. However I can not find a way to remove the background of the TabView without changing the behavior of the TabView itself to paging with .tabViewStyle(.page) NavigationSplitView { TabView( selection: .constant("List") ) { Tab(value: "List") { List { Text("List") } } } } detail: { } Note: I wanting change the background of the TabView container itself. Not the TabBar.
0
0
40
2w
SwiftUI: Menu icon will missing if increase preferred text size
iOS simulator version 18.0+ I have a demo like this: Menu { Button { } label: { Text("Option 1") Image(systemName: "star") } Button { } label: { Text("Option 2") Image(systemName: "star") } } label: { Text("Menu") } And I used the tool Accessibility Inspector to modify the text size. Case 1: We could see the option title and the star icon. Case 2: But we could not see the icon, only the option title here Is this by design from Apple? Or does this need to be fixed? Does anyone know about my question?
0
0
37
4d
Inquiry Regarding Siri–AI Integration Capabilities
: Hello, I’m seeking clarification on whether Apple provides any framework or API that enables deep integration between Siri and advanced AI assistants (such as ChatGPT), including system-level functions like voice interaction, navigation, cross-platform syncing, and operational access similar to Siri’s own capabilities. If no such option exists today, I would appreciate guidance on the recommended path or approved third-party solutions for building a unified, voice-first experience across Apple’s ecosystem. Thank you for your time and insight.
0
0
17
3d
《维1847933278》腾龙公司游戏怎么下载怎么注册账号
腾龙:----TL 9655. C0M-----创办于1998年,总部位于缅甸掸邦老街,是果敢四大家族之一企业的产业。该集团旗下子公司超过多家,员工达上万余人。明面上主要经营文旅、酒店、房地产等产业,如2019年正式运营的腾龙大酒店,曾是当地最豪华的酒店,同年还启动运营了新天地房地产项目。此外,2023年在佤邦建设的新盛大酒店于2023年正式运营,2023年在新盛大酒店也正式运营。
0
0
113
2d
drop-down box Bug
There is a display issue when browsing wireless networks in the dropdown menu. In iOS version 18.1.1, the Wi-Fi switch is in the closed state; Step 1: Open the notification dropdown, and the first image bug appears; It will take some time for it to display [normally.]
1
0
511
Dec ’24
SwiftUI: How to create different background colors for List sections?
I'm trying to achieve a specific UI design in SwiftUI where the bottom section of my List has a different background color than the top section. For example in the Medications portion of the Health app, the "Your Medications" Section has a different background than the top "Log" Section. How do I achieve this?: Here some example code. I wonder if I am supposed to use two Lists instead. If I use two Lists though and nest it in a ScrollView, the height of the lists needs to be specified. I am working with dynamic content, though so I don't think that is ideal. class ProtocolMedication {} // Example model struct HomeView: View { @Query private var protocolMedications: [ProtocolMedication] var body: some View { NavigationStack { List { // Upper sections with default background Section { Text("Content 1") } header: { Text("Log") } // Bottom section that needs different background Section { ForEach(protocolMedications) { medication in Text(medication.name) } } header: { Text("Your Medications") } } .listStyle(.insetGrouped) } } }
1
0
665
Dec ’24
Some colors are missing during first app launch
Recently I decided to download my app from the App Store and found out that during the first launch some colors were missing or displayed incorreclty. For example one button was blue, although switching dark mode on and off solved button color it. Some colors were completely missing and the tab bar buttons were blue as well. Any advices? I'm using iOS 18.2 and XCode 16.1
1
0
339
Dec ’24
SwiftUI FileDocument: Modify the default save dialog
Is it possible to change the default save dialog that appears when creating a document based MacOS app in SwiftUI? I have a basic FileDocument struct that gets called to a view using a DocumentGroup scene. struct MyFile: FileDocument { static let readableContentTypes: [UTType] = [.myFileType] static let writeableContentTypes: [UTType] = [.myFileType] var list: [String] init(configuration: ReadConfiguration) throws { let data = configuration.file.regularFileContents! let JSONDecoder = JSONDecoder() do { try list = JSONDecoder.decode([String].self, from: data) } catch { throw CocoaError(.fileReadCorruptFile) } } func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper { let JSONEncoder = JSONEncoder() JSONEncoder.outputFormatting = .prettyPrinted do { data = try JSONEncoder.encode(self.list) } catch { print(error.localizedDescription) throw CocoaError(.fileWriteUnknown) } return .init(regularFileWithContents: data) } } This gets called at the DocumentGroup DocumentGroup(newDocument: MyFile(), editor: { document in ContentView(document: document.$document) }) But when I save the file, I want the save dialog that appears to have something like a 'Tags' textField that can also store information about the file. Something similar to this: (https://i.sstatic.net/AJQ3YNb8.png) From what I can find, there isn't much information about this other than manually creating an NSSavePanel class and overriding the current save function
1
0
438
Mar ’25
Getting rejected with: Guideline 4.3(a) - Design - Spam
Hello everyone, I'm stuck here, i have developed an app, and i keep getting from Apple "Guideline 4.3(a) - Design - Spam" - We continue to notice that your app shares a similar binary, metadata, and/or concept as apps submitted to the App Store by other developers, with only minor differences. As i was looking around this seems to be so much an issue now for many people and i don't understand why. My app which is approved in Android already it have an unique design built my own, and the most important the content (in this case futures crypto signals) are created by my own strategy, so it can be no where else found. I literally have no idea what to do next, i don't want to do major changes because i don't believe the app looks similar to any other app and for the reason that its already in Google Play Store i don't want to do major UI design. We would greatly appreciate any valuable advice from fellow developers in the community to help us navigate this challenge and successfully pass the review
1
1
457
Jan ’25
How do you make buttons inline with each other?
I want to make my buttons inline with each other, but spaced apart, a bit like the apple topbar BUT in swift. My code: struct NormalPageView: View { var body: some View { VStack { NavigationView { Form { Section { Image(systemName: "house.fill") Spacer() Image(systemName: "plus") Spacer() Image(systemName: "gearshape.fill") } } }
1
0
337
Jan ’25
Controlling the focus order in a UICollectionView
I'm running into a problem with the focus order in my UICollectionView in my tvOS app. The layout of my app is outlined in the following diagram On the uppermost layer I have a UITableView, each cell containing a single UICollectionView that can contain a variable number of UICollectionViewCells. When the user swipes down, I want the left-most item in the next row down to be selected, as follows: I've been able to get this to work for the majority of cases. The exception is when the previously focused item extends to the length of the screen - in this case the next focused item isn't the leftmost item, but rather the center item, as follows. Using focus guides won't really fit the use case here since collection views are dynamically generated. I've found that there is a function in UICollectionViewDelegate, indexPathForPreferredFocusedView that should help here but it only seems to be called intermittedly, even though I have set remembersLastFocusedIndexPath on the collectionview to true. I can force it to be called by calling setNeedsFocusUpdate() but I can't figure out a good place to call it - shouldUpdateFocus is too early and didUpdateFocus is too late. Is there some way to constrain the focus area of a view to a certain subset of it's frame - for example, the left-most quarter of its width? Or does anyone know of some other solution to this problem?
1
0
550
Jan ’25
learning coregraphics help: connecting line to circles
Hi everyone, im in the process of delving more into coregraphics with swiftui, but I am at a roadblock. First I would like to ask, what are some good resources to learn coregraphics? Secondly: I currently have a circle view made and what I want to do is to make my circle view modular so that it can be directly connected to another given circle by a line. How can I do this? For example, I want my circles to represent nodes and be able to connect by lines to other nodes that are related. Thanks in advanced. Here is my code for the circle view: @State private var circleProgress: CGFloat = 0 let timer = Timer.publish(every: 0.016, on: .main, in: .common).autoconnect() private let animationDuration: TimeInterval = 1.5 @Binding var startPoint: CGPoint @Binding var endPoint: CGPoint var body: some View { GeometryReader { geometry in Canvas { context, size in // Circle parameters let circleSize: CGFloat = 50 let circleOrigin = CGPoint( x: size.width / 4, y: size.height / 2 - circleSize / 2 ) let circleRect = CGRect( origin: circleOrigin, size: CGSize(width: circleSize, height: circleSize) ) let circleCenter = CGPoint( x: circleOrigin.x + circleSize / 2, y: circleOrigin.y + circleSize / 2 ) // Animate circle creation var circlePath = Path() circlePath.addArc( center: circleCenter, radius: circleSize / 2, startAngle: .degrees(0), endAngle: .degrees(360 * circleProgress), clockwise: false ) context.addFilter(.shadow(color: .white.opacity(0.6), radius: 5, x: 1, y: 1)) // Add white shadow context.stroke( circlePath, with: .linearGradient( Gradient(colors: [.purple, .white]), startPoint: circleRect.origin, endPoint: CGPoint(x: circleRect.maxX, y: circleRect.maxY) ), lineWidth: 5 ) } .frame(width: 300, height: 150) .onReceive(timer) { _ in // Update circle progress let progressChange = 0.02 / animationDuration if circleProgress < 1.0 { circleProgress = min(circleProgress + progressChange, 1.0) } else { circleProgress = 0.0 // Reset the circle to repeat the animation } // Get the starting and ending points of the Canvas view startPoint = CGPoint(x: geometry.frame(in: .global).minX, y: geometry.frame(in: .global).minY) endPoint = CGPoint(x: geometry.frame(in: .global).maxX, y: geometry.frame(in: .global).maxY) // Print the points for debugging print("Start Point: \(startPoint.x), \(startPoint.y)") print("End Point: \(endPoint.x), \(endPoint.y)") } } .frame(width: 300, height: 150) } }
1
0
534
Jan ’25
Your app included hard to read type or typography
I recently submitted a new app for review, but it has been rejected multiple times for vague reasons. The most recent rejection reason I received was unclear, leaving me unsure of what improvements are needed to get the app approved for the App Store. Does anyone have any advice on how to address this? Additionally, to Apple reviewers: Could you please provide more detailed feedback to help developers improve their apps? The repeated review process takes a significant amount of time, and guessing what needs to be fixed without clear guidance makes it even more challenging. ################################# The latest rejection reason I got is: Guideline 4.0 - Design We noticed an issue in your app that contributes to a lower-quality user experience than App Store users expect: Your app included hard to read type or typography. Since App Store users expect apps to be simple, refined, and easy to use, we want to call your attention to this design issue so you can make the appropriate changes. Next Steps Please revise your app to address all instances of the issue identified above.
Topic: Design SubTopic: General Tags:
1
0
478
Jan ’25