Overview

Post

Replies

Boosts

Views

Activity

Intrinsic content/system fitting size not propagating up to hosting controller.
Overview I have the following view hierarchy that mixes SwiftUI and UIKit: AccordionView └─ VStack ├─ Text ├─ Button └─ UIViewRepresentable └─ UIStackView ├─ UILabel └─ UILabel When tapping the button, the UIViewRepresentable hides and shows its content. This all works as expected. However, in certain circumstances the view's sizing is rendered with the correct size, but the text can often render incorrectly, despite the frame seemingly looking as though it has enough room to render the text. More info Below you can see the UILabel has the correct frame height (the light grey background and coloured borders) but the text is rendered as though it has infinite width along one line. There's a few configurations of my view hierarchy that seem to have this effect. I've added a playground to the bottom of this post of various configurations to show what does and doesn't work, just copy and paste to see for yourself... It seems of the ones that don't work, there's a couple of reasons why that may be: HostedView and TextViewContainer do not do the following (I think we only need to do one of these things for auto layout/stack views to work effectively): a) implement an intrinsic content size b) return a 'good' size for systemLayoutSizeFitting(). UIHostingController shouldn't use intrinsic size (although I'm sure it should) Something related to setting setContentCompressionResistancePriority() or setContentHuggingPriority() but having played about with this it doesn't seem relevant here... I've played around with everything I can think of here but can't find a solution that works for all, although I'm 99% sure it's one or all of the points above. If there are any UIKit gurus out there that can help that would be great! Ive already spent so much time on this 🫨 Playground Swift Playground
0
0
118
2w
🎧Define if headphones is only playing device for current session
I need to apply headphone-specific scenario only when headphones are the sole active playback device in my iOS audio app. Problem that there is no absolute way to definitively understand that headphones are the sole active playback device AVAudioSession.currentRoute.outputs portTypes don't guarantee headphones: let session = AVAudioSession.sharedInstance() let outputs = session.currentRoute.outputs let headphonesOnly = outputs.count == 1 && (outputs.first?.portType == .headphones || outputs.first?.portType == .bluetoothA2DP || outputs.first?.portType == .bluetoothHFP || outputs.first?.portType == .bluetoothLE) The issue in code above that listed bluetooth profiles (A2DP, HFP, LE) can be used by any audio device, not only headphones Is there any public API on iOS that can: Distinguish Bluetooth headphones vs Bluetooth speakers when both use A2DP/LE? Expose the user’s “Device Type” classification (headphones / speaker / car stereo, etc.) that is shown in Settings → Bluetooth → Device Type? Provide a more reliable way to know “this route is definitely headphones” for A2DP devices, beyond portType and portName string heuristics?
0
0
91
3w
Unable to register with ADP
I attempted to register with ADP from the developer app. After entering my driver's license, address, and name, a pop-up appeared stating “There may be an issue with your account.” Subsequently, the “Register Now” button for ADP within the app became inactive. What could this account issue be? I would like to know how to proceed with registering with ADP.
0
0
12
2w
Need assistance preventing renewals for inactive promotional trial subscriptions
Can anyone advise on this? We distributed promotional trial codes for our app Ask Dolly. These 1-month free trials are set to renew and charge users in March 2026. A segment of users redeemed the promo codes but never created accounts or opened the app. We don't have their contact information to notify them. Our CEO has directed us to prevent these inactive subscriptions from renewing to avoid charging users who never engaged with the service. We've downloaded the Subscription and Offer Code Redemption reports from App Store Connect, but cannot map Apple's Subscriber IDs to our user database (we only store Transaction IDs). This prevents us from identifying which specific subscriptions to cancel. What We Need: Assistance preventing renewals for promotional subscriptions where users have had zero app sessions/opens as of the end of February. These trials will start to renew on March 3, 2026. We need to resolve this before then to avoid charging inactive users. Can you help us either: Cancel subscriptions associated with promo codes that show zero app engagement, or Provide guidance on how to programmatically identify and cancel these subscriptions?
0
0
58
2w
In "Learning Programming 2", I can't use "world.place"
I'm trying the "Connect and Solve" course of Swift Playground. I can't use "world.place" to place bricks at positions (2, 2), (6, 2) (automatically disappear), but I can place bricks at positions (4, 2) in the same way. Two bricks must be placed overlapping in positions (2, 2) and (6, 2) to achieve the goal. Only when a brick is placed in position (4, 2) can the goal be achieved. The problem is that the bricks placed on (6, 2) and (2, 2) will disappear and cannot be placed successfully. The following is my code writing... let Block1 = Block() for i in 1 ... 2 { world.place(Block1, atColumn: 2, row: 2) } for i in 1 ... 2 { world.place(Block1, atColumn: 6, row: 2) } world.place(Block1, atColumn: 4, row: 2) func turnaround() { turnRight() turnRight() } func walk4() { for i in 1 ... 3 { moveForward() } } func collet() { for i in 1 ... 2 { moveForward() } toggleSwitch() turnRight() walk4() collectGem() turnaround() walk4() turnRight() } for i in 1 ... 3 { collet() } ‌I would appreciate it if someone could offer some recommendations.‌ ‌Thanks a lot‌
0
0
77
2w
Memory leak in CarPlay when using CPListImageRowItem
Memory leak in CarPlay when using CPListImageRowItem. The following behavior was observed in the CPListTemplate class when using CPListImageRowItem: If a CPListImageRowItem cell is inserted into the screen, the screen starts to leak, even if it contains no elements (CPListImageRowItem(titleList: nil, imagesRow: [], titlesRow: []). Replacing CPListImageRowItem with CPListItem stops the leak. Using the new initializer for iOS 26 does not correct the issue; the screen still leaks. Class reference: https://developer.apple.com/documentation/carplay/cplistimagerowitem
0
0
62
2w
Unable to use Testflight email invite properly
I have a tester who switched phones a few months back. Crucially he no longer has access to the old phone. On his new phone when I send him a test flight invite to his apple account, 123@example, he receives it but it fails to work when he clicks the link. He is getting the following message. The Apple account (123@example) you're currently signed in with does not match the one (456@example) associated with this invitation. He has no idea what email 456 is. Since his old phone was a hand me down, I'm assuming it's someone else's email entirely. I'm trying to figure out how we clear this association out. I tried deleting his app store connect for my app and reinviting him all the way from the beginning. This did not work. As a stopgap I'm giving him a public link under an external testing group but I'd really like to not have to do that. Anyone have any ideas how we can fix this so I can shift him back to the Internal testing group?
0
0
130
2w
Cannot apply new apps because of..? No idea
I get this message in my account: Developer Information Update In Process Note: Your developer information update is currently in process. Until it’s complete, the updated Program License Agreement may not go into effect. Why and what is going on is not clear, nothing has changed really. All accountdetails are applied and approved. Any idea what is going on and how to speed this "process" up?
0
0
173
3w
NSTableCellView does not colour its background correctly
In an NSTableView (Appkit), I need to colour a cell background when it is selected. That works OK, except that the colour does not span the full cell width, nor even the text itself: The tableView structure is very basic: I see there is a TextCell at the end that cannot be deleted. What is this ? And the colouring as well: func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { let p = someDataSource[row] if let cellView = tableView.makeView(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "Cell"), owner: self) { (cellView as! NSTableCellView).textField?.stringValue = p if selected[row] { (cellView as! NSTableCellView).backgroundColor = theLightBlueColor } else { (cellView as! NSTableCellView).backgroundColor = .clear } return cellView } } I've tried to change size constraints in many ways, to no avail. For instance, I changed Layout to Autoresising : I tried to change TableCellView size to 170 vs 144: Or increase tableColum Width. I have looked at what other object in the NSTableView hierarchy should be coloured without success. Nothing works. What am I missing ?
Topic: UI Frameworks SubTopic: AppKit Tags:
0
0
91
2w
Charged for Apple Developer Program but order shows Cancelled and no refund received
Hello, I recently purchased the Apple Developer Program 1-Year Membership. Order Number: W1626930340 Order Date: February 16, 2026 Amount Charged: THB 3,590 My bank account was successfully charged, and I received a payment confirmation email. However, when I checked my order status, it shows "Cancelled" and says the item was discontinued and no invoice will be sent. I have not received any refund yet. Could someone please help explain why this happened and how I can get my refund or resolve this issue? Thank you very much.
0
0
54
2w
How to get accurate Mouse/Trackpad deltas on macOS when using CGWarpMouseCursorPosition?
I am working on a remote control application for macOS where I need to maintain two "virtual" cursors: Remote Cursor: Follows the remote user's movements. Local Cursor: Follows the local user's physical mouse/trackpad movements. To move the system cursor (for the remote side), I use CGWarpMouseCursorPosition as follows: void DualCursorMac::UpdateSystemCursorPosition(int x, int y) { CGPoint point = CGPointMake(static_cast<CGFloat>(x), static_cast<CGFloat>(y)); // Warp the cursor to match remote coordinates CGWarpMouseCursorPosition(point); } Meanwhile, I use a CGEventTap to monitor local physical movements to update my local virtual cursor's UI: CGEventRef Mouse::MouseTapCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon) { if (remoteControlMode) { // We want to suppress system cursor movement but still read the delta const int deltaX = static_cast<int>(CGEventGetIntegerValueField(event, kCGMouseEventDeltaX)); const int deltaY = static_cast<int>(CGEventGetIntegerValueField(event, kCGMouseEventDeltaY)); NSLog(@"MouseTapCallback: delta:(%d, %d)", deltaX, deltaY); // Update local virtual cursor UI based on deltas... return nullptr; // Consume the event } return event; } The Problem: When CGWarpMouseCursorPosition is called frequently to update the system cursor, it interferes with the kCGMouseEventDeltaX/Y values in the Event Tap. Specifically, if the local user moves the trackpad slowly (expecting deltas of 1 or 2), but a "Warp" occurs simultaneously (e.g., jumping the cursor from (100, 100) to (300, 300)), the deltaX and deltaY in the callback suddenly spike to very large values. It seems the system calculates the delta based on the new warped position rather than the pure physical displacement of the trackpad. This makes the local virtual cursor "jump" erratically and makes it impossible to track smooth local movement during remote control. My Question: Is there a way to get the "raw" or "pure" physical relative movement (delta) from the trackpad/mouse that is independent of the system cursor's absolute position or warping? Are there alternative APIs (perhaps IOKit or different CGEvent fields) that would allow me to get consistent deltas even when the cursor is being warped programmatically?
0
0
188
2w
Basics - Dice Demo, calculate total score
I've worked through Apple's dice demo for SwiftUI, so far so good. I've got a single Die view with a button to "roll" the die. This works perfectly using the code below: struct DieView: View { init(dieType: DieType) { self.dieValue = Int.random(in: 1...dieType.rawValue) self.dieType = dieType } @State private var dieValue: Int @State private var dieType: DieType var body: some View { VStack { if self.dieType == DieType.D6 { Image(systemName: "die.face.\(dieValue)") .resizable() .frame(width: 100, height: 100) .padding() } else {//self.dieType == DieType.D12{ Text("\(self.dieValue)") .font(.largeTitle) } Button("Roll"){ withAnimation{ dieValue = Int.random(in: 1...dieType.rawValue) } } .buttonStyle(.bordered) } Spacer() } } Now I want to do a DiceSetView with an arbitrary number of dice. I've got the UI working with the following; struct DiceSetView: View { @State private var totalScore: Int = 0 var body: some View { ScrollView(.horizontal) { HStack{ DieView(dieType: DieType.D6) DieView(dieType: DieType.D6) DieView(dieType: DieType.D6) } } HStack{ Button("Roll All"){} .buttonStyle(.bordered) Text("Score \(totalScore)") .font(.callout) } Spacer() } } Where I'm struggling is how to get the total of all the dice in a set and to roll all the dice in a set on a button click. I can't iterate through the dice, and just "click" the buttons in the child views from their parents, and I can't think how it should be structured to achieve this (I'm new to this style of programming!) - can anyone point me in the right direction for how to achieve what I want? I realise that I'm probably missing something fundamentally conceptual here....
Topic: UI Frameworks SubTopic: SwiftUI
0
0
28
3w
Developer Program Payment Taken but Account Still Pending – No Support Response
I have been trying to enroll in the Apple Developer Program for the past two weeks, but I keep encountering different errors. Most of the time, I receive a 404 error page saying, “Something went wrong. Try again.” Three days ago, $100 was deducted from my bank account by Apple, but my developer account status still shows “Pending.” Apple states that “Your purchase may take up to 48 hours to process,” but it has now been more than 48 hours and there has been no update. I have already: Sent an email to devpayment @apple.com with screenshots and full details (no response). Opened a case through Apple Developer Program Support and only received an automated reply saying, “Thank you for contacting us.” At this point, it feels like there is no real support available to resolve this issue. Has anyone experienced something similar? How did you resolve it? Thank you.
0
0
66
3w
VoiceOver with Swift Charts summaries
I had a VoiceOver user point out an issue with my app that I’ve definitely known about but have never been able to fix. I thought that I had filed feedback for it but it looks like I didn’t. Before I do I’m hoping someone has some insight. With Swift Charts when I tap part of a chart it summarizes the three hours and then you can swipe vertically to hear it read out details of each hour. For example, the Y-Axis is the amount of precipitation for the hour and the X-Axis is the hours of the day. The units aren't being read in the summary but they are for individual hours when you vertical swipe. The summary says something such as "varies between 0.012 and 0.082". In the AXChartDescriptor I’ve tried everything I can think of, including adding a label to the Y axis in the DataPoint but nothing seems to work in getting that summary to include units. With a vertical swipe it seems to just be using my accessibility label and value (like I would expect).
0
0
178
3w
Domain blocking
Hello, why is Safari blocking my domains? https://fitgel.ru https://fittoma.ru https://ohota.pro There are no errors in them, other browsers respond normally.
Topic: Safari & Web SubTopic: General
0
0
175
3w
NavigationTitle in LiquidGlass style
Hello everyone. I want to do navigationTitle (located on the top side on MacOS system) in LiquidGlass style. now my solution look like: just black rectangle. But i want like this: opacity and LiquidGlass. Like in Photo app in MacOS. Please help me, thank you in advance. My code: struct RootView: View { @Environment(\.horizontalSizeClass) var hSize var body: some View { if hSize == .regular { DesktopLayout() .navigationTitle("title") .toolbarBackground(.ultraThinMaterial, for: .automatic) } else { MobileLayout() } } }
0
0
420
3w