Task {
for await update in LockedCameraCaptureManager.shared.sessionContentUpdates {
switch update {
case .initial(let urls):
print("frank: init \(urls)")
await MainActor.run {
let label = UILabel(frame: CGRect(x: 100, y: 100, width: 100, height: 30))
label.text = "frank test"
label.textColor = .black
UIViewController.getTop().view.addSubview(label)
}
case .added(let url):
print("frank: add \(url)")
case .removed(let url):
print("frank: removed \(url)")
default:
break
}
}
}
why 'case .initial(let urls)': never never be executed? Can some one provide a sample code?
Post
Replies
Boosts
Views
Activity
i used ios 18 new feature about custom control widget, but this looks like a bug, look at these pictures, control center list won't show these icons when i used my app for a while, and control center page can show these icons
This code can open app, but the deep link is not send to the app.
It doesn't seem to call the UIApplicationDelegate's "application(_:open:options:)" method, so I can't read the link string that was passed in
func perform() async throws -> some IntentResult & OpensIntent {
guard let url = URL(string: "myapp://myappintent") else {
// throw an error of your choice here
}
return .result(opensIntent: OpenURLIntent(deepLink))
}
`struct OpenMainAppIntent: AppIntent {
static let title: LocalizedStringResource = "OpenMainAppIntent"
static var openAppWhenRun: Bool = true
init() {}
@MainActor
func perform() async throws -> some IntentResult & OpensIntent {
guard let url = URL(string: "myapp://open") else {
throw OpenURLError.invalidURL
}
return .result(opensIntent: OpenURLIntent(url))
}
}
`
This is an action in my custom control widget, and i want to use this deeplink open my application and get the link's info, but it won't perform onOpenURL
`@main
struct TestControlWidgetApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.onOpenURL { url in
print("url: \(url)")
}
}
}
}`
SDK has some compile errors, when it can be fixed? We want to develop iOS 18 new features in our application.
/Users/***/XcodeBeta/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.1.sdk/usr/include/c++/v1/__type_traits/is_arithmetic.h:24:29 'std::is_arithmetic' has different definitions in different modules; defined here
/Users/***/XcodeBeta/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.1.sdk/usr/include/c++/v1/__type_traits/is_integral.h:53:29 'std::is_integral' has different definitions in different modules; defined here
'std::is_arithmetic' has different definitions in different modules; definition in module 'std_private_type_traits_is_arithmetic' is here
Use of undeclared identifier 'LLONG_MAX'