Post

Replies

Boosts

Views

Activity

TestFlight for Mac: review required every single time a new build is pushed?
So I've started using TestFlight for Mac but unlike its iOS counterpart, it seems like every single build uploaded and pushed to testers has to be reviewed by Apple. This is not how that works on the iOS side. Ex: MyApp 4.1 build 1 -> Review required for both iOS and Mac MyApp 4.1 build 2 -> Review required for Mac, not iOS Is this a bug or by design? If so, this is crazy!
0
0
664
Nov ’21
Context menus, alerts, popovers and tips do not respect preferred color scheme
It seems like some UI elements just don't use the preferred color scheme of their parent element: import SwiftUI struct ContentView: View { var body: some View { VStack { Button("Hold Me") { } .contextMenu(ContextMenu(menuItems: { Button("I should be dark") { } })) } .padding() .preferredColorScheme(.dark) } } If you set the device appearance to dark, then the context menu shows the correct color scheme. Setting .preferredColorScheme(.dark) to Button directly doesn't help. Aside from context menus, this applies to all sorts of elements: popovers, alerts, tips, ... Is there a workaround for this? Apple folks: FB13391355
0
0
655
Nov ’23
IAP rejected (Guideline 2.1) while binary waiting for review?
That's a new one for me. I have submitted 2 IAP along with an update for my app. The Mac binary was approved but then one of the IAP was rejected with this message: "We have returned your IAP product/s to you as the required binary was not submitted. When you are ready to submit the binary, please resubmit the IAPs with the binary." I'm not sure what this means as the related binary is actually waiting for review. What does this error means and how can I fix it?
0
0
657
Dec ’23
Transaction.currentEntitlements never returns if there are no entitlements?
I'm uncertain about the reason behind Transaction.currentEntitlements not returning nil when there are no current entitlements. The challenge I'm facing is that, in the scenario where a trial period concludes, Transaction.currentEntitlements seems to perpetually withhold any response, leaving me without a means to discern the conclusion of the trial. I'm puzzled as to why this method doesn't simply return nil when no entitlements are detected. It would be immensely helpful if someone could shed light on the rationale behind this behavior or point out any potential errors in my understanding. Your insights would be greatly appreciated. Thanks.
0
0
718
Dec ’23
Glass effect on a stroke
I'm trying to apply a glass effect on a circle stroke but all it does is apply it to the circle itself and not the stroke: import SwiftUI let kCarouselCircleSize: CGFloat = 150 let kCarouselOpacity: Double = 0.3 let kCarouselStrokeWidth: CGFloat = 60 struct ContentView: View { @State var showing = false var body: some View { VStack(spacing: 60) { Text("ultraThinMaterial:") .font(.title) CarouseCircle(drawProgress: 0.7, isActive: false) Text("glassEffect()") .font(.title) CarouseCircle(useGlassEffect: true, drawProgress: 0.7, isActive: false) } .background(content: { Image(.background2) }) .padding() } } struct CarouseCircle: View { var size: CGFloat = kCarouselCircleSize var strokeWidth: CGFloat = kCarouselStrokeWidth var useGlassEffect: Bool = false var drawProgress: CGFloat var isActive: Bool var body: some View { if useGlassEffect { Circle() .trim(from: 0, to: drawProgress) .fill(.clear) .stroke(.blue, style: StrokeStyle(lineWidth: strokeWidth, lineCap: .round)) .frame(width: size, height: size) .glassEffect() .shadow(color: .black.opacity(kCarouselOpacity), radius: isActive ? 4 : 1, x: 0, y: 0) .rotationEffect(.degrees(-90)) // Start drawing at button 1's position } else { Circle() .trim(from: 0, to: drawProgress) .fill(.clear) .stroke(.ultraThinMaterial, style: StrokeStyle(lineWidth: strokeWidth, lineCap: .round)) .frame(width: size, height: size) .shadow(color: .black.opacity(kCarouselOpacity), radius: isActive ? 4 : 1, x: 0, y: 0) .rotationEffect(.degrees(-90)) // Start drawing at button 1's position } } } Here's the result: Is this supported, a bug or something I'm doing wrong?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
0
0
157
Jul ’25
onDrag conflicts with clicks on macOS
I have a list of navigation links that I want to be draggable. However, it seems like onDrag conflicts with mouse clicks on macOS (iOS is fine). Here's some sample code: swift import SwiftUI struct ContentView: View { var items = ["Peter", "Mark", "Joe", "Frank", "Tim"] @State var selected: String? var body: some View { NavigationView { List { ForEach(items, id: \.self) { item in NavigationLink(destination: Text(item), tag: item, selection: $selected, label: { Text(item) .onDrag { () - NSItemProvider in return NSItemProvider(object: String(item) as NSString) } }) } } Text("") } } } Here's the weird part: if you click on the text, the item doesn't get selected and the link seems disabled. However, if you click on a section of the item that is empty, then it works! Again, this works just fine on iOS. Is this a SwiftUI bug/limitation or am I doing it wrong? Thanks!
1
2
1.4k
May ’21
macOS: Impossible to set focus on a textfield embedded in an alert
As of now, it seems impossible to set focus on a text field that is embedded in an alert on macOS. struct ContentView: View { @FocusState private var focusedField: FocusField? @State private var showingAlert = false @State private var name = "" enum FocusField { case folderName } var body: some View { VStack { Button { // focusedField = .folderName // Not working either showingAlert.toggle() } label: { Text("Show alert") } .alert("Alert", isPresented: $showingAlert, actions: { TextField("Name", text: $name) .font(.body) .autocorrectionDisabled() .focused($focusedField, equals: .folderName) Button("Cancel", role: .cancel, action: {}) }) #if os(macOS) .defaultFocus($focusedField, .folderName) #endif } .padding() } } When running this code on iOS, the text field does get focus automatically. Is it me that is doing something wrong or it's just a SwiftUI shortcoming on macOS?
1
0
654
Dec ’22
Placeholders for text fields embedded in forms (macOS)
It seems like there's no way to set a placeholder in a text field when it is in a form on macOS. This is not an issue on iOS. import SwiftUI struct ContentView: View { @State private var textUp = "" @State private var textDown = "" var body: some View { VStack { Form { Text("In a form:") .fontWeight(.bold) TextField("placeholder", text: $textUp) } Text("Not in a form:") .fontWeight(.bold) TextField("placeholder", text: $textDown) } .padding() } } Am I missing something or is this just not supported?
1
0
1.2k
Feb ’23
TableColumn with text and image
I'm trying to display a Label in a TableColumn but the header is not rendered properly: Here's some code: struct Computer: Identifiable { let id: UUID let name: String init(_ name: String) { id = UUID() self.name = name } } struct ContentView: View { private var computers = [Computer("iMac"), Computer("MacBook"), Computer("Mac mini")] @State private var selectedComputers = Set<Computer.ID>() @State private var sortOrder = [KeyPathComparator(\Computer.name)] var body: some View { Table(computers, selection: $selectedComputers, sortOrder: $sortOrder) { // Header rendered incorrectly TableColumn("Name", value: \.name) { computer in Label(computer.name, systemImage: "desktopcomputer") } // This works: // TableColumn("Name", value: \.name) } } } If I use a Text element instead (or not define any custom view for the TableColumn), the header is rendered properly: Am I doing it wrong or this is a bug?
1
0
1.2k
Feb ’23
Is StoreKit.Transaction.currentEntitlements down at the moment?
Calling StoreKit.Transaction.currentEntitlements today just doesn't return. It just sits there. for await result in StoreKit.Transaction.currentEntitlements { switch result { case .verified(let transaction): currentTransaction = transaction case .unverified(let transaction, let error): currentTransaction = transaction } } The for loop never starts. This is using a Sandboxed user that made a renewal subscription purchase. Everything was working fine yesterday. Nothing on my end has changed since then. Is something wrong with StoreKit?
1
0
760
Nov ’23