Search results for

column

2,046 results found

Post

Replies

Boosts

Views

Activity

Phantom Service
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
1
0
485
Jun ’23
QuickLook on macOS: various questions
I'm trying to create a custom Quick Look preview on macOS. I've found the Quick Look Preview Extension target, which is brilliant, and does most of the 'heavy' lifting, but I've run into a few problems. I'm implementing a preview for MIDI files (which has been missing since 2009...) using AVMIDIPlayer. The player keeps playing when the file is no longer selected! What's the mechanism for fixing that? Some sort of check that the view exists..? I notice that the OS preview for audio files has a different interface for the Finder's preview column and for the QuickLook 'pop-up' window. Again, I can't see how you define different views for those two environments. Is there any documentation that's specifically Mac? I can only find iOS stuff. (Same for third-party tutorials.)
2
0
2.0k
Jun ’23
Reply to Access depth data purely from lidar
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:
Jun ’23
Reply to WARNING: Application performed a reentrant operation in its NSTableView delegate. This warning will become an assert in the future.
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:
Jun ’23
Reply to Xcode X Switt X SQLite
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:
May ’23
Best way to make a grid with both top and left headers
Hello, I’d like to display items in a grid, with both a header row and a header column. Something like this : A B C D 1 x y x x 2 x x x x 3 x y y y 4 y x x y What elements should I use for this arrangement? It seems Grid doesn’t allow for headers that would behave differently than the data cells, and, if using a separate HStack or VStack for the headers, I’m not sure how I could force data lines and rows to stay aligned with the headers.
4
0
1.2k
May ’23
Reply to Best way to make a grid with both top and left headers
Using private var columns: [GridItem] = [ GridItem(.fixed(100)), GridItem(.fixed(100)), GridItem(.fixed(100)) ] is the best way to guarantee them to be the same size. Using .flexible will allow to you either set nothing or the min/max. The size will change depending on the content though (and same with adaptive ). For this, you can ensure equal column widths if you make the header the same width for each column.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’23
Reply to Instruments: what is static AppName.$main() [inlined]
I see I forgot to enable email notifications of replies... fixed. I'm using a Swift table with 4 columns. In testing I replaced the columns with a fixed Text view to see if that was an issue. It wasn't. There was in issue in row: closure to the table in that the array consisted of large-ish structs and a lot of time was being taken allocating and freeing memory to copy the array entries. I changed the struct to a class and saved about 40% of the delay time. Still, there is something going on. When I select an item in the table the user experience is 1) the row turns blue, 2) longish delay, 3) text in the first column changes color. Normally lots of other stuff goes on but I disabled all of it looking for the source of the longish delay. That delay is the hang reported above. If I show system libraries it looks like this: Note that I also scrolled the tracks to show View Body and the Core Animation Commits -- fwiw I am not doing any additional animation over whatever is built into Sw
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’23
Reply to How to test my app NFC in iPhone XR, using personal team ?
That’s not possible. If you’re working with a Personal Team, you should bookmark this page. The rightmost column [1] shows capabilities available to a Personal Team. As you can see, NFC isn’t listed there, which means it isn’t available to you. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com [1] Somewhat confusingly labelled Apple Developer.
Topic: Code Signing SubTopic: Entitlements Tags:
May ’23
Reply to Safari does better than Firefox, but better isn’t good.
Another issue: If --count is set to 1 as result of round: --count: calc(round(down, calc(sqrt(var(--images))), 1) + 1); grid-template-columns: repeat(var(--count), 1fr); grid-template-columns: 1fr; isn’t the same (in Safari)! The first line results in 2 columns, not in one! Looks like the same reason. Because grid-template-columns: repeat(calc(var(--count) -0.01), 1fr); gives one column.
Topic: Safari & Web SubTopic: General Tags:
May ’23
Passing Data Up the View Hierarchy
I'm working on a calculator app but I'm having trouble displaying the results of a function. When I press a button in ButtonView, a function runs to calculate the result but that result does not display in CalculationCircleView. Main View: struct ScoreCalculatorView: View { @StateObject private var viewModel = ViewModel() var body: some View { VStack { Spacer() HStack { CalculationCircleView(calculation: viewModel.grossScore, label: Score) Spacer() CalculationCircleView(calculation: viewModel.plusMinus, label: +/-) } .padding(.horizontal, 30) Spacer() LazyVGrid(columns: viewModel.columns, spacing: 20) { ForEach(0..<4, id: .self) { index in ZStack { DataCellsView(labels: viewModel.scoreLabels[index]) TextField((viewModel.scoreLabels[index]), text: $viewModel.scoreData[index]) .font(.largeTitle) .fontWeight(.light) .frame(maxWidth: 80) .multilineTextAlignment(.center) .keyboardType(.numberPad) } } } .frame(width: 250) Spacer() ButtonView(data: viewModel.scoreData) .padding(.bottom, 20) } } } Calcula
2
0
951
May ’23
Xcode 14.3 project->target->info view error
since 14.3 update I'm missing the type and value column in the Project->Target->%target%->Info view. I only can see the key column. I've already reinstalled Xcode multiple times and restarted my MacBook Pro. Here the screenshot from the new created project: I can add new properties, but I can't change the value. Has anyone some idea, what I can do to fix this problem? Btw: my workmate with similar MacBook Pro setup can change all the values.
1
0
560
May ’23
Selection state is lost when navigating to/from home screen
Hi! When using the Sample NavigationCookbook in the two column layout, the selection in the first column is not remembered, when navigating to the Home Screen and back. This behaviour can be reproduced by starting the app on the iPad or simulator, selecting for example Pancake and then navigating to the home screen and back into the navigation. Sometimes this (the navigation to/back from the home screen) has to be done twice, to lose the selection. In the console log you can see the message Update NavigationAuthority bound path tried to update multiple times per frame. appearing. Not sure if this has something todo with the selection being lost. This is on iOS 16.4.1 not sure if the behaviour before was different. Anybody experiences the same behaviour? Bug in SwiftUI or in the sample app? Cheers, Michael
2
0
929
Apr ’23
View is not updating while app is running
Hi :-) I´m looking for some help and advice for my little project. Basically I have a Tabview with 3 Tabs. One of them is a View for Favorites. I managed the selection and the saving of the favorites. However, the View for the Favorites is not updating while the app is running. Just when the app is closed and restarted the View of Favorites gets updated. The Array of Favorites is marked with @Published, the variable in the Favorites-View is marked as @ObservedObject. I searched a lot and can't find my mistake. „Expression“ is a Struct with about 10 properties. Class for the Favorites: class Favorites: ObservableObject { @Published var favoriteExpressions: [Expression] = [] { didSet { print(Favorites changed) } } private let saveKey = FavoriteExpressions let defaults = UserDefaults.standard init() { if let data = defaults.data(forKey: saveKey) { let decoder = JSONDecoder() if let decoderSet = try? decoder.decode([Expression].self, from: data) { favoriteExpressions = decoderSet } } } func contains() -> Bool
2
0
1.1k
May ’23
SwiftUI - ScrollView with LazyVGrid and onTap, scrolling randomly by itself
Hi everyone, I'm having a hard time figuring out why the code below results in weird behaviour with the ScrollView. Code : struct MainView: View { @State var strings: [String] = [A, B, C, D, E] @State var ints: [Int] = Array(1...300) @State var selectedInt: Int? var body: some View { ZStack { ScrollView { VStack { ForEach(strings, id: .self) { string in VStack { HStack { Text(string) Spacer() } LazyVGrid(columns: [GridItem(.flexible()), GridItem(.flexible()), GridItem(.flexible())]) { ForEach(ints, id: .self) { int in VStack { Text(String(int)) Spacer() } .frame(minWidth: 0, maxWidth: .infinity) .frame(height: 200) .background( RoundedRectangle(cornerRadius: 5) .fill(int % 2 == 0 ? .orange : .green) ) .onTapGesture { self.selectedInt = int } } } } } } .padding() } if let selectedInt { VStack { Spacer() Text(String(selectedInt)) Spacer() Button { self.selectedInt = nil } label: { Image(systemName: x.circle) .resizable() .scaledToFit() .frame(width: 30) } } .frame(minWidth: 0, maxWidth: .infinity, minH
6
0
4.4k
May ’23