Search results for

column

2,047 results found

Post

Replies

Boosts

Views

Activity

How can I get a tab-bar styled ornament on the trailing edge of a view controller?
I've got a UIKit app with a collapsible trailing-edge child view controller, implemented sort of like UISplitViewController but it's got a bunch of custom behavior - moving to the bottom edge in portrait orientation, etc. It exposes a couple of different app functions via a UITabBar on the bottom edge on iOS. When I run the app on visionOS, that tab bar transforms to a leading-edge ornament. This would be great, but that means it tries to overlap the trailing-edge content of its parent view controller, which isn't ideal. Is there a way to get the tab bar to lay out on the trailling edge of the child view controller? Or can I create a custom ornament that has the same auto-expand behavior as the tab bar, where it shows a vertical column of icons that expands to show titles when you're gazing at it?
1
0
460
Oct ’24
Text-shadow + column-count adds unexpected whitespace at beginning of second column
Howdy! On Safari, when using the column-count CSS property to split text into multiple columns, I've noticed that when applying a text-shadow, there is an unexpected whitespace created above all subsequent columns. I've put together a codepen demonstrating the issue and its reproducibility on Safari (using latest as of this posting: Version 17.6 (19618.3.11.11.5)) Codepen: https://codepen.io/cubepresser/pen/ExqvzjL Expected behavior: Actual: I tested this on the latest versions of Chrome, Firefox and Edge. This bug does not occur. Expected behavior is that there should not be an extra line added to the beginning of the second column, third column, etc. Here's some code if that codepen link doesn't work: HTML: 0000000000111111111122222222223333333333 CSS: #example { font-family: monospace; max-width: 20ch; column-count: 2; column-gap: 0; word-break: break-all; line-break: anywhere; text-shadow: 0 0 4px black; }
1
0
731
Oct ’24
Reply to text context with column-count value is 2 and text-shadow' blur is greater then 0, the second column will be bring down
Howdy! This bug still occurs on Safari. I've put together a codepen demonstrating the issue and its reproducibility on Safari (using latest as of this posting: Version 17.6 (19618.3.11.11.5)) Codepen: https://codepen.io/cubepresser/pen/ExqvzjL I tested this on the latest versions of Chrome, Firefox and Edge. This bug does not occur. Expected behavior is that there should not be an extra line added to the beginning of the second column, third column, etc. Here's some code if that codepen link doesn't work: HTML: 0000000000111111111122222222223333333333 CSS: #example { font-family: monospace; max-width: 20ch; column-count: 2; column-gap: 0; word-break: break-all; line-break: anywhere; text-shadow: 0 0 4px black; }
Topic: Safari & Web SubTopic: General Tags:
Oct ’24
Center alignment in row of LazyVGrid
I am creating a LazyVGrid with 2 columns. I want it so that if there is only one item in a row, then it goes to the center of the row. I tried using an HStack with a Spacer, but it doesn't push it to the center. How do I do it? ForEach(pets) { pet in VStack { Image(pet.species.rawValue) .resizable() .frame(width: 80, height: 80) Text(pet.name) .poppinsBold(size: 16) } } HStack { if pets.hasEvenNumber { Spacer(minLength: 0) } Button { addPetSheet = true } label: { VStack { ZStack { Circle() .frame(width: 70, height: 70) .foregroundStyle(.gray) Image(systemName: plus) .foregroundStyle(.white) .font(.title) } Text(Add) .poppinsBold(size: 16) } } } }
Topic: Design SubTopic: General Tags:
0
0
461
Oct ’24
Reply to How SwiftUI Table sorting work with multiple KeyPathComparator ?
@cp-divyesh-v I would recommend you review Building a Great Mac App with SwiftUI sample code. It has an example that walks you through how you should create sortable columns. However here's an example : struct Plant: Identifiable { var id = UUID() var variety: String var daysToMaturity: Int var datePlanted: Date var harvestDate: Date var lastWateredOn: Date var favorite: Bool } @Observable class DetailManager { var sortOrder: [KeyPathComparator] = [ .init(.daysToMaturity, order: SortOrder.reverse), .init(.variety, order: SortOrder.reverse) ] var data = [ Plant(variety: Tomato, daysToMaturity: 80, datePlanted: Date(), harvestDate: Date(), lastWateredOn: Date(), favorite: true), Plant(variety: Carrot, daysToMaturity: 60, datePlanted: Date(), harvestDate: Date(), lastWateredOn: Date(), favorite: false), Plant(variety: Pepper, daysToMaturity: 90, datePlanted: Date(), harvestDate: Date(), lastWateredOn: Date(), favorite: false) ] var plants: [Plant] { data.sorted(using: sortOrder) } } struct GardenDetailT
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’24
Reply to NavigationSplitView does not properly show detail pages on macOS 15
This was release noted here: https://developer.apple.com/documentation/macos-release-notes/macos-15-release-notes (Search 127626852) Behavior was changed because the composition is undefined on iOS and was undefined on macOS, but happened to work in some cases. This change was made behind a link check, so hopefully you are only seeing this when compiling against the newest Sequoia toolchains. View-destination links (e.g. NavigationLinks that take a View as their destination) and value-destination links (e.g. NavigationLinks that take a value argument) cannot be mixed. By attaching an id to the link, you are wiring the link up to the Lists selection, and thus trying to drive navigation that way. The correct way to do this in releases including and prior to iOS 15 and macOS 18 is by switching over the selection in the NavigationSplitView's subsequent column: NavigationSplitView { List(selection: $selection) { NavigationLink(Value-destination link, value: 5) } } detail: { if let selection { SelectedDest
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’24
Reply to How to permanently delete Sonoma aerial wallpapers?
I want the wallpapers gone because I dislike them greatly. I have dozens of much higher quality (as wallpapers go) because they are simple and non-distracting, non-entertainment. I've been struggling to get rid of them for a long time. Additionally, the Sonoma wallpaper system is broken in many ways. The worst is that it keeps putting back that default wallpaper of some vineyard somewhere. I think I finally found an answer, although it is terribly kludgy. WARNINGS BEFORE YOU START THIS, BE AWARE OF THESE THINGS; READ THEM ALL If all you want is to delete the downloaded live wallpapers to save space THIS IS NOT THE WAY. Go find other posts for that. If you want to be rid of the downloaded wallpapers AND stupid selection thumbnails for all those stupid wallpapers, then find a different post for deleting, AND do the steps below. The Sonoma wallpaper selection pane (in Settings) might not work. Ever. Sometimes it does. Because of the above, if you can, set some wallpapers that you do like (wallpapers of your own
Topic: App & System Services SubTopic: Core OS Tags:
Oct ’24
Apple Search Ads Reports API - Invalid Request JSON
I'm trying to call https://api.searchads.apple.com/api/v5/reports/campaigns but getting the following response: {data:null,pagination:null,error:{errors:[{messageCode:INVALID_JSON_REQUEST,message:This is an invalid json. The request can not be parsed,field:Line#:1 Column#:13}]}} I've used all suggested options for request parameters from documentation, e.g. { startTime: 2024-04-08, endTime: 2024-04-09, selector: { orderBy: [ { field: countryOrRegion, sortOrder: ASCENDING } ], conditions: [ { field: countriesOrRegions, operator: CONTAINS_ANY, values: [ US, GB ] }, { field: countryOrRegion, operator: IN, values: [ US ] } ], pagination: { offset: 0, limit: 1000 } }, groupBy: [ countryOrRegion ], timeZone: UTC, returnRecordsWithNoMetrics: true, returnRowTotals: true, returnGrandTotals: true } What's the proper way to call this API?
1
0
565
Oct ’24
Possible NavigationSplitView bug
With macOS 15, I'm noticing a new behavior when initializing a NavigationSplitView with columnVisibility. For example: @State var sidebar = NavigationSplitViewVisibility.all var body: some View { ZStack { NavigationSplitView(columnVisibility: $sidebar) { This code previous to macOS 15 would behave as expected: the sidebar could be toggled and the views would stay intact. However, when you update sidebar after updating to macOS 15, the entire view is reinitialized, meaning that every single child view that depends on this parent view is also reinitialized. Is this expected behavior? Simply clicking the toggle sidebar UI button does not reinitialize views, but when you initialize a NavigationSplitView with the column visibility, changes to the sidebar will completely reload the UI. Has anyone else experienced this?
0
0
318
Sep ’24
Reply to iOS 18 NavigationSplitView in NavigationStack not loading properly
@vladimirs NavigationSplitView is a top level navigation container and it's meant to be used without being wrapped in another navigation container. You can embed a NavigationStack in a column of a NavigationSplitView not the other way around since a navigation split view collapses into a single stack on iPhone. If you'd like to learn more about navigation structures, you could review The SwiftUI cookbook for navigation WWDC session Could you elaborate on why you have the NavigationSplitView inside stack and what you're trying to achieve ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’24
UndoManager with SwiftData Not Registering Single Undo Actions Properly in macOS Sonoma 14.x
I am encountering an issue with the UndoManager functionality in a SwiftUI application that integrates SwiftData for persistence. This issue occurs specifically in macOS 14 (Sonoma) but works as expected on macOS 15 (Sequoia). The focused test app I have prepared for demonstration allows users to create ParentItem objects, and for each ParentItem, users can add multiple ChildItem objects. The undo functionality (via Cmd+Z) is not working as expected in Sonoma. When I try to undo a ChildItem addition, the UndoManager does not revert just the last ChildItem added, but instead removes all ChildItems that were added in that session. Expected Behavior On macOS 14 (Sonoma), I expect the UndoManager to undo only the most recent transaction (in this case, a single ChildItem insert), similar to how it functions on macOS 15 (Sequoia). Each ChildItem insertion should be treated as a separate undoable action. Current Behavior In macOS Sonoma, pressing Cmd+Z undoes the entire list of ChildItems added to a ParentItem in th
2
0
1.2k
Sep ’24
Playground Learn to Code 2, World Creation
world.place(Portal(color: #colorLiteral(red: 1.0004385709762573, green: 0.22760793566703796, blue: 0.18670153617858887, alpha: 1.0)), at: Coordinate(column: 0, row: 0)) I get the following error from the above little piece of code : “There was a problem running this code. Check for problems …. Start over” WHY
0
0
385
Sep ’24
SwiftUI Form (Grouped) with Table
Hi everyone, I’m having an issue with a SwiftUI Table inside a Form in a macOS app. When the Form style is set to .grouped, the Table does not resize to the full width of the Form or Sheet. However, when I switch to a .plain style, it resizes correctly. Here’s a simplified version of my code: Section(header: Text(Header)) { Table(data) { TableColumn(Column 1, value: .col1) TableColumn(Column 2, value: .col2) // Add more columns as needed } .frame(height: 100) } } .formStyle(.grouped) // Issue occurs only with this style Has anyone else experienced this? Any workarounds or suggestions would be greatly appreciated! Thanks!
3
0
758
Sep ’24
Reply to NavigationSplitView hide sidebar toggle button
Although Apple introduced .toolbar(removing: .sidebarToggle) finally, users can still drag the divider to change the column width and hide the side bar on macOS, and since sidebar toggle button is removed, users could never get back. In Sonoma Xcode15, developers have to use something like this: .introspect(.navigationSplitView, on: .macOS(.v13,.v14,.v15)) { splitview in if let delegate = splitview.delegate as? NSSplitViewController { delegate.splitViewItems.first?.canCollapse = false } } But it fails to work on Sequoia with Xcode16. Developers have to search around again to make it work just like the built-in Settings App, it's a shame.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’24
Menu in SwifUI
Hi, i´m trying to get a menu with three rows. The top one should be a HStack with three RoundedRectangle (Red, Yellow and Green). The second row and the third one (both separated with a Divider from the top one) are for edit and delete. But I get five rows, three empty rows plus the edit row and the delete row. The three first rows are empty but they execute the moveTask function correctly. I don't know how to solve this. Can anybody help please? struct TaskView: View { @EnvironmentObject var viewModel: BoardViewModel @EnvironmentObject var languageManager: LanguageManager @State private var isEditing = false let task: Task var body: some View { HStack(alignment: .center, spacing: 8) { Text(task.title) .font(.system(size: 16, weight: .medium)) .foregroundColor(.primary) .lineLimit(4) .multilineTextAlignment(.leading) .fixedSize(horizontal: false, vertical: true) Spacer(minLength: 0) Menu { ColorButtonsView(task: task, viewModel: viewModel) Divider() Button(action: { self.isEditing = true }) { Label(languageMa
Topic: Design SubTopic: General
0
0
341
Sep ’24