我的 iOS Swift 5 (Xcode 14.1) 应用程序正在运行。上次 Xcode 更新后,我注意到当我在导航控制器内的堆栈中推送带有表视图的特定视图控制器时,我收到以下警告:
[SystemGestureGate] <0x102210320> 手势:系统手势门超时
当我向后滑动以弹出有问题的视图控制器时,它的行为不稳定,有时弹出得很好。我所说的“不稳定”是指有时它会部分显示目标视图控制器,有时会在滑动中间冻结一两秒等。当我尝试再次推入有问题的视图控制器时(出现警告后),它会冻结应用程序。
视图控制器、堆栈、表格和单元格没有自定义手势识别器。
我在应用程序的其他地方没有看到这个警告(包括带有堆栈和表格的视图控制器)。
我的问题是:
我怀疑我正在使用的表有问题,正在进一步调查。
我采取的一些故障排除步骤:
viewWillAppear,但之前viewDidAppear。我期望视图控制器将以与导航控制器中所有其他视图控制器相同的方式滑动来弹出。
ITMS-90809:已弃用的 API 使用 - 自 2020 年 4 月 30 日起,Apple 将不再接受使用 UIWebView 的新应用程序的提交以及自 2020 年 12 月起使用 UIWebView 的应用程序更新。而是使用 WKWebView 来提高安全性和可靠性。
我正在尝试更新现有应用程序,而不是新应用程序。我仍然无法上传应用程序。我通过电子邮件收到此错误:
We identified one or more issues with a recent delivery for your app, "App Name" 20202.421.1 (6). Please correct the following issues, then upload again.
ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview).
Run Code Online (Sandbox Code Playgroud)
苹果是否改变了它的政策?还是我需要改变UIWebView?
如何让内部Button执行其操作而不是始终执行外部操作?
struct Foo: View {
var body: some View {
Button(action: { print("alloha") }) {
HStack {
Button(action: { print("hello") }) {
Image(systemName: "circle.fill")
}
Text("world")
Spacer()
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试学习 Swift,并且我已经在视图屏幕上完成了。但是,通过检查屏幕截图,您可以更轻松地理解,当我在文本字段中输入值时,没有显示任何完成按钮,因此我无法从屏幕上隐藏键盘。这使得无法按下位于屏幕视图底部的提交按钮。


我是初学者开发人员,正在开发 React(gatsby、TS、样式组件)项目。我收到此错误:
“React 无法识别isOpenDOM 元素上的 prop。如果您故意希望它作为自定义属性出现在 DOM 中,请将其拼写为小写isopen。如果您不小心从父组件传递了它,请将其从 DOM 元素中删除。 ”
export const Navigation = () => {
const [isNavigationOpen, setIsNavigationOpen] = useState(false);
const { isTablet } = useQuery();
const showNavbar = () => {
setIsNavigationOpen((previousState) => !previousState);
};
const renderElement = isTablet ? (
<>
<SvgStyled
src='bars_icon'
isOpen={isNavigationOpen}
onClick={showNavbar}
/>
<MobileNavigation isOpen={isNavigationOpen}>
{NAVIGATION_DATA.map(({ id, url, text }) => (
<LinkMobile key={id} to={url}>
<ExtraSmallParagraph>{text}</ExtraSmallParagraph>
</LinkMobile>
))}
</MobileNavigation>
</>
) : (
<FlexWrapper>
{NAVIGATION_DATA.map(({ id, url, text …Run Code Online (Sandbox Code Playgroud) 这是什么意思?我尝试了这个......仍然给了我同样的信息:
DispatchQueue.main.async {
if let imageData = try? Data(contentsOf: url) {
self.image = UIImage(data: imageData)
}
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试在面向 iOS 16 的应用程序中的 Scrollview 上使用可刷新修饰符。但是,异步任务在拉动刷新手势期间被取消。
这是一些代码和附加的视频,演示了问题以及带有打印错误的图像:
探索ViemModel.swift
class ExploreViewModel: ObservableObject {
@Published var randomQuotes: [Quote] = []
init() {
Task {
await loadQuotes()
}
}
@MainActor
func loadQuotes() async {
let quotesURL = URL(string: "https://type.fit/api/quotes")!
do {
let (data, urlResponse) = try await URLSession.shared.data(from: quotesURL)
guard let response = urlResponse as? HTTPURLResponse else { print("no response"); return}
if response.statusCode == 200 {
let quotes = try JSONDecoder().decode([Quote].self, from: data)
randomQuotes.append(contentsOf: quotes)
}
} catch {
debugPrint(error)
debugPrint(error.localizedDescription)
}
} …Run Code Online (Sandbox Code Playgroud) 在模拟器中运行时,我确实在 Xcode 中得到了这个:
[assertion] Error acquiring assertion: <NSError: 0x600002981c20; domain: RBSAssertionErrorDomain; code: 2; reason: "Client is missing required entitlement"> {
userInfo = {
RBSAssertionAttribute = <RBSLegacyAttribute: 0x7fbe0f927ed0; requestedReason: MediaPlayback; reason: MediaPlayback; flags: PreventTaskSuspend | PreventTaskThrottleDown | WantsForegroundResourcePriority>;
}
}
Run Code Online (Sandbox Code Playgroud)
我的音频正在运行。但想知道,是什么原因导致这种情况以及如何解决。
我到处寻找,但找不到解决这个问题的方法。我正在寻找一种方法来更改将AVAudioEngine在 macOS 上使用的输入/输出设备。
当简单地播放音频文件时,以下内容按预期工作:
var outputDeviceID:AudioDeviceID = xxx
let result:OSStatus = AudioUnitSetProperty(outputUnit, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Global, 0, &outputDeviceID, UInt32(MemoryLayout<AudioObjectPropertyAddress>.size))
if result != 0 {
print("error setting output device \(result)")
return
}
Run Code Online (Sandbox Code Playgroud)
但是,如果我初始化音频输入(使用let input = engine.inputNode),那么当我尝试启动引擎时,我会收到错误消息:
AVAEInternal.h:88 必需条件为 false: [AVAudioEngine.mm:1055:CheckCanPerformIO: (canPerformIO)]
我知道我的播放代码没问题,因为如果我避免更改输出设备,那么我可以听到麦克风和音频文件,如果我更改输出设备但不初始化文件,则文件会播放inputNode到指定的目的地。
除此之外,我一直在尝试更改输入设备,我从各个地方了解到以下应该执行此操作:
let result1:OSStatus = AudioUnitSetProperty(inputUnit, kAudioOutputUnitProperty_CurrentDevice, kAudioUnitScope_Output, 0, &inputDeviceID, UInt32(MemoryLayout<AudioObjectPropertyAddress>.size))
if result1 != 0 {
print("failed with error \(result1)")
return
}
Run Code Online (Sandbox Code Playgroud)
但是,这不起作用 - 在大多数情况下它会抛出错误(10853),尽管如果我选择同时具有输入和输出的声卡,它会成功 - 看来当我尝试设置输出或输入节点时它实际上是为两者设置设备。
我认为这意味着一个AVAudioEngine实例只能处理一个设备,但是它很高兴使用默认设备(麦克风和扬声器/耳机),所以我相信这不是问题。查看一些解决方案,我看到网上人们只是简单地更改默认输入,但这并不是一个非常好的解决方案。
有谁知道这是否可能?
值得注意的是,这kAudioOutputUnitProperty_CurrentDevice是唯一可用的属性,没有等效的kAudioInputUnitProperty_CurrentDevice键,因为据我了解, …
使用 Xcode 14.0、iOS 16、Swift 5.7、
由于 iOS 16,我收到以下弃用警告:
iOS 16.0 中已弃用“duration”:改用 load(.duration)
这是我的代码:
var actualTime: CMTime = CMTimeMake(value: 0, timescale: asset.duration.timescale)
Run Code Online (Sandbox Code Playgroud)
我需要更改什么才能消除此警告?
我试过:
var actualTime: CMTime = CMTimeMake(value: 0, timescale: asset.load(.duration).timescale)
Run Code Online (Sandbox Code Playgroud)
但这使得一切都是异步的。我真的需要走那条路吗?