We use a localization service that allows us to export our translated strings in .xliff format. When I import the spanish (es.xliff) file into the string catalogs it imports the english keys and leaves the spanish translation column empty, which causes it to default to English. I created feedback 12429535 and 12429469 because it seems the feedback site is broken and shows it cannot find the feedback I just submitted.
Search results for
column
2,061 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I submitted FB12211784 the end of May. It contains a do-nothing-much app that creates a two column table of 10K entries. Selecting an item in the table causes the color of the text in the first column to change. On my 2019 intel iMac there is about a 140 msec delay between selection and the color change. That is noticeable. I just re-ran the code using a brand new Mac Studio with M2 Max. It still takes over 100 msec. Still noticeable.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
// Page 1: Map Search VStack { ZStack(alignment: .topLeading) { Map(coordinateRegion: $mapAPI.region, annotationItems: mapAPI.locations) { location in MapMarker(coordinate: location.coordinate, tint: .red) } .ignoresSafeArea() VStack { HStack { TextField(Enter an address, text: $text) .textFieldStyle(.roundedBorder) .padding(.horizontal) .foregroundColor(.black) Button(action: { fetchLocationInfoFromWikipedia(for: text) mapAPI.getLocation(address: text, delta: 0.5) showLocationInfo = true }) { Image(systemName: magnifyingglass) .foregroundColor(.black) } .padding(.leading, -50) } .padding() if showLocationInfo { VStack { Spacer() Rectangle() .fill(Color.white) .frame(height: 250) .frame(width: 400) .cornerRadius(15) .overlay( ScrollView { Text(locationInfo) .foregroundColor(.black) .padding(.horizontal, 10) .font(.system(size: 14)) .font(.custom(Serif, fixedSize: 14)) } .padding() ) .padding(.horizontal, 20) .padding(.bottom, 10) // Adjust the bottom padding here HStack(spacing: 70) { Button(action: { // Open
I moved the on appear to the h stack but the table rows portion of the table still ran before the on appear resulting in an index out of range error. So I added the suggested state variable and if statement. The view now works perfectly. Thank you again for providing great advice. Below is the updated code. struct DataTable: View { @ObservedObject var vm: ButtonsViewModel = ButtonsViewModel.shared var closingValues: [TradingDayClose] var heading: String = @State private var hasAppeared = false init(fundName: String, closingValues: [TradingDayClose]) { self.heading = fundName self.closingValues = closingValues } var body: some View { HStack { Spacer() .frame(width: 150) GroupBox(heading) { if hasAppeared { Table (of: TradingDayClose.self) { TableColumn() { closingValue in Text(dateToStringFormatter.string(from: closingValue.timeStamp!)) .id(closingValue.timeStamp!) .textFormatting(fontSize: 14) .frame(width: 100, alignment: .center) } // end table column TableColumn() { closingValue in Text(String(fo
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
I've put together a simplified code example to test how the location of dropDestination works within a Grid View. When I attach dropDestination to Grid, GridRow or the Text((row) , (column)) view, I get a CGPoint corresponding to the drop location within the views coordinate space. But the problem is how would I get the either the index of a grid cell eg. (1, 1) or the grid cell view itself? Apple's documentation regarding drag and drop in SwiftUI says to prefer using transferable items which I interpret as them recommending dropDestination over the older onDrop with an NSItemProvider. But unlike in a List view there doesn't seem to be away for location to return discrete values. If I instead attach dropDestination to a one of the nested ForEach loops within the Grid view, the drop gesture doesn't do anything? Also dropDestination exhibits some default behaviour that I don't want. When dragging a view a little plus symbol within a green circle appears Views can be dragged and dropped out of the apps
I have a view that displays core data values (passed in as closingValues) in a data table. To make the view generic, so I can pass in arrays of different lengths (all are from the same entity and thus attributes) and account for the view having already been called with a different set of values, I need to initialize the showData array contained in the associated view model. I attempt to do so in the init of the view but I get an error message publishing changes from within a view updates is not allowed. This will cause undefined behavior. It should be noted that in the view model showData is Published and initialized = []. I attempted to do the initialization in the views onappear but the tables rows: ForEach runs before onappear and I get an index out of range on the first call to the view. I tried adding @MainActor to the view models class, which also failed to solve the problem. I am clearly not understanding a concept. Below is the code for the view. struct DataTable: View { @ObservedObject var vm: Button
Thank you for responding to my question. Below is a simplified code example that displays two SF Symbol images on a Grid View, as seen in the gif. I've included a basic DragGesture but I have a feeling it isn't the right approach. In order for it to work the onEnded closure would need to somehow map the offset coordinate into a Square enum case so that I could update the ModelState. I intend for the board and pieces to scale to fit the available space so the size of the squares won't be known beforehand, making the coordinate mapping difficult. Maybe **GeometryReader ** could solve that but I could see the code becoming a mess. I see other drag and drop methods in the documentation, surely one them is designed to better fit this use case. dropDestination seems like a suitable candidate but I think read somewhere that it doesn't work with SF Symbols. I'm looking for guidance from someone familiar with Apple's documentation because they provide little explanations themselves (I've watched WWDC videos). Also the
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
My app has the App Sandbox enabled and the File Access to Downloads folder is set to Read / Write in XCode. Upon clicking on a button the app should open the Finder displaying the Downloads folder. The following code snippet is used to launch the Finder if let inspirationsDirectory = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask).first{ NSWorkspace.shared.open(inspirationsDirectory) } On my MacOS it works well. After releasing the app to the AppStore and installing it on another Mac the following message is received upon clicking the button: The application does not have permission to open Downloads Which would be the solution to launch the Finder successfully ? Is it possible to launch the Finder showing the Downloads folder sorted by the Date Added column descending ?
I'm trying to use the Xcode 15.0 beta on macOS 13.4 (22F66) on a MacBook Pro 16 (2019) but whenever I try to start a new project, Xcode becomes unresponsive – seemingly indefinitely. In Activity Monitor I see Open and Save Panel Service (Xcode) (Not Responding): Even if I try to use Xcode 14.3.1 now I get the same problem. I've tried to resolve this by removing all Xcode-related files as well as the Xcode command line tools and reinstalling them but to no avail. I'd appreciate any and all help in how to fix this. EDIT: I have since found out that if I force-quit the bird process, Xcode will react again. But the bird process will start up and shoot to the top of the % CPU l column in Activity Monitor again almost instantly. It appears to be iCloud-related but I don't know what's causing it to take up so much CPU resources and make Xcode unresponsive, and how I can fix this.
To learn how to do peer to peer communication I downloaded the TicTacToe example into my MacStudio from: https://developer.apple.com/documentation/network/building_a_custom_peer-to-peer_protocol I then loaded it into Xcode, compiled it, deployed to an iPhone 14 over a Lightning cable, and ran it. I developed code for the MacStudio in an attempt to communicate with it. The MacStudio at first detected the service but for some reason it has quit doing so. The command: dns-sd -B _services._dns-sd._udpoutputs this as one of its lines: A/R Flags if Domain Service Type Instance Name Add 3 17 . tcp.local. _tictactoe (The time stamp column deleted for clarity) This line remains the command's output even after the iPhone the TicTacToe app has been shutdown, and after in the MacStudio Xcode, and the simulator it opens, is shutdown. In an attempt to find out what application is still advertising this Bonjour service I installed Discovery from: https://apps.apple.com/us/app/discovery-dns-sd-browser/id305441017 Wh
Hi I successfully saved the depth map to 32-bit binary file. Then I can read the file and convert it to png using python opencv. func convertDepthData(depthMap: CVPixelBuffer) -> [[Float32]] { let width = CVPixelBufferGetWidth(depthMap) let height = CVPixelBufferGetHeight(depthMap) var convertedDepthMap: [[Float32]] = Array( repeating: Array(repeating: 0, count: width), count: height ) CVPixelBufferLockBaseAddress(depthMap, CVPixelBufferLockFlags(rawValue: 2)) let floatBuffer = unsafeBitCast( CVPixelBufferGetBaseAddress(depthMap), to: UnsafeMutablePointer.self ) for row in 0 ..< height { for col in 0 ..< width { convertedDepthMap[row][col] = floatBuffer[width * row + col] } } CVPixelBufferUnlockBaseAddress(depthMap, CVPixelBufferLockFlags(rawValue: 2)) return convertedDepthMap } Then save it to app container. func saveFloat32ArrayToDocumentsDirectory(array: [[Float32]], fileName: String, folderName: String) -> URL? { let fileManager = FileManager.default let datasetDirectory = getDatasetDirectory(
Topic:
Spatial Computing
SubTopic:
ARKit
Tags:
Having the same problem, anyone has anything new to help solve the issue? I have a NavigationSplitView with three columns and a .searchable()on the first column List view. Data to the views come from Core Data @FetchRequest. Whenever user removes a character from the search field or clears the search field, the same warning is displayed. When entering search text, warning does not appear. This does not happen always. For example when I enter a search text resulting in one row, and then remove one letter from search text. Then three rows are displayed and this warning does not appear. After removing another letter, resulting to five rows appearing, then this warning appears. Relevant parts of code below. struct ContentView: View { @Environment(.managedObjectContext) var moc @FetchRequest (sortDescriptors: [SortDescriptor(.subject)]) private var categories: FetchedResults @State private var selectedCategory : Category? = nil @State private var selectedTerm: Term? = nil @State private var searc
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Hi AndyJJ, Thanks for the tips, after corrections the error messages disappeared. However, the command while fmResultSet!.next() != nil It always returns True, so the loop ends up giving an error when finding one of the columns of the ResultSet where I check if it is different from nil. To work around, I now check if the PkLivro field is equal to zero then I break the loop. Thanks.
Topic:
Programming Languages
SubTopic:
Swift
Tags:
Hi. I'm writing the following code for a navigation with images and I have an issue: the images don't fit with the automatic rectangle that is created by the NavigationStack view. Here is the code and I'm attaching an image too for you to understand : import SwiftUI struct LycéesListe: View { var body: some View { NavigationStack { List(lycées) { lycée in NavigationLink { LycéeDétail(lycée: lycée) } label: { LycéesRow(lycée: lycée) } } .navigationTitle(Lycées) } } struct LycéesListe_Previews: PreviewProvider { static var previews: some View { ForEach([iPhone 13, iPhone 12], id: .self) { deviceName in LycéesListe() .previewDevice(PreviewDevice(rawValue: deviceName)) .previewDisplayName(deviceName) } } } } Anyone knows how I could make the images fit with the rectangle border so I just have images with clean rectangles and not these green lines ? I tried to do padding but it didn't help. Any answer appreciated.
Hello everyone, I have encountered a very strange issue with my SwiftUI code, and I'm hoping you can help me resolve it. Let me explain in more detail how my code works. In my main view (ContentView), I have a navigation bar (AppBarView) that can collapse and expand based on the scroll position of the page. I also use a TabView to display different views depending on the user's selection. The problem arises when the navigation bar is expanded, and I scroll back up the page. My ScrollView behaves erratically, causing a shaking effect with an overlapping of the navigation bar and the ScrollView. To better understand the issue, please watch this video: https://www.youtube.com/shorts/LF0ZfwtiiNI After conducting several searches, I have identified that the following line is causing the issue: .tabViewStyle(PageTabViewStyle(indexDisplayMode: .never)) Without this line, everything works fine, but I lose the desired visual effect provided by PageTabViewStyle. This is where I'm stuck because I don't understand why th