Hi,My iOS Swift app contains a in-house built framework (A), which is also using Swift. This framework includes 2 in-house built frameworks (B and C) using Objective-C."Embedded Content Contains Swift Code" is set to YES for the app and to NO for the A, B and C frameworks.When I try to submit the app to iTC, I get these errors:ERROR ITMS-90205: "Invalid Bundle. The bundle at 'yourapp.app/Frameworks/A.framework' contains disallowed nested bundles."...ERROR ITMS-90206: "Invalid Bundle. The bundle at 'yourapp.app/Frameworks/A.framework' contains disallowed file 'Frameworks'."...How can I fix those?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Is there a way to force a window to resize according to an aspect ratio? This is possible in AppKit via the NSWindow.contentAspectRatio property but I cannot find something similar for SwiftUI.
Basically, I want the window to maintain the aspect ratio of its contents.
Is .refreshable supposed to do anything on macOS? Works fine on iOS and iPadOS but it's not triggered on macOS. It's available since macOS 12 but the documentation doesn't mention anything about that.
https://developer.apple.com/documentation/swiftui/view/refreshable(action:)
Is it possible to have sections in a SwiftUI table? I cannot find any documentation or examples that show that it is.
This simple project just makes the Swift compiler crash in init(comparator: KeyPathComparator<RemoteComputer>):
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!")
}
.padding()
}
}
enum CSItemOrderType: Int, Codable, CaseIterable, CustomStringConvertible {
case readableName
case lastConnectionDate
case numberOfConnections
var description: String {
switch self {
case .readableName: return "STR_NAME"
case .lastConnectionDate: return "STR_LAST_CONN_DATE"
case .numberOfConnections: return "STR_ORDER_MOST_CONNECTED"
}
}
}
struct CSItemOrder: Codable {
static let allCases = [CSItemOrder(type: .readableName),
CSItemOrder(type: .lastConnectionDate, order: .reverse),
CSItemOrder(type: .numberOfConnections, order: .reverse)]
static let allSortOrders = [KeyPathComparator(\RemoteComputer.readableName),
KeyPathComparator(\RemoteComputer.lastConnectionDate),
KeyPathComparator(\RemoteComputer.numberOfConnections)]
let type: CSItemOrderType
var order: SortOrder
var comparator: KeyPathComparator<RemoteComputer> {
switch type {
case .readableName: return KeyPathComparator(\RemoteComputer.readableName, order: order)
case .lastConnectionDate: return KeyPathComparator(\RemoteComputer.lastConnectionDate, order: order)
case .numberOfConnections: return KeyPathComparator(\RemoteComputer.numberOfConnections, order: order)
}
}
init(type: CSItemOrderType, order: SortOrder = .forward) {
self.type = type
self.order = order
}
init(comparator: KeyPathComparator<RemoteComputer>) throws {
switch comparator.keyPath {
case \RemoteComputer.readableName: self.init(type: .readableName, order: comparator.order)
case \RemoteComputer.lastConnectionDate: self.init(type: .lastConnectionDate, order: comparator.order)
case \RemoteComputer.numberOfConnections: self.init(type: .numberOfConnections, order: comparator.order)
default:
print("Unsupported keyPath: \(comparator.keyPath)")
throw ItemOrderError.unsupportedKeyPath
}
}
}
struct RemoteComputer: Codable, Hashable, Identifiable {
let id: Int
let name: String
let hostname: String?
let localIpAddress: String?
let vncPort: Int
let sshPort: Int
let publicIpAddress: String?
let publicPort: Int
let macAddress: String
let scVersion: String
let manualMode: Int
let uuid: String
let lastMappingStatus: String?
let isAwake: Bool
let unregistered: Bool
let osVersion: String?
let lastUpdate: Date
let remoteAddress: String?
let lastKeyboardLocale: String?
let macSystemShortcuts: [String: [Int32]]?
var readableName: String {
return name.removingPercentEncoding ?? name
}
var lastConnectionDate: Date {
return Date.now
}
var unwrappedPublicIpAddress: String {
return publicIpAddress ?? NSLocalizedString("STR_NOT_AVAILABLE", comment: "")
}
var numberOfConnections: Int {
return 0
}
}
enum ItemOrderError: Error {
case unsupportedKeyPath
}
This code works fine in previous betas or Xcode 15.
I don't know if this is a iOS 18.1 beta bug or some StoreKit server issues but Product.SubscriptionInfo.Status is returning an empty array in production even if the user has a valid subscription that is months away from expiring or renewing.
I myself ran into this issue this morning but of course everything is fine in development mode so that makes it quite challenging to debug.
Anyone else has this issue?
Hi everyone,
I’m running into a strange animation glitch when using a Menu inside a glassEffect container.
Here’s a minimal example:
import SwiftUI
struct ContentView: View {
@Namespace private var namespace
var body: some View {
ZStack {
Image(.background)
.resizable()
.frame(maxWidth: .infinity, maxHeight: .infinity)
.ignoresSafeArea()
GlassEffectContainer {
HStack {
Button("b1") {}
Button("b2") {}
Button("b3") {}
Button("b4") {}
Button("b5") {}
Menu {
Button("t1") { }
Button("t2") { }
Button("t3") { }
Button("t4") { }
Button("t5") { }
} label: {
Text("Menu")
}
}
}
.padding(.horizontal)
.frame(height: 50)
.glassEffect()
}
}
}
What happens:
The bar looks fine initially:
When you open the Menu, the entire bar morphs into the menu:
When dismissing, the bar briefly animates into a solid rectangle before reapplying the glass effect:
Questions:
Is there a way to prevent that brief rectangle animation when dismissing the menu?
If not, is it possible to avoid the morphing altogether and have the menu simply overlay on top of the bar instead of replacing it?
Any ideas or workarounds would be greatly appreciated!
Isn't there no way to set the default filename to use when we want to save a DataRepresentation to a file?
If I export to JSON, the filename is "JSON.json" is used by iOS, even if I set the name to use in SharePreview.
struct ContentView: View {
let car = Car(id: UUID(), name: "911", items:
[Item(id: UUID(),date: .now, desc: "oil change"),
Item(id: UUID(),date: .now, desc: "Battery")])
var body: some View {
VStack {
ShareLink(item: car, preview: SharePreview(car.name))
}
.padding()
}
}
extension UTType {
static var car: UTType = UTType(exportedAs: "com.acme.cararchive")
}
struct Car: Codable {
let id: UUID
let name: String
let items: [Item]
}
extension Car: Transferable {
static var transferRepresentation: some TransferRepresentation {
DataRepresentation(contentType: .json) { archive in
try JSONEncoder().encode(archive)
} importing: { data in
try JSONDecoder().decode(Car.self, from: data)
}
}
}
struct Item: Codable {
let id: UUID
let date: Date
let desc: String
}
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?
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?
Like the title says. Can you submit an app update and release it while the app is in pre-order?
I would assume that yes it is possible but I've never used pre-orders so I'd like to know if anyone here knows...
Thanks!
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
App Store
App Store Connect
Mac App Store
We had a few users reporting this issue where our app is unable to connect to StoreKit.
Failed product request from the App Store server: systemError(Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.apple.storekitagent" UserInfo={NSDebugDescription=connection to service named com.apple.storekitagent})
This occurs when calling Product.products(for:).
Some users mentioned they had to restart their Mac in safe mode to make the error go away, some had DNS cache issues and clearing those helped, or some found the culprit to be Adguard.
What could be causing this error as it is not very clear what's causing it?
When displaying a view using a navigation Split View as a sheet, the toolbar button will disappear if you leave the app and resume it.
import SwiftUI
struct Folder: Hashable, Identifiable {
let id = UUID()
let name: String
}
struct ContentView: View {
@State private var showingSettings = false
var body: some View {
VStack {
Button {
showingSettings.toggle()
} label: {
Text("Settings")
}
}
.sheet(isPresented: $showingSettings, content: {
SettingsView()
})
.padding()
}
}
struct SettingsView: View {
@Environment(\.dismiss) private var dismiss
@State private var selectedFolder: Folder? = nil
private var folders = [Folder(name: "Recents"), Folder(name: "Deleted"), Folder(name: "Custom")]
var body: some View {
NavigationSplitView {
SidebarView(selectedFolder: $selectedFolder, folders: folders)
} detail: {
VStack {
if let folder = selectedFolder {
Text(folder.name)
}
else {
Text("No selection")
}
}
.toolbar {
ToolbarItem(placement: .cancellationAction) {
Button {
dismiss()
} label: {
Text("Cancel")
}
}
ToolbarItem(placement: .confirmationAction) {
Button {
dismiss()
} label: {
Text("Save")
}
}
}
}
}
}
struct SidebarView: View {
@Binding var selectedFolder: Folder?
var folders: [Folder]
var body: some View {
List(selection: $selectedFolder) {
ForEach(folders) { folder in
NavigationLink(value: folder) {
Text(folder.name)
}
}
}
}
}
Steps to reproduce the issue:
Launch the attached project on an iPad or iPad simulator
Tap the Settings button
Select one item in the sidebar
Use the app switcher to open an other app or just leave the app
Bring back the app
Result:
Both Cancel and Save buttons are gone.
Note:
This will not occur if no item is selected in the sidebar.
FB12991687
I'm unable to figure out how to know when my app no longer has focus. ScenePhase will only change when the WindowGroup gets created or closed.
UIApplication.didBecomeActive and UIApplication.didEnterBackgroundNotification are not called either when say you move focus to Safari.
What's the trick?
Calling DNSServiceNATPortMappingCreate returns kDNSServiceErr_NoError like expected but the port mapping actually fails right away in the callback.
I'm calling this in a daemon via XPC. Are there new restrictions or permissions required?