Swift is a powerful and intuitive programming language for Apple platforms and beyond.

Swift Documentation

Posts under Swift tag

2,038 Posts
Sort by:
Post not yet marked as solved
0 Replies
172 Views
Hey, i just created and trained an MLImageClassifier via the MLImageclassifier.train() method (https://developer.apple.com/documentation/createml/mlimageclassifier/train(trainingdata:parameters:sessionparameters:)) For my Trainingdata (MLImageclassifier.DataSource) i am using my directoy structure, so i got an images folder with subfolders of person1, person2, person3 etc. which contain images of the labeled persons (https://developer.apple.com/documentation/createml/mlimageclassifier/datasource/labeleddirectories(at:)) I am saving the checkpoints and sessions in my appdirectory, so i can create an MLIMageClassifier from an exisiting MLSession and/or MLCheckpoint. My question is: is there any way to add new labels, optimally from my directoy strucutre, to an MLImageClassifier which i create from an existing MLCheckpoint/MLSession? So like adding a person4 and training my pretrained Classifier with only that person4. Or is it simply not possible and i have to train from the beginning everytime i want to add a new label? Unfortunately i cannot find anything in the API. Thanks!
Posted Last updated
.
Post not yet marked as solved
0 Replies
132 Views
In my SwiftUI view, I try to load the image from data. var body: some View { Group{ if let data = model.detailImageData, let uiimage = UIImage(data: data) {// no memory issue Image(uiImage: uiimage) .resizable() .scaledToFit() } } } But I want to get the HDR style of my image, so I use if let data = model.detailImageData, let uiimage = UIImageReader.default.image(data:data){ //memory leaks!!! When I change the data, the memory of the previous image is never freeed. finally caused my app to crash. You can see it from the Instrument screenshot.
Posted
by SpaceGrey.
Last updated
.
Post not yet marked as solved
0 Replies
120 Views
I use this code to show the Image in HDR in SwiftUI struct HDRImageView: UIViewRepresentable { // Set up a common reader for all UIImage read requests. static let reader: UIImageReader = { var config = UIImageReader.Configuration() config.prefersHighDynamicRange = true return UIImageReader(configuration: config) }() let data:Data? let enableHDR:Bool func makeUIView(context: Context) -> UIImageView { let view = UIImageView() view.preferredImageDynamicRange = enableHDR ? .high : .standard update(view) // Set this view to fit itself to the parent view. view.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) view.setContentCompressionResistancePriority(.defaultLow, for: .vertical) view.setContentHuggingPriority(.required, for: .horizontal) view.setContentHuggingPriority(.required, for: .vertical) return view } func updateUIView(_ view: UIImageView, context: Context) { update(view) } func update(_ view: UIImageView) { autoreleasepool{//not working if let data = data { view.image = nil//set to nil first is not working view.image = HDRImageView.reader.image(data: data) } else { view.image = nil } view.preferredImageDynamicRange = enableHDR ? .high : .standard } } } But when I update the input data, seems that the old image data can not be freeed. After several changes, the app takes too much memory and crash. I found it's the VM:ImageIO_Surface_Data and the VM_Image_IO take up the memory. If I change the HDRImageView into a normal Image(uiimage:UIImage(data:)) It no longer have this issue. Is it a memory leak? and how to solve this. Update: I then tried using Image(_:cgImage), and it appear to be the same result.
Posted
by SpaceGrey.
Last updated
.
Post not yet marked as solved
0 Replies
136 Views
Hello We received frequent crashes for the webkit on 17.4.1. We checked the code as well nothing got changed from our side. I tried to reproduce it but unable to do so. Can anybody advice on this. Below is the stack trace for same Please help to check. Thanks in advance
Posted Last updated
.
Post not yet marked as solved
3 Replies
171 Views
Hi, The goal is the move an element based on an input matrix using timer to trigger changes in the position. Say we have 2 positions, an input matrix and the element that is to be moved defined: import SwiftUI import Foundation // Positions struct PositionConstants { static let pos_1 = CGPoint(x: 155, y: 475) static let pos_2 = CGPoint(x: 135, y: 375) } // Input Matrix struct Input { static let input_1: [[Int]] = [ [ 1, 1, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ], ] } // Element Class class Element: ObservableObject { let imageName: String let name: String let size: CGSize @Published var position: CGPoint init(imageName: String, name: String, size: CGSize, position: CGPoint) { self.imageName = imageName self.name = name self.size = size self.position = position } } Moving the element without a function works perfectly fine: struct Pos_View: View { @ObservedObject var element_1 = Element(imageName: "pic_1", name: "", size: CGSize(width: 100, height: 100), position: PositionConstants.pos_1) let Input_Matrix = Input.input_1 // Index to track current row in matrix @State private var currentIndex = 0 // Timer to trigger updates private let timer = Timer.publish(every: 1.0, on: .main, in: .common).autoconnect() var body: some View { VStack { // Display element Image(element_1.imageName) .resizable() .frame(width: element_1.size.width, height: element_1.size.height) .position(element_1.position) .onReceive(timer) { _ in // Update element position based on matrix if currentIndex < Input_Matrix.count { let isFirstElementOne = Input_Matrix[currentIndex][0] == 1 let newPosition = isFirstElementOne ? PositionConstants.pos_2 : PositionConstants.pos_1 withAnimation { element_1.position = newPosition } currentIndex += 1 } else { // Stop the timer when we reach the end of the matrix timer.upstream.connect().cancel() } } } } } struct ContentView: PreviewProvider { static var previews: some View { Pos_View() } } But when using a function to trigger the animation, I get the error "Cannot use mutating member on immutable value: 'self' is immutable" when calling the function using a button: struct Pos_View: View { @ObservedObject var element_1 = Element(imageName: "pic_1", name: "", size: CGSize(width: 100, height: 100), position: PositionConstants.pos_1) let Input_Matrix = Input.input_1 // Index to track current row in matrix @State var currentIndex = 0 // Timer to trigger updates private var timer: Timer? var body: some View { VStack { // Display element Image(element_1.imageName) .resizable() .frame(width: element_1.size.width, height: element_1.size.height) .position(element_1.position) // Button to start animation Button("Start Animation") { startAnimation() } } } mutating func startAnimation() { currentIndex = 0 // Reset index before starting animation timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) {timer in if self.currentIndex < self.Input_Matrix.count { let isFirstElementOne = self.Input_Matrix[self.currentIndex][0] == 1 let newPosition = isFirstElementOne ? PositionConstants.pos_2 : PositionConstants.pos_1 withAnimation { self.element_1.position = newPosition } self.currentIndex += 1 } else { // Stop the timer when we reach the end of matrix timer.invalidate() } } } } struct ContentView: PreviewProvider { static var previews: some View { Pos_View() } } The function is defined as mutating and the element as as @ObservedObject. Anyone has a clue?
Posted
by Heph.
Last updated
.
Post not yet marked as solved
1 Replies
169 Views
I have an app that uses Swift 4.2. I am going to update the Swift Compiler Language to Swift 5. But I have some confusion after my test. I was able to run async/await code when using Xcode 15 with the version set to Swift 4.2, and it was okay. But async/await code was developed in Swift5.5. Why it is okay? Is it related to the Xocde Swift version? And if I use Swift Compiler version 4.2 to run async/await code,what problems might there be ?
Posted
by jayzhuang.
Last updated
.
Post not yet marked as solved
3 Replies
138 Views
I'm implementing a bitonic sort in Metal with a Swift app. This requires 100's kernel dispatch calls for each of the swap stages which touch the whole array, the work required by the GPU is small. I haven't been able to get this to run fast enough in Swift and it seems its due to a high overhead for each dispatchThread command. I rewrote the test program in Objective C with a super-simple kernel function and its runs 25x faster from Objective C! Kernel function kernel void fill(device uint8_t *array [[buffer(0)]], const device uint32_t &N [[buffer(1)]], const device uint8_t &value [[buffer(2)]], uint i [[thread_position_in_grid]]) { if (i < N) { array[i] = value; } } The Swift code is: func fill(pso:MTLComputePipelineState, buffer:MTLBuffer, N: Int, passes: Int) { guard let commandBuffer = commandQueue.makeCommandBuffer() else { return } let gridSize = MTLSizeMake(N, 1, 1) var threadGroupSize = pso.maxTotalThreadsPerThreadgroup if (threadGroupSize > N) { threadGroupSize = N; } let threadgroupSize = MTLSizeMake(threadGroupSize, 1, 1); for pass in 0..<passes { guard let computeEncoder = commandBuffer.makeComputeCommandEncoder() else { return } var value:UInt8 = UInt8(pass); var NN:UInt32 = UInt32(N); computeEncoder.setComputePipelineState(pso) computeEncoder.setBuffer(buffer, offset: 0, index: 0) computeEncoder.setBytes(&NN, length: MemoryLayout<UInt32>.size, index: 1) computeEncoder.setBytes(&value, length: MemoryLayout<UInt8>.size, index: 2) computeEncoder.dispatchThreadgroups(gridSize, threadsPerThreadgroup: threadgroupSize) computeEncoder.endEncoding() } commandBuffer.commit() commandBuffer.waitUntilCompleted() } let device = MTLCreateSystemDefaultDevice()! let library = device.makeDefaultLibrary()! let commandQueue = device.makeCommandQueue()! let funcFill = library.makeFunction(name: "fill")! let pso = try? device.makeComputePipelineState(function: funcFill) var N = 16384 let passes = 100 let buffer = device.makeBuffer(length:N, options: [.storageModePrivate])! for _ in 1...10 { let startTime = DispatchTime.now() fill(pso:pso!, buffer:buffer, N:N, passes:passes) let endTime = DispatchTime.now() let elapsedTime = endTime.uptimeNanoseconds - startTime.uptimeNanoseconds print("Elapsed time:", Float(elapsedTime)/1_000_000, "ms"); } and the Objective C code (which should be almost identical) is void fill(id<MTLCommandQueue> commandQueue, id<MTLComputePipelineState> funcPSO, id<MTLBuffer> A, uint32_t N, int passes) { id<MTLCommandBuffer> commandBuffer = [commandQueue commandBuffer]; MTLSize gridSize = MTLSizeMake(N, 1, 1); NSUInteger threadGroupSize = funcPSO.maxTotalThreadsPerThreadgroup; if (threadGroupSize > N) { threadGroupSize = N; } MTLSize threadgroupSize = MTLSizeMake(threadGroupSize, 1, 1); for(uint8_t pass=0; pass<passes; pass++) { id<MTLComputeCommandEncoder> computeEncoder = [commandBuffer computeCommandEncoder]; [computeEncoder setComputePipelineState:funcPSO]; [computeEncoder setBuffer:A offset:0 atIndex:0]; [computeEncoder setBytes:&N length:sizeof(uint32_t) atIndex:1]; [computeEncoder setBytes:&pass length:sizeof(uint8_t) atIndex:2]; [computeEncoder dispatchThreads:gridSize threadsPerThreadgroup:threadgroupSize]; [computeEncoder endEncoding]; } [commandBuffer commit]; [commandBuffer waitUntilCompleted]; } int main() { NSError *error; id<MTLDevice> device = MTLCreateSystemDefaultDevice(); id<MTLLibrary> library = [device newDefaultLibrary]; id<MTLCommandQueue> commandQueue = [device newCommandQueue]; id<MTLFunction> funcFill = [library newFunctionWithName:@"fill"]; id<MTLComputePipelineState> pso = [device newComputePipelineStateWithFunction:funcFill error:&error]; // Prepare data int N = 16384; int passes = 100; id<MTLBuffer> bufferA = [device newBufferWithLength:N options:MTLResourceStorageModePrivate]; for(int it=1; it<=10; it++) { CFTimeInterval startTime = CFAbsoluteTimeGetCurrent(); fill(commandQueue, pso, bufferA, N, passes); CFTimeInterval duration = CFAbsoluteTimeGetCurrent() - startTime; NSLog(@"Elapsed time: %.1f ms", 1000*duration); } } The Swift output is: Elapsed time: 89.35556 ms Elapsed time: 63.243744 ms Elapsed time: 62.39568 ms Elapsed time: 62.183224 ms Elapsed time: 63.741913 ms Elapsed time: 63.59463 ms Elapsed time: 62.378654 ms Elapsed time: 61.746098 ms Elapsed time: 61.530384 ms Elapsed time: 60.88774 ms The objective C output is 2024-04-18 19:27:45.704 compute_test[3489:92754] Elapsed time: 3.6 ms 2024-04-18 19:27:45.706 compute_test[3489:92754] Elapsed time: 2.6 ms 2024-04-18 19:27:45.709 compute_test[3489:92754] Elapsed time: 2.6 ms 2024-04-18 19:27:45.712 compute_test[3489:92754] Elapsed time: 2.6 ms 2024-04-18 19:27:45.714 compute_test[3489:92754] Elapsed time: 2.7 ms 2024-04-18 19:27:45.717 compute_test[3489:92754] Elapsed time: 2.8 ms 2024-04-18 19:27:45.720 compute_test[3489:92754] Elapsed time: 2.8 ms 2024-04-18 19:27:45.723 compute_test[3489:92754] Elapsed time: 2.7 ms 2024-04-18 19:27:45.726 compute_test[3489:92754] Elapsed time: 2.5 ms 2024-04-18 19:27:45.728 compute_test[3489:92754] Elapsed time: 2.5 ms I compile the Swift code for Release, optimised for speed. I can't believe there should be a difference here, so what could be different, and what might I be doing wrong? thanks Adrian
Posted Last updated
.
Post not yet marked as solved
1 Replies
139 Views
I'm building a Mac OSX Menubar app (build target is 14.0) and need a Settings window as part of it. I define the window as a standalone view in my @main block as follows: struct xyzApp: App { MenuBarExtra { MenubarView() } label: { Label("XYZ", image: "xyz") } .menuBarExtraStyle(.window) Window("Settings", id: "settings-window") { SettingsView() }.windowResizability(.contentSize) } The Settings view looks like this var body: some View { TabView { Form { }.tabItem { Label("Tab1",systemImage: "gear") } Form { }.tabItem { Label("Tab2",systemImage: "gear") } } } } However the Tabview is not being rendered correctly, there's no image and the sizing is wrong I tested the same code on a regular app with a Settings() declaration in the @main block and it works fine. Any points on what I'm doing wrong would be very helpful. Thanks!
Posted Last updated
.
Post not yet marked as solved
2 Replies
218 Views
Hello, I have started using the DragRotationModifier from the Hello World demo project by Apple. I have run into a bug that I can't seem to figure out for the life of me where everything seems to work fine for about 3-5 seconds of moment before it starts rapidly spinning for some reason. I took a video but it looks like I am unable to post any link to outside sources like imgur or youtube so ill try to describe it as best I can: Basically I can spin the sample USDZ Nike Airforce from the Apple sample objects perfectly, but after about 3-5 seconds it seems to rapidly snap between different other rotations and the rotation where the "cursor" is. A couple of additional notes, this only happens when the finger pinch/drag gesture is interacting with the object and this spin only affects the Yaw rotation axis of the object. I created an "Imported Model Entity" wrapper that does some additional stuff when importing a USDZ model similar to the Hello World demo. Then, within a RealityView I create an instance of this ImportedModelEntity and attach the Drag Rotation Modifier to the view like this: RealityView { content in let modelEntity = await ImportedModelEntity(configuration: modelViewModel.modelConfiguration) content.add(modelEntity) self.modelEntity = modelEntity content.add(BoundsVisualizer(bounds: [0.6, 0.6, 0.6])) //Scale object to half of the size of Volume view let bounds = content.convert(geometry.frame(in: .local), from: .local, to: content) let minExtent = bounds.extents.min() modelViewModel.modelConfiguration.scale = minExtent } update: { content in modelEntity?.update(configuration: modelViewModel.modelConfiguration) } .if(modelEntity != nil) { view in view.dragRotation( pitchLimit: .degrees(90), targetEntity: modelEntity!, sensitivity: 10, axRotateClockwise: axRotateClockwise, axRotateCounterClockwise: axRotateCounterClockwise) } For reference here is my ImportedModelEntity: import Foundation import RealityKit class ImportedModelEntity: Entity { // MARK: - Sub-entities private var model: ModelEntity = ModelEntity() private let rotator = Entity() // MARK: - Internal state // MARK: - Initializers @MainActor required init() { super.init() } init( configuration: Configuration ) async { super.init() if(configuration.modelURL == nil) { fatalError("Provided modelURL is NOT valid!!") } //Load the custom model on main thread // DispatchQueue.main.async { do { let input: ModelEntity? = try await ModelEntity(contentsOf: configuration.modelURL!) guard let model = input else { return } self.model = model // let material = SimpleMaterial(color: .green, isMetallic: false) // model.model?.materials = [material] //Add input components model.components.set(InputTargetComponent()) model.generateCollisionShapes(recursive: true) // Add Hover Effect model.components.set(HoverEffectComponent()) //self.model.components.set(GroundingShadowComponent(castsShadow: configuration.castsShadow)) // Add Rotator self.addChild(rotator) // Add Model to rotator rotator.addChild(model) } catch is CancellationError { // The entity initializer can throw this error if an enclosing // RealityView disappears before the model loads. Exit gracefully. return } catch let error { print("Failed to load model: \(error)") } // } update(configuration: configuration) } //MARK: - Update Handlers func update( configuration: Configuration) { rotator.orientation = configuration.rotation move(to: Transform( scale: SIMD3(repeating: configuration.scale), rotation: orientation, translation: configuration.position), relativeTo: parent) } } Any help is greatly appreciated!
Posted Last updated
.
Post not yet marked as solved
25 Replies
21k Views
We are working on a new iOS application utilizing the new iOS 17 APIs, and I have updated Xcode to Xcode 15 Beta, and my iPhone 12 Pro to iOS 17 Beta 2, though this issue was also present on iOS 17 Beta 1. In Xcode, for "Signing and Capabilities" I have my Team set to my personal team, utilizing the "Automatically manage signing" tick. While the app will build and install on my phone, I immediately receive this error, with no popup to trust the developer. Going to Settings > General > VPN and Device Management, I can see my Development Team, and I am able to Trust my team. When trying to then Verify App(s), it tells me it will use my internet connection to verify the application. However, it will then do nothing, with no error, regardless of how many times I attempt to verify. Trying to open the app from my home screen will result in the repeated "Unable to Verify Error". Trying to reset network settings does not result in any change in this behavior, nor does a reset of the phone. I have tried 4 different high quality WiFi networks, as well as a fully connection AT&T cellular LTE connection, and still receive this error. I am running out of diagnostic scenarios, and I'm curious if anyone has found a resolution to this?
Posted
by covt.
Last updated
.
Post not yet marked as solved
2 Replies
127 Views
I'm developing an application using SwiftUI and SwiftData. The app includes a pricing section, and I'd like it to have an initial default value for pricing. Additionally, when updating the app on the App Store, I also want to update the prices. However, I'd like users to have the option to create their own prices if they don't want to use the ones I suggest. I want to save these prices obtained from the user because I'll be using these values for some operations later on. I'm wondering how to achieve this. Should I use SwiftData or UserDefaults for managing the data, or should I save the prices to a JSON file? If I opt for saving to a JSON file, would it be possible to update the JSON file when updating the app? Please feel free to ask any questions. Thank you in advance for your responses.
Posted Last updated
.
Post not yet marked as solved
0 Replies
122 Views
Hey, im training an MLImageClassifier via the train()-method: guard let job = try? MLImageClassifier.train(trainingData: trainingData, parameters: modelParameter, sessionParameters: sessionParameters) else{ debugPrint("Training failed") return } Unfortunately the metrics of my MLProgress, which is created from the returning MLJob while training are empty. Code for listening on Progress: job.progress.publisher(for: \.fractionCompleted) .sink{[weak job] fractionCompleted in guard let job = job else { debugPrint("failure in creating job") return } guard let progress = MLProgress(progress: job.progress) else { debugPrint("failure in creating progress") return } print("ProgressPROGRESS: \(progress)") print("Progress: \(fractionCompleted)") } .store(in: &subscriptions) Printing the Progress ends in: MLProgress(elapsedTime: 2.2328420877456665, phase: CreateML.MLPhase.extractingFeatures, itemCount: 32, totalItemCount: Optional(39), metrics: [:]) Got the Same result when listening to MLCheckpoints, Metrics are empty aswell: MLCheckpoint(url: URLPATH.checkpoint, phase: CreateML.MLPhase.extractingFeatures, iteration: 32, date: 2024-04-18 11:21:18 +0000, metrics: [:]) Can some1 tell me how I can access the metrics while training? Thanks!
Posted Last updated
.
Post not yet marked as solved
1 Replies
144 Views
Hello, I have RouteManage, which is a Class and has following Protokolls: NSObject, Codable ,ObservableObject and is an Singleton and I have a RouteTrackingAttributes which has ActivityAttributes I tried to set let attributes = RouteTrackingAttributes() let state = RouteTrackingAttributes.ContentState(routeManager: routeManger) activity = try? Activity.request() the update from singleton. But it dosen't work. It worked only once? thank you for help greeting Fabian
Posted Last updated
.
Post not yet marked as solved
0 Replies
146 Views
Hi, In Windows and Linux, it's possible to ask a printer to print content programmatically in Black & White. This may be referred to as "Monochrome", "Grayscale", "B&W", depending on the device driver. For feature parity with other operating systems, I'd like to do the same -- programmatically -- in macOS using Objective-C or Swift. Is this possible? If not, what's the best, formal way to request this useful OS feature to Apple so that it may be added in a future release? More context about this request: https://github.com/openjdk/jdk/pull/18195
Posted
by tresf.
Last updated
.
Post not yet marked as solved
0 Replies
132 Views
I asked this on StackOverflow too, but did not get a response. Copying verbatim (images might not work as expected). Short question: which instructions other than floating point arithmetic instructions like fmul, fadd, fdiv etc are counted under the hardware event INST_SIMD_ALU in XCode Instruments? Alternatively, how can I count the number of floating point operations in a program using CPU counters? I want to measure/estimate the FLOPs count of my program and thought that CPU counters might be a good tool for this. The closest hardware event mnemonic that I could find is INST_SIMD_ALU, whose description reads. Retired non-load/store Advanced SIMD and FP unit instructions So, as a sanity check I wrote a tiny Swift code with ostensibly predictable FLOPs count. let iterCount = 1_000_000_000 var x = 3.1415926 let a = 2.3e1 let ainv = 1 / a // avoid inf for _ in 1...iterCount { x *= a x += 1.0 x -= 6.1 x *= ainv } So, I expect there to be around 4 * iterCount = 4e9 FLOPs. But, on running this under CPU Counters with the event INST_SIMD_ALU I get a count of 5e9, 1 extra FLOP per loop iteration than expected. See screenshot below. dumbLoop is the name of the function that I wrapped the code in. Here is the assembly for the loop +0x3c fmul d0, d0, d1 <---------------------------------- +0x40 fadd d0, d0, d2 | +0x44 fmov d4, x10 | +0x48 fadd d0, d0, d4 | +0x4c fmul d0, d0, d3 | +0x50 subs x9, x9, #0x1 | +0x54 b.ne "specialized dumbLoop(_:initialValue:)+0x3c" --- Since it's non-load/store instructions, it shouldn't be counting fmov and b.ne. That leaves subs, which is an integer subtraction instruction used for decrementing the loop counter. So, I ran two more "tests" to see if the one extra count comes from subs. On running it again with CPU Counters with the hardware event INST_INT_ALU, I found a count of one billion, which adds up with the number of loop decrements. Just to be sure, I unrolled the loop by a factor of 4, so that the number of loop decrements becomes 250 million from one billion. let iterCount = 1_000_000_000 var x = 3.1415926 let a = 2.3e1 let ainv = 1 / a // avoid inf let n = Int(iter_count / 4) for _ in 1...n { x *= a x += 1.0 x -= 6.1 x *= ainv x *= a x += 1.0 x -= 6.1 x *= ainv x *= a x += 1.0 x -= 6.1 x *= ainv x *= a x += 1.0 x -= 6.1 x *= ainv } print(x) And it adds up, around 250 million integer ALU instructions, and the total ALU instructions is 4.23 billion, somewhat short of the expected 4.25 billion. So, at the moment if I want to count the FLOPs in my program, one estimate I can use is INST_SIMD_ALU - INST_INT_ALU. But, is this description complete, or are there an other instructions that I might spuriously count as floating point operations? Is there a better way to count the number of FLOPs?
Posted
by cku.
Last updated
.
Post not yet marked as solved
1 Replies
145 Views
Following the recent 17.4.1 update, while QR code scanning has been resolved, we're still experiencing problems with barcode scanning on iPad devices. Specifically, the AVCaptureMetadataOutput delegate is not functioning as expected. This issue is significantly impacting our application's functionality. We kindly request immediate attention to this matter to ensure seamless operation.
Posted
by devtatva.
Last updated
.
Post not yet marked as solved
0 Replies
134 Views
Within Xcode when initializing the client via code below, do I insert this code in my app declaration Swift file or can it be just another Swift file included in my app? Thanks! let client = Graph.Client( shopDomain: "your-shop-name.myshopify.com", apiKey: "your-storefront-access-token", locale: Locale(identifier: "en_US") )
Posted Last updated
.
Post not yet marked as solved
1 Replies
150 Views
Hi Folks, I would like it so that when I press the button on the HomeScreen, the TabView hides and the toolbar item appears in its place. Currently, the toolbar item stacks on top of the TabView. However, when I try to hide the TabView, with an if condition for example, the screens turn black. I think it's because of the screen calls in the TabView. Is there an option to achieve what I want? I'm new to SwiftUI, so I'm very glad for any Solutions or advices. struct NavBar: View { var body: some View { TabView { HomeScreen() .tabItem { Label( "Home", systemImage: "house" ) } ... } } } struct HomeScreen: View { @State private var showDeleteButton = false var body: some View { Button("Show/Dissmiss Delete Button", action: { showDeleteButton.toggle() }).toolbar { if showDeleteButton { ToolbarItem(placement: .bottomBar) { Button("Delete", action: {}) } } } } }
Posted Last updated
.