Search results for

column

2,047 results found

Post

Replies

Boosts

Views

Activity

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
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
397
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
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
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:
Dec ’23
SwiftUI #Preview with Callback Closure
I have created a simple calendar framework of my own. The screenshot below shows what it looks like. The following lines show a concise version of my calendar framework. The deal is such that the app will return a date when I tap a date button with the callBack closure. import SwiftUI struct ContentView: View { @State private var navigateToAddDate = false @State private var days: [Day] = [] @State var callBack: ((Date) -> Void) private let cols = [ GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible()) ] var body: some View { NavigationStack { VStack { LazyVGrid(columns: cols) { ForEach(days, id: .self) { day in Button(action: { selectedDay = day navigateToAddDate.toggle() }, label: { Image(systemName: (day.num).circle.fill) .resizable() .aspectRatio(contentMode: .fit) .foregroundColor(day.show ? dateTextForecolor(day: day) : .clear) }) .disabled(day.isInvalid) } } } } } } struct ContentView_Pr
3
0
1.6k
Nov ’23
Embedding a NavigationStack within the detail view of a NavigationSplitView
I'm using a two column NavigationSplitView, where the view passed for the detail column is the root of a NavigationStack. The navigation works as expected, but the navigationTitle and toolbar elements of the detail view are very slightly delayed when the view appears on iOS, such that they 'pop' in rather than smoothly animating like normal. Returning to the root of the view from views higher in this stack animates as expected. Has anyone seen anything like this before? Thanks!
6
0
2.3k
Oct ’23
Reply to Permission errors within an app after updating from MacOS 14.0 to 14.1
I talk about these errors in On File System Permissions. That suggests that: Your SMB share access is being denied by either the App Sandbox or MAC. Your spawning of a child process is being blocked by BSD permissions. However, it’s hard to be sure without more info. Let’s start with the second issue, because those problems are usually easier to resolve. How are you trying to spawn that child process? Using Process (NSTask in C-based languages)? Or fork / exec*? Or posix_spawn? Or something else? Could it be that the app is sandboxed by default on MacOS 14.1? That seems unlikely, but if you want to know whether an app is sandboxed you can view that in Activity Monitor. Control click on the process table header to enable the Sandbox column. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: App & System Services SubTopic: Core OS Tags:
Nov ’23
Reply to How to declare a TableColumn with nullable field?
Is there a way to get a SwiftUI Table to be able to sort by a column of optionals? You can extend Optional for your specific case. For example, if you are trying to sort by an optional Int: extension Optional where Wrapped == Int { var sortOrder: Int { switch self { case let .some(wrapped): wrapped case .none: Int.max } } } Then your TableColumn would look like this: TableColumn(Count, value: .count.sortOrder) { if let count = $0.count { Text(String(count)) } } If count is nil, it will be sorted as if its value is Int.max and the column will be blank for that row.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’23
How to declare a TableColumn with nullable field?
How does one declare a TableColumn with a nullable field? I have a Book model with several nullable fields: struct Book: Codable, Equatable, Identifiable { // ... let productURL: String? // ... } This is how I'm trying define the corresponding TableColumn: TableColumn(Product URL, value: .productURL) { book in Text(String(book.productURL ?? )) } Though this results in several errors: Referencing initializer 'init(_:value:comparator:content:)' on 'TableColumn' requires that 'Book' inherit from 'NSObject' Referencing initializer 'init(_:value:comparator:content:)' on 'TableColumn' requires that 'Book' inherit from 'NSObject' Referencing initializer 'init(_:value:comparator:content:)' on 'TableColumn' requires the types 'KeyPathComparator' and 'SortDescriptor' be equivalent Referencing initializer 'init(_:value:comparator:content:)' on 'TableColumn' requires the types 'KeyPathComparator' and 'SortDescriptor' be equivalent Other, non-nullable columns work just fine. For example: TableColumn(ID, value: .i
8
0
3.4k
Nov ’23
Reply to NSAttributedString doesn't format HTML tables properly on Sonoma
We are seeing this too. What seems to be happening is that the NSTextTableBlock objects representing each cell have different table pointers. In other words, each cell gets put into its own table, leading them to appear under one another. Interestingly, if you convert this attributed string to RTF, and back again, you get something else. You still get separate tables for each cell you input, but it creates empty cells so that the original cells at least have the correct column index, like this... Conclusion: the HTML input seems to generate a new table object for each cell, instead of a single table object for all cells. Submitted this a while back under FB13254682. Have added above FB to that.
Topic: Safari & Web SubTopic: General Tags:
Nov ’23