Search results for

column

2,061 results found

Post

Replies

Boosts

Views

Activity

Reply to Customizing Back Button in Column 2 "Content" in SplitView
You can remove the toggle to show and hide the column with .toolbar(removing: .sidebarToggle) - https://developer.apple.com/documentation/swiftui/view/toolbar(removing:) For the back button, if you're navigating to a detail view, you can use .navigationBarBackButtonHidden() - https://developer.apple.com/documentation/swiftui/view/navigationbarbackbuttonhidden(_:) - on the detail view to hide the back button
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’23
Reply to Issues with String Catalogs comments and git
It seems to me that you shouldn't really be using the same key for both of these localized strings, since they are used in different places. Even if the localized strings come out the same in general, it's a risky assumption that the different UI contexts (column titles and button titles in your example) won't require different strings for some languages. For example, in some languages the string might need to be capitalized differently in these 2 places. If you really do want to use the exact same localized string in both places, I'd recommend that you use the same comment everywhere in your source code, describing both intended uses. If you fully specify the comment this way, you avoid confusion for the translator too. Otherwise, you should use a unique string at each call site, such as Something-List-Title and Something-Button-Title, and use the comments to clarify exactly what needs to be localized. I also recommend that you use Feedback Assistant to submit a enhancement request for (say) a way o
Dec ’23
Couldn't parse json?
I'm creating a view by reading several json files at once. I'm reading 6 files from indexes 0 to 5 and displaying each view. Until the day before yesterday, only the view of index 0 was executed and the rest of the errors appeared, but I didn't correct anything, but the file in index 1 starts to read, and from 2 the same error appears. In my json file, there is no '/' in row 1 of column 1, but there is a '/' in row 1 of column 1, so I think they say that they can't read it as a json file [ { name: recipe1, id: 1001, description: 1, imageName: Recipe01 }, { name: recipe2, id: 1002, description: 2, imageName: Recipe01 }, { name: recipe3, id: 1003, description: 3, imageName: Recipe01 }, { name: recipe4, id: 1004, description: 4, imageName: Recipe01 }, { name: recipe5, id: 1005, description: 5, imageName: Recipe01 }, { name: recipe6, id: 1006, description: 6, imageName: Recip01 }, { name: recipe7, id: 1007, description: 7, imageName: Recip01 } ]
1
0
415
Dec ’23
Issues with String Catalogs comments and git
Hello, I migrated a project to use String Catalogs (Localizable.xcstrings) instead of Localized.strings and Localized.stringsdict files. So far so good, but since I use a lot localized strings in my project, there are quite some localizations used more than once in different contexts and thus with different comments. For example: Source file 1: String(localized: Something, comment: Button title for context1) Source file 2: String(localized: Something, comment: Column title for context2) This results to a Localized.xcstrings file with this content: { sourceLanguage : en, strings : { Something : { comment : Column title for context2nButton title for context1 } }, version : 1.0 } The main problem with this is, that the order of the concatenated comment changes randomly during each build. After the next Xcode build (without any code changes), the same Localized.xcstrings file might look like this: { sourceLanguage : en, strings : { Something : { comment : Button title for context1nColumn title f
1
0
1.6k
Dec ’23
SwiftUI Toolbar inconsistent behavior on MacOS
Overview I'm facing an issue where the MacOS Toolbar shows overall inconsistent behavior when switching from 3 columns to 2 columns NavigationSplitViews. I'd like to know if this is somehow expected or possible fixes for this issue. Details I'm using the code available at this WWDC22 session to reproduce the issue: https://developer.apple.com/documentation/swiftui/bringing_robust_navigation_structure_to_your_swiftui_app This same inconsistent behavior is also appearing on another project. Steps to reproduce: Open the application and select the 3 columns option Select any item on the sidebar. Notice how the toolbar is displayed. There is no divider and the primary action placement on the far-right of the Toolbar. Click on it and select now 2 columns. Notice how the toolbar is displayed. Now the primary action is no longer on the far right of the toolbar, but on the right of what would be the content view. Besides that, a divider is now appearing. Click again on the wand and
1
0
363
Dec ’23
Usage of Touch Gesture to acquire DepthData of a specific point using LiDAR
Hello! The Aim of my project is as specified in the title and the code I am currently trying to modify uses CVPixelBufferGetBaseAddress to acquire the DepthData using LiDAR. For some context, I made use of the available Capturing depth using the LiDAR camera Documentation using AVFoundation and edited code after referring a few Q&A on Developer Forums. I have a few doubts and would be grateful if I could get insights or a push in the right direction. Regarding the LiDAR DepthData: Where is the Origin(0,0) and In what order is it saved? (Basically, how do the row and column correspond to the real world scenario) How do I add a touch gesture to fill in the values of X&Y for distanceAtXYPoint so that I can acquire the Depth data on user touch input rather than in real-time. The function for reference : //new function to show the depth data value in meters func depthDataOutput(syncedDepthData: AVCaptureSynchronizedDepthData) { let depthData = syncedDepthData.depthData.converting(toDepthDataType:
0
0
644
Dec ’23
Reply to Upgraded to Xcode 15.0.1 and no longer see NSLog messages
I have found a solution , see this post [https://developer.apple.com/forums/thread/742594] Select the relevant product in the the Scheme dropdown (e.g. [AppName] Watchkit App, or [AppName] for iOS app Select Edit Scheme... Select Run in list on the left Select Arguments tab Click > next to Environment Variables to show a (probably empty) list. Click + In Name column, double click the space and enter: IDELogRedirectionPolicy In Value column double click the space and enter: oslogToStdio Ensure the checkbox is selected Click Close button. You have to repeat these steps for each iOS, WatchOS product as each has its own Run Scheme. Now NSLogs will print to the Debug Console again.
Dec ’23
NavigationLink larger than its contents
I have an image (or filled rectangle, or anything) placed inside a NavigationLink, but it doesn't get its full width, instead it's the width minus the corner radius. Here's my simplified code: ScrollView(.vertical, showsIndicators: false) { LazyVGrid(columns: columns, spacing: 20) { ForEach(children, id: .self) { childTopic in NavigationLink(value: childTopic) { Image(childTopic.previewImage) .resizable() .scaledToFill() .frame(maxWidth: 300, maxHeight: 150, alignment: .top) .clipShape(RoundedRectangle(cornerRadius: 15.0, style: .circular)) } .buttonBorderShape(.roundedRectangle(radius: 15.0)) .padding(20.0) } } .padding() } The screenshot shows what each list items look like. Is it possible to make the image fill the NavigationLink? PS: I played around with .buttonStyle(.plain) on the NavigationLink, but on visionOS it still gets an overlay when the user looks at it - which is a good thing, but larger than the image.
0
0
592
Dec ’23
Reply to NSLog unreliable in Xcode 15 Console
Thanks to the helpful explanation in this article https://lapcatsoftware.com/articles/2023/10/5.html I understood the cryptic references in the XCode 15 release Notes and answered this myself. To return to XCode 14 and earlier world in which NSLog works you have to do this: Select the relevant product in the the Scheme dropdown (e.g. [AppName] Watchkit App, or [AppName] for iOS app Select Edit Scheme... Select Run in list on the left Select Arguments tab Click > next to Environment Variables to show a (probably empty) list. Click + In Name column, double click the space and enter: IDELogRedirectionPolicy In Value column double click the space and enter: oslogToStdio Ensure the checkbox is selected Click Close button. You have to repeat these steps for each iOS, WatchOS product as each has its own Run Scheme. Now NSLogs will print to the Debug Console again. I have no idea about other side effects as I don't need more sophisticated logging. Works fine when connected by Network too.
Dec ’23
Reply to iOS 16.1 Crashes when scroll (LazyVStack and LazyVGrid)
Can reproduce this with Xcode Version 15.1 beta 3 (15C5059c) deploying to iPhone 14 Pro running iOS 17.1.1. Make a test project with Apple's LazyVGrid sample code. Launch app in portrait, scroll to bottom, rotate to landscape, rotate to portrait, scroll to top, crash! let columns = [GridItem(.flexible()), GridItem(.flexible())] var body: some View { ScrollView { LazyVGrid(columns: columns) { ForEach(0x1f600...0x1f679, id: .self) { value in Text(String(format: %x, value)) Text(emoji(value)) .font(.largeTitle) } } } } private func emoji(_ value: Int) -> String { guard let scalar = UnicodeScalar(value) else { return ? } return String(Character(scalar)) } id: .self tut tut Apple sample code developer! (this is not the cause of this crash though).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’23
Is there a way to apply for formatting option to a Dataframe column outside of the explicit description(options:) method?
I'm building up a data frame for the sole purpose of using that lovely textual grid output. I'm getting output without any issue, but I'm trying to sort out how I might apply a formatter to a specific column so that print(dataframeInstance) just works nicely. In my use case, I'm running a function, collecting its output - appending that into a frame, and then using TabularData to get a nice output in a unit test, so I can see the patterns within the output. I found https://developer.apple.com/documentation/tabulardata/column/description(options:), but wasn't able to find any way to pre-bind that to a dataframe Column when I was creating it. (I have some double values that get a bit excessive in length due to the joys of floating point rounding) Is there a way of setting a formatter on a column at creation time, or after (using a property) that could basically use the same pattern as that description method above?
1
0
1k
Nov ’23
Reply to NavigationSplitView Collapse Button
Hi @Ammar S. Mittori, The way that mail works on my iPad is that it shows two columns at first, and when you press the button to expand to three columns, that button disappears. To go back to the two column view, you click on the rightmost detail column and it will collapse. If you do want to show a button to collapse the third column, you can try code like this: struct ContentView: View { @State private var columnVisibility: NavigationSplitViewVisibility = .all var body: some View { NavigationSplitView(columnVisibility: $columnVisibility) { Text(Column 1) } content: { Text(Column 2) .toolbar { Group { if columnVisibility == .all { ToolbarItem(placement: .navigation) { Button(Back){ columnVisibility = .doubleColumn } } } } } } detail: { Text(Column 3) } } } This code sets a variable for the column visibility to be all the columns, and then changes that variable to just two columns when the back button is clicked
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’23
NavigationSplitView Collapse Button
Hi, When creating a 3 columns Split View in SwiftUI the second view that resemble the mails list in Apple Mails App have a blue icon at top left corner where when tapped shows the column of Mail boxes such as Inbox, Sent etc. This icon by default when creating the Split View disappears after tapping, it shows the third column and disappear , I would like it to stay so I can show and collapse the first column sam as Apple Mail App. how to do that ? its called back also how to rename it and add icon to it ?
3
0
1.1k
Nov ’23