当我尝试在 iOS 16.0 上打开一个预配置测试版本时收到一条警报。警报说——
“您的应用程序”需要开发者模式才能运行。在启用开发者模式之前,此应用程序将无法使用。
从iOS / iPadOS 13开始,提供了深色用户界面样式,类似于macOS Mojave中引入的深色模式。如何检查用户是否已启用系统范围的暗模式?
我们能够使用 javascript 检测 iPad 设备,如下所示:
function isDeviceiPad(){
return navigator.platform.match(/iPad/i);
}
Run Code Online (Sandbox Code Playgroud)
这在检测 iPad 设备时效果很好,但是当我们从 中检查时iPad Pro (10.5 inch)
,它没有检测到它是 iPad。
为了进一步调查,我们深入研究了navigator
对象,检查了platform
和userAgent
,并得到了以下结果:
navigator.platform = 'MacIntel';
navigator.userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15)
AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15)';
Run Code Online (Sandbox Code Playgroud)
问题是navigator.platform = 'MacIntel'
(与 MacBook Pro 相同)返回而不是iPad
. 我们需要一种方法来检测这是 iPad 而不是 MacBook Pro,但导航器似乎iPad
不像旧 iPad那样返回。
知道我们如何解决这个问题吗?
昨天,我通过 App Store 更新到了 Xcode 13。我正在尝试通过“组织者”窗口中的常规方式将我的应用程序的存档发送到 App Store Connect,提交存档后,我会收到警告消息:
App Store Connect 操作警告
您的 iTMSTransporter 版本将在大约 10 天后更新。
我以前从未见过这个,也不知道这意味着什么。该存档稍后仍会显示在 Testflight 中并且可用,但我不确定在上传并带有警告的情况下使用此存档版本更新我的应用程序的 App Store 版本是否安全。
这个警告是什么?我该如何解决这个问题?
在 App Store Connect 上传后,我还收到了这封关于替代图标错误的电子邮件。我在应用程序中启用了替代应用程序图标,并且确定我的 iPhone 上有 120x120,所以我不确定为什么会发生这种情况。但如果这与上传警告无关,请忽略该电子邮件:
预先感谢您的帮助!
编辑: 看起来苹果已经解决了这个问题,因为我的档案上传时没有那个奇怪的警告
我的应用用来NEHotspotConfigurationManager
通过Wi-Fi将自身连接到特定设备。该设备充当WPA2接入点。在较旧的iOS版本(iOS 12及更低版本)中,一切正常,但在iPadOS / iOS 13中,每隔一段时间就会断开设备的连接。如何保持连接而不NEHotspotConfiguration
永久存储?
我怀疑它与新功能-多个Windows(我的应用程序不支持)有关。原因是在我的NEHotspotConfiguration
我将joinOnce
标志设置为true
(因为永远不要在应用程序外部使用设备的网络)。苹果的文档指出:
如果joinOnce设置为true,则仅在配置了热点的应用程序在前台运行时,热点才会保持配置和连接。发生以下任何事件时,都会断开热点并删除其配置:
- 该应用程序在后台停留超过15秒。
- 设备进入睡眠状态。
- 该应用程序崩溃,退出或被卸载。
- 该应用程序将设备连接到其他Wi-Fi网络。
也许我的应用被错误地识别为前景。
设置joinOnce
为false
可使应用程序保持连接状态,但这不是可接受的解决方案,因为我的设备不提供Internet连接,因此不能在应用程序外部使用。
这是我应用热点配置的方法:
let hotspotConfiguration = NEHotspotConfiguration(ssid: self.ssid, passphrase: self.passphrase, isWEP: false)
hotspotConfiguration.joinOnce = true
NEHotspotConfigurationManager.shared.apply(hotspotConfiguration) { error in
// connection is successfully applied
// and about 15 seconds later it is lost.
}
Run Code Online (Sandbox Code Playgroud)
我希望将joinOnce
标志设置为时保持连接true
。
当我检查 Xcode 11.1 中目标的设置(在项目导航器侧栏中单击项目然后单击可执行目标时访问)时,我注意到一个名为“开发资产”的新可扩展部分,该部分在 Xcode 中不存在10. 我也找不到任何关于它的文档或发行说明中的提及。
有没有人发现本节的目的是什么,它的最佳用例是什么,如何使用它,也许还有一些由 Apple 或社区中的任何人编写的文档?
我有这个应用程序使用iOS14 中为 iPad 操作系统引入的新侧边栏,但我不明白为什么它在隐藏时不记得状态
这是侧边栏结构
import SwiftUI
struct Sidebar: View {
@Environment(\.managedObjectContext) var moc
@Binding var selection : Set<NavigationItem>
var body: some View {
List(selection: $selection) {
NavigationLink(destination: AgendaView().environment(\.managedObjectContext, moc).navigationTitle("Agenda"), label: {
Label("Agenda", systemImage: "book")
})
.tag(NavigationItem.agenda)
NavigationLink(destination: Text("Subjects"), label: {
Label("Materie", systemImage: "tray.full")
})
.tag(NavigationItem.subjects)
NavigationLink(destination: Text("Calendario"), label: {
Label("Calendario", systemImage: "calendar")
})
.tag(NavigationItem.calendar)
NavigationLink(destination: SettingsView().environment(\.managedObjectContext, moc).navigationTitle("Impostazioni"), label: {
Label("Impostazioni", systemImage: "gear")
})
.tag(NavigationItem.settings)
}
.listStyle(SidebarListStyle())
}
}
Run Code Online (Sandbox Code Playgroud)
为了标记元素,我使用了一个名为 NavigationItem 的自定义结构
enum NavigationItem {
case agenda
case …
Run Code Online (Sandbox Code Playgroud) iPadOS beta上的Safari用户代理与macOS上的Safari完全相同。还有其他从Mac告诉iPad的方法吗?
iPad running iOS
Mozilla/5.0 (iPad; CPU OS 10_3_3 like Mac OS X) AppleWebKit/603.3.8 (KHTML, like Gecko) Version/10.0 Mobile/14G60 Safari/602.1
iPadOS, developer beta 1
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15
iPadOS, beta 2, simulator
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15
iPadOS, beta 3, (simulator)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15
iPadOS, developer beta 3
Mozilla/5.0 (Macintosh; Intel Mac …
Run Code Online (Sandbox Code Playgroud) 尝试使用Catalyst为Mac构建时,出现以下构建错误:
FIRAnalyticsConnector(FIRConnectorUtils_77ff1e12be6740765c87f1be0d421683.o), building for Mac Catalyst, but linking in object file built for iOS Simulator
该项目针对iOS和iPadOS构建良好。
由于我升级了 iPad 操作系统,我的应用程序的 UITabBar 标题显示被截断,如屏幕截图所示。
我尝试了一些方法,但没有找到正确的解决方案。
希望可以有人帮帮我。
这是代码:
func setupTabBar() {
if #available(iOS 13, *) {
let appearance = tabBar.standardAppearance
appearance.configureWithOpaqueBackground()
appearance.backgroundImage = UIImage(color: .white)
appearance.shadowImage = UIImage(color: .clear)
let normalAttrs: [NSAttributedString.Key: Any] = [.foregroundColor: ThemeColor.gray]
let selectedAttrs: [NSAttributedString.Key: Any] = [.foregroundColor: ThemeColor.red]
appearance.stackedLayoutAppearance.selected.titleTextAttributes = selectedAttrs
appearance.stackedLayoutAppearance.normal.titleTextAttributes = normalAttrs
appearance.inlineLayoutAppearance.selected.titleTextAttributes = selectedAttrs
appearance.inlineLayoutAppearance.normal.titleTextAttributes = normalAttrs
appearance.compactInlineLayoutAppearance.selected.titleTextAttributes = selectedAttrs
appearance.compactInlineLayoutAppearance.normal.titleTextAttributes = normalAttrs
UITabBar.appearance().standardAppearance = appearance
} else {
tabBar.backgroundImage = UIImage(color: .white)
tabBar.shadowImage = UIImage(color: .clear)
}
if #available(iOS 15, *) …
Run Code Online (Sandbox Code Playgroud)