Search results for

column

2,052 results found

Post

Replies

Boosts

Views

Activity

Reply to DataFrame's Column doesn't support array of dictionary
I've finally initialized the DataFrame like this var trainingData: DataFrame = [keywords : data.trainingKeywords, target: data.trainingTargets] but now i'm getting this error when creating my data model like this: let model = try MLLinearRegressor(trainingData: trainingData, targetColumn: target) CreateML Type Error: Column keywords has element of unsupported type Any. Any idea from there on?
Topic: Machine Learning & AI SubTopic: Core ML Tags:
Dec ’23
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
NavigationSplitView resetting when app enters background
I've been trying to build an app using NavigationSplitView and SwiftUI on iOS 16. I noticed that as soon almost as the app enters the background (sometimes I have to wait a few seconds before immediately reopening the app) the contents of the NavigationSplitView are reset. This behavior differs from a NavigationStack using essentially the same path and app structure. I'm wondering if anyone has any idea why this happens? I did a little investigation and can say I've noticed a few things If using a List with a selection item specified, the selection item is set to nil when the app enters the background. For NavigationSplitView this typically will reset the downstream Detail or Content view since the value is lost If using a List without the selection parameter specified this effect is mitigated but the view still is reset and things like scroll position are wiped despite no content changing. Self._printChanges() indicates the view is unchanged despite being reset to its initial state. Using Apple's own WWDC sa
2
0
1.4k
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
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