Post

Replies

Boosts

Views

Activity

Reply to Can SwiftUI View Receive a Call When Window Will Close?
import SwiftUI struct ContentView: View { var body: some View { VStack { Text("Hello, world!") } .windowResizeBehavior(.disabled) .windowMinimizeBehavior(.disabled) //.windowDismissBehavior(.disabled) .onReceive(NotificationCenter.default.publisher(for: NSWindow.willCloseNotification), perform: { _ in print("Window will close") }) } } I guess calling NSWindow.willCloseNotification with .onReceive will do it.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’25
Reply to Projecting a Cube with a Number in ARKit
Thank you for your kind assistance, Vision Pro Engineer. No. 1, it seems that NSAttributedString.Key.backgroundColor has nothing to do with my issue. No. 2, I think you only suggest that I change the modelEntity.model?.materials line as follows. modelEntity.model?.materials = [unlitMaterial] into modelEntity.model?.materials = [material, unlitMaterial] Yes, I do get a material color other than black with or without NSAttributedString.Key.backgroundColor. I then lose the text material. So the text number is MIA. func placeObject(at position: SIMD3<Float>) { let mesh = MeshResource.generateBox(size: 0.3) let material = SimpleMaterial(color: UIColor.systemRed, roughness: 0.3, isMetallic: true) let modelEntity = ModelEntity(mesh: mesh, materials: [material]) var unlitMaterial = UnlitMaterial() if let textureResource = generateTextResource(text: "1", textColor: UIColor.white) { unlitMaterial.color = .init(tint: .white, texture: .init(textureResource)) modelEntity.model?.materials = [material, unlitMaterial] let id = UUID().uuidString modelEntity.name = id modelEntity.transform.scale = [0.3, 0.1, 0.3] modelEntity.generateCollisionShapes(recursive: true) let anchorEntity = AnchorEntity(world: position) anchorEntity.addChild(modelEntity) self.scene.addAnchor(anchorEntity) } } func generateTextResource(text: String, textColor: UIColor) -> TextureResource? { if let image = text.image(withAttributes: [NSAttributedString.Key.foregroundColor: textColor, NSAttributedString.Key.backgroundColor: UIColor.clear], size: CGSize(width: 18, height: 18)), let cgImage = image.cgImage { let textureResource = try? TextureResource(image: cgImage, options: TextureResource.CreateOptions.init(semantic: nil)) return textureResource } return nil }
Topic: Spatial Computing SubTopic: ARKit Tags:
Jun ’25
Reply to how to change the textfield background on click focused
The background color is there. But you are not giving much room around the TextField guy to show the focus effect. I would use the border guy instead of the background guy. struct ContentView: View { @FocusState private var focus: Bool @State private var text: String = "" var body: some View { ZStack { VStack { TextField("Enter phone number", text: $text) .focused($focus) .font(.system(size: 36.0)) .border(focus ? Color.yellow : Color.clear) .textFieldStyle(.roundedBorder) .padding() } } } } or struct ContentView: View { @FocusState private var focus: Bool @State private var text: String = "" var body: some View { ZStack { VStack { TextField("Enter phone number", text: $text) .focused($focus) .font(.system(size: 36.0)) .textFieldStyle(.roundedBorder) .padding() .background(focus ? .blue : .clear) } } } }
Topic: UI Frameworks SubTopic: SwiftUI
Jul ’25
Reply to Dealing with IAP Purchase Restore
Sure, App Review. I thank you. I don't have a problem and will submit changes if you kindly tell me that there may be a situation where they need to restore whatever they need without history of purchases. For now, I don't see it. And the reviewer or the appeals board doesn't give me a reason why they need to restore what. Again, I don't know what they are trying to restore.
Aug ’25
Reply to Dealing with IAP Purchase Restore
Thank you, App Review and Apple Appeals Board. The app in question has been approved. I'm taken by a surprise because there was a bitter time when Appeals Board used to take the side of the reviewer without questions and because I was ready to abandon this software submission. I don't know if the reviewer has changed his or her mind this time or if the Appeals Board has made their decision for me.
Aug ’25
Reply to Am I allowed to use FFMPEG and FFPROBE binaries in Mac App Store?
I kind of remember that I had several applications running an FFMPEG command-line app submitted to Mac App Store some 14 years ago. In the meantime, you are not specific about your development platform, making ambiguous statements like "MacOs" and "AppStore." So which is it? Is it an iOS app or macOS application? Anyway, if you are not sure if your macOS submission does not abide by Mac App Store review guidelines, you can have your users download the command-line tool and install it on their own. I would search for 'DVD rip' at Mac App Store.
Aug ’25
Reply to Constraining Beacon with CLBeaconIdentityCondition
I get it. The Swift equivalent of CLBeaconIdentityCondition is CLMonitor.BeaconIdentityCondition.
Replies
Boosts
Views
Activity
Jun ’25
Reply to Can SwiftUI View Receive a Call When Window Will Close?
import SwiftUI struct ContentView: View { var body: some View { VStack { Text("Hello, world!") } .windowResizeBehavior(.disabled) .windowMinimizeBehavior(.disabled) //.windowDismissBehavior(.disabled) .onReceive(NotificationCenter.default.publisher(for: NSWindow.willCloseNotification), perform: { _ in print("Window will close") }) } } I guess calling NSWindow.willCloseNotification with .onReceive will do it.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to Projecting a Cube with a Number in ARKit
Thank you for your kind assistance, Vision Pro Engineer. No. 1, it seems that NSAttributedString.Key.backgroundColor has nothing to do with my issue. No. 2, I think you only suggest that I change the modelEntity.model?.materials line as follows. modelEntity.model?.materials = [unlitMaterial] into modelEntity.model?.materials = [material, unlitMaterial] Yes, I do get a material color other than black with or without NSAttributedString.Key.backgroundColor. I then lose the text material. So the text number is MIA. func placeObject(at position: SIMD3<Float>) { let mesh = MeshResource.generateBox(size: 0.3) let material = SimpleMaterial(color: UIColor.systemRed, roughness: 0.3, isMetallic: true) let modelEntity = ModelEntity(mesh: mesh, materials: [material]) var unlitMaterial = UnlitMaterial() if let textureResource = generateTextResource(text: "1", textColor: UIColor.white) { unlitMaterial.color = .init(tint: .white, texture: .init(textureResource)) modelEntity.model?.materials = [material, unlitMaterial] let id = UUID().uuidString modelEntity.name = id modelEntity.transform.scale = [0.3, 0.1, 0.3] modelEntity.generateCollisionShapes(recursive: true) let anchorEntity = AnchorEntity(world: position) anchorEntity.addChild(modelEntity) self.scene.addAnchor(anchorEntity) } } func generateTextResource(text: String, textColor: UIColor) -> TextureResource? { if let image = text.image(withAttributes: [NSAttributedString.Key.foregroundColor: textColor, NSAttributedString.Key.backgroundColor: UIColor.clear], size: CGSize(width: 18, height: 18)), let cgImage = image.cgImage { let textureResource = try? TextureResource(image: cgImage, options: TextureResource.CreateOptions.init(semantic: nil)) return textureResource } return nil }
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Jun ’25
Reply to Projecting a Cube with a Number in ARKit
Thank you for your kind help, Vision Pro Engineer. With the lines of code you have provided, I get the following cube, which is quite close to what I need. What I want to have is a cube with a number on each surface. I guess that's cannot be achieved.
Topic: Spatial Computing SubTopic: ARKit Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to Rejected from Apple 43(b)
What's 43(b)? You mean, 4.3 (b)?
Replies
Boosts
Views
Activity
Jul ’25
Reply to how to change the textfield background on click focused
The background color is there. But you are not giving much room around the TextField guy to show the focus effect. I would use the border guy instead of the background guy. struct ContentView: View { @FocusState private var focus: Bool @State private var text: String = "" var body: some View { ZStack { VStack { TextField("Enter phone number", text: $text) .focused($focus) .font(.system(size: 36.0)) .border(focus ? Color.yellow : Color.clear) .textFieldStyle(.roundedBorder) .padding() } } } } or struct ContentView: View { @FocusState private var focus: Bool @State private var text: String = "" var body: some View { ZStack { VStack { TextField("Enter phone number", text: $text) .focused($focus) .font(.system(size: 36.0)) .textFieldStyle(.roundedBorder) .padding() .background(focus ? .blue : .clear) } } } }
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Jul ’25
Reply to Waiting for Review for 72+ hours
I’m wondering if it fell through the cracks? It has never happened in the past 15 years or so to my knowledge. The only reason that I can think of as to why they delay in reviewing software submissions is that some of them are working on reviewing iOS or macOS updates.
Replies
Boosts
Views
Activity
Aug ’25
Reply to Dealing with IAP Purchase Restore
Sure, App Review. I thank you. I don't have a problem and will submit changes if you kindly tell me that there may be a situation where they need to restore whatever they need without history of purchases. For now, I don't see it. And the reviewer or the appeals board doesn't give me a reason why they need to restore what. Again, I don't know what they are trying to restore.
Replies
Boosts
Views
Activity
Aug ’25
Reply to CIBumpDistortion filter not working on my view
I don't see a line where you actually produce an output file. To my knowledge, you only produce an output image when you use CIFilter. Then you should apply one to your layer or whatever. That's not what you are doing.
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Dealing with IAP Purchase Restore
Thank you, App Review and Apple Appeals Board. The app in question has been approved. I'm taken by a surprise because there was a bitter time when Appeals Board used to take the side of the reviewer without questions and because I was ready to abandon this software submission. I don't know if the reviewer has changed his or her mind this time or if the Appeals Board has made their decision for me.
Replies
Boosts
Views
Activity
Aug ’25
Reply to Am I allowed to use FFMPEG and FFPROBE binaries in Mac App Store?
I kind of remember that I had several applications running an FFMPEG command-line app submitted to Mac App Store some 14 years ago. In the meantime, you are not specific about your development platform, making ambiguous statements like "MacOs" and "AppStore." So which is it? Is it an iOS app or macOS application? Anyway, if you are not sure if your macOS submission does not abide by Mac App Store review guidelines, you can have your users download the command-line tool and install it on their own. I would search for 'DVD rip' at Mac App Store.
Replies
Boosts
Views
Activity
Aug ’25
Reply to Unexpected shape around a GlassProminentButtonStyle button with safeAreaBar in NavigationStack
What happens if you apply the corner radius to your button guy?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Certificate not showing under "My Certificates" in Keychain (no private key attached)
That's because you have selected 'System' as opposed to 'login' on the sidebar?
Replies
Boosts
Views
Activity
Sep ’25