Posts

Sort by:
Post not yet marked as solved
0 Replies
5 Views
I tried doing the outlets for all the controls, then making a nsview in the method for a button that declares a view, then I set initwithframe to be sent to a variable typed 'id' and accessing that variable I was able to add nsbuttoncell to the variable, then I added the subview to the. main tableview here's the code I used: NSView *viewptr = [[NSView alloc]init]; NSButtonCell *bCell1 = [[NSButtonCell alloc]init]; NSRect rect; [bCell1 setTitle:@"click"]; rect.size.width = 2; rect.size.height = 1; id temp,x; temp = [viewptr initWithFrame:rect]; [temp addObject:bCell1]; [_cocoa_test_scrollview addSubview:temp]; is there anything im missing? the app keeps crashing and spiting out debug messages, like: -[NSView addObject:]: unrecognized selector sent to instance 0x12ee0ae60 ( 0 CoreFoundation 0x0000000186efaccc __exceptionPreprocess + 176 1 libobjc.A.dylib 0x00000001869e2788 objc_exception_throw + 60 2 CoreFoundation 0x0000000186fad02c -[NSObject(NSObject) __retain_OA] + 0 3 CoreFoundation 0x0000000186e64cdc forwarding + 1580 4 CoreFoundation 0x0000000186e645f0 _CF_forwarding_prep_0 + 96 5 objc_cocoa_test_image_3 0x0000000100608ca4 -[AppDelegate cocoa_test_button1_add:] + 264 6 AppKit 0x000000018a881c70 -[NSApplication(NSResponder) sendAction:to:from:] + 460 7 AppKit 0x000000018a881a74 -[NSControl sendAction:to:] + 72 8 AppKit 0x000000018a8819b8 __26-[NSCell _sendActionFrom:]_block_invoke + 100 9 AppKit 0x000000018a8818e0 -[NSCell _sendActionFrom:] + 204 10 AppKit 0x000000018a881804 -[NSButtonCell _sendActionFrom:] + 88 11 AppKit 0x000000018a87ee38 NSControlTrackMouse + 1480 12 AppKit 0x000000018a87e844 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 144 13 AppKit 0x000000018a87e6fc -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 488 14 AppKit 0x000000018a87dbd0 -[NSControl mouseDown:] + 448 15 AppKit 0x000000018a87c99c -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 3472 16 AppKit 0x000000018a807f78 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 364 17 AppKit 0x000000018a807c38 -[NSWindow(NSEventRouting) sendEvent:] + 284 18 AppKit 0x000000018aecde70 -[NSApplication(NSEventRouting) sendEvent:] + 1604 19 AppKit 0x000000018ab1b8cc -[NSApplication _handleEvent:] + 60 20 AppKit 0x000000018a6cfcdc -[NSApplication run] + 512 21 AppKit 0x000000018a6a6f54 NSApplicationMain + 880 22 objc_cocoa_test_image_3 0x0000000100608a68 main + 60 23 dyld 0x0000000186a1e0e0 start + 2360 ) can anyone point me in the right direction?
Posted
by
Post not yet marked as solved
0 Replies
12 Views
We’ve observed a couple of concerning alterations in the passkey registration and authentication behaviour in iOS 17.4.1: During passkey registration, “excludeCredentials” property is ignored. Existing passkey is silently overwritten and no error is reported from navigator.credentials.create (both, Safari and Chrome). However, according to W3 spec when “excludeCredentials” is present in the PublicKeyCredentialCreationOptions - “The client is requested to return an error if the new credential would be created on an authenticator that also contains one of the credentials enumerated in this parameter.” PublicKeyCredentialCreationOptions we use: "credCreateOptions": { "rp": { "name": "RP name" }, "user": { "name": "username", "id": "abcd" }, "challenge": "56elsKE5pKgEECg-fJpLl3gF33ACRSVBl00Mn03JAIk", "pubKeyCredParams": [ { "type": "public-key", "alg": -7 } ], "excludeCredentials": [ { "type": "public-key", "id": “abcd” } ], "authenticatorSelection": { "authenticatorAttachment": "platform", "userVerification": "required" }, "hints": [ "client-device" ], "attestation": "direct", "extensions": null } } This behaviour is different from what is observed on iOS 17.3.1 where the registration call to navigator.credentials.create with the same options produces the following error: “At least one credential matches an entry of the excludeCredentials list in the platform attached authenticator” During passkey login flow, iOS 17.4.1 ignores "hints": [ "client-device" ] According to https://developer.mozilla.org/en-US/docs/Web/API/CredentialsContainer/create#client-device, hints specify what authentication UI the user-agent should provide for the user. “client-device” requests the user authenticates using their own device, such as a phone. Here’s our PublicKeyCredentialRequestOption: "credRequestOptions": { "challenge": "xk_wd1BaVue7mOZ-UM_KVj6Z4AmGxf12_7H1Gilq01I", "timeout": 300000, "allowCredentials": [ { "type": "public-key", "id": “abcd”, "transports": [ "internal" ] } ], "userVerification": "required", "hints": [ "client-device" ], "extensions": null } } However, iOS 17.4.1 gives user an option to sign in with another device . On iOS 17.3.1, the request to navigator.credentials.get with the same same PublicKeyCredentialRequestOption presents the UI screen without the “Sign In with Another Device” option. Is that a bug on iOS 17.4.1 or intended behaviour? This does not follow the official specs and different from the other platforms like Android. Is there any documentation around this change on iOS 17.4.1? That would be helpful.
Posted
by
Post not yet marked as solved
0 Replies
16 Views
In my app I play HLS streams via AVPlayer. It works well! However, when I try to download those same HLS urls via MakeAssetDownloadTask I regularly come across the error: Download error for identifier 21222: Error Domain=CoreMediaErrorDomain Code=-12938 "HTTP 404: File Not Found" UserInfo={NSDescription=HTTP 404: File Not Found, _NSURLErrorRelatedURLSessionTaskErrorKey=( "BackgroundAVAssetDownloadTask <CE9B10ED-E749-49FF-9942-3F8728210B20>.<1>" ), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundAVAssetDownloadTask <CE9B10ED-E749-49FF-9942-3F8728210B20>.<1>} I have a feeling that the AVPlayer has a way to resolve this that the MakeAssetDownloadTask lacks. I am wondering if any of you have come across this or have insight. Thank you! BTW this is using Xcode Version 15.3 (15E204a) and developing for visionOS 1.0.1
Posted
by
Post not yet marked as solved
0 Replies
32 Views
Greetings everyone, first of all I apologize to everyone for the long question I am going to ask, but I thought it would be better to tell you my question and what I am working on to solve it. You may have heard about Apple's new Privacy Manifest requirement for new apps to be released to the app store. After I heard about it, I made a list of all dependencies used in my project and then updated them to the versions that include the Privacy Manifest file. Since I only use UserDefaults in my project, which is one of the required reason APIs specified by Apple, I added it and my reason for using it in the Privacy Manifest file. When I released a package with this development, I received a new notification email from Apple saying that while they used to be upset with me about UserDefaults, they are no longer, so it seems that Apple has accepted my reason for using UserDefaults in the application. However, Apple was also upset about Required Reason APIs in this list that I don't actually use (e.g. SystemBootTime API, DiskSpace API, FileTimestamp API). I thought about what could be causing this. First of all, it could be that one of the dependencies I use didn't specify the Required Reason API in the Privacy Manifest file or specified it incorrectly. However, I didn't think this was likely because I'm using common dependencies (e.g. Firebase, Alamofire, Lottie, etc.) and I didn't find any issues in the repos for them. Then it occurred to me that we have a binary dependency embedded statically in the project. I looked at the repo of this dependency and in the latest versions they added the Privacy Manifest file, but they added an empty privacy manifest file. This SDK is actually a service that we bought as a company. Therefore, I don't think there will be a problem. If they don't use Required Reason API, I think it can't be the cause of the mail. Nevertheless, our Business Analysts will contact the SDK owners. Then I realized that although it is on the list of SDKs that Apple requires to include a privacy manifest, I could not update it. This is nanopb. Actually, this is not a direct dependency of mine, but it is a dependency of Firebase. Like nanopb, there are other packages that are dependent on Firebase and are listed by apple (e.g. abseil, Promises, GTMSessionFetcher etc.) These are included as SPMs in the Package.swift file of Firebase that I have added to my project, with specific version ranges. If I update it, I get the latest version of the appropriate SPM version. For example promises were added for Firebase 10.16.0 as follows. The previous version did not have the Privacy Manifest. So I updated it to 2.4.0 by doing Project Navigator > Package Dependencies > Update To Latest Package Versions on Xcode. .package( url: “https://github.com/google/promises.git”, “2.1.0” ..< “3.0.0” ), This version included the Privacy Manifest, which solved my problem. But for nanopb the situation is as follows and no version of nanopb provides Privacy Manifest. I'm not even sure if there is a version of nanopb like the one below. .package( url: “https://github.com/firebase/nanopb.git”, “2.30909.0” ..< “2.30910.0” ) When I did some research on the issue, I came across something like this. The Google developer wrote “This bug can be closed because this repo does not release a binary distro of nanopb for Apple platforms.” in response to the issue. But as a non-native English speaker, I don't understand this explanation. As a result, Apple stated in the mail that I was using these Required Reason APIs (I will give an example of the mail below). I tried to find it even though it was not the case. Three possibilities came to my mind and I thought about these possibilities. Finally, I decided to consult you What do you think is causing this (is it widely used sdk's that do not specify or incorrectly specify the reason for using required reason api's? is it static library? is it nanopb?) Is there any way to see Apple's evaluation in this notification email without releasing the package? Will I test whether I have fixed this or not by constantly releasing packages? Any comments will be very appreciated. Thank you very much in advance for all your comments and answers! Email (Consider that the equivalent exists in the SystemBootTime API and DiskSpace API below.): ITMS-91053: Missing API declaration - Your app’s code in the “MyAppName” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryFileTimestamp. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api
Posted
by
Post not yet marked as solved
1 Replies
49 Views
I'm extremely frustrated with Apple's unfair app review process. To make a long story short, for every app I've ever submitted, Apple has made false accusations about problems with my apps. Some of their feedback has absolutely been legitimate and correct, which I appreciate, but I would say about 50% of all "feedback" I've ever received has turned out to be objectively wrong. In some cases, the App Review team's gaslighting has been so strong that I have had to submit screenshots of code as proof that their accusations were completely wrong, after which they have had to accept the app. In one instance, they have claimed that one of my apps would not be allowed on the App Store at all, and when I link to multiple other apps that works EXACTLY the same way, the App Review team love to point out that you are not allowed to compare yourself to other apps. To be clear, I'm an indie developer and I'm not even comparing myself to apps from large corporations or any popular apps at all (since it's well known they get the VIP treatment), all apps I have compared myself to are from small, unknown indie developers such as myself - so I'm only comparing myself to developers in the same category as me. Telling developers that they are not allowed to compare themselves to other developers is VERY ethically problematic, imagine doing that to minorities in real life. I'm a minority in multiple ways, and I'm very worried about the ethics and moral at the App Review team. When I ask why they reject my app, but approve many apps that were recently released that works EXACTLY the same way as my app, I either get no reply at all or they tell me that I can't compare myself to others. Submitting appeals to the App Review Board doesn't help either. To be completely transparent with you, it has been very hard and draining on my mental health to have this invisible wall consisting of gaslighting that the App Review team has set up for me. It just doesn't make sense... The app review process is unfair, inconsistent and problematic, and it should be a serious eyebrow-raiser when Apple's App Review team can't explain why some small indie developers get approved easily while others get rejected. Especially since it seems like the pattern is that those who get rejected are humans in various kinds of minorities, as evidences by some other threads on this topic.
Posted
by
Post not yet marked as solved
0 Replies
34 Views
I am trying to build a Swift app for iOS which depends on an open-source API called BrainFlow. BrainFlow is written in C++. Due to App Store restrictions, the API must be built by hand into a framework so that it can be signed with my developer certificate. So that's what I did. I now have a signed framework that I can embed in my app and that Apple is OK with. BrainFlow depends on a third-party library called SimpleBLE, an open-source API for connecting to BLE devices. So I built that too into its own signed framework. So far so good. The problem comes when my app tries to connect to a BLE device via BrainFlow. BrainFlow is designed to explicitly load its third-party libs like plug-ins, and it is hardcoded to assume that all dylibs are located in the same directory. However, when I build the BrainFlow framework so that it embeds the SimpleBLE dylib in the same directory as the BrainFlow dylib, App Store Connect rejects my app due to a policy violation. One solution might be to query dyld and have it return the resolved location of the SimpleBLE dylib. For example if the dylib is referenced as @rpath/libsimpleble-c.dylib, then the query would return its full path after resolving @rpath. I do not know how to do that or even if it's possible. Another solution might be to embed the SimpleBLE dylib into the BrainFlow framework in such a way that it does not violate App Store policy. Again I am unable to figure out how to do that or even if it is possible. The relevant BrainFlow code can be found in the init_dll_loader() function of the following code: https://github.com/brainflow-dev/brainflow/blob/master/src/board_controller/ble_lib_board.cpp That function calls DLLLoader(), which can be found here: https://github.com/brainflow-dev/brainflow/blob/master/src/utils/inc/runtime_dll_loader.h Thanks in advance for your thoughtful suggestions and comments.
Posted
by
Post not yet marked as solved
0 Replies
24 Views
I have a Swift app that fetches current conditions and daily forecasts. It is in production and working without issues. My question is whether the fetch I am using counts as a single “request” for usage thresholds, or two (one for current conditions, one for daily forecast)? I need current conditions more often than daily forecast, so if this is counting as two requests, I could refactor the logic to get each separately as needed. But separating the requests would use more quota if the combined fetch counts as a single request. let service = WeatherService() let location = CLLocation(latitude: weatherData.lat, longitude: weatherData.lon) let startOfToday = Calendar.current.startOfDay(for: Date()) let endDate = Calendar.current.date(byAdding: DateComponents(day: 2), to: startOfToday)! let current: CurrentWeather let daily: Forecast<DayWeather> (current, daily) = try await service.weather(for: location, including: .current, .daily(startDate: startOfToday, endDate: endDate))
Posted
by
3no
Post not yet marked as solved
0 Replies
24 Views
I am using below commad line to generate AES-128 HLS, mediafilesegmenter -iso-fragmented --encrypt-key-file=my.key -S -f /Volumes/Samsung/pattern/vision_pro/hls/*** /Volumes/Samsung/pattern/vision_pro/***.mov but it always generates SAMPLE-AES, even I removed -S #EXT-X-KEY:METHOD=SAMPLE-AES,URI="enc.key",IV=0x7316166d6a85f56f3d4606eaebc3aa44 How I can generate AES-128 HLS? Thanks.
Posted
by
Post not yet marked as solved
1 Replies
51 Views
Hi, our Apple Developer membership expired 5 days ago. I'm trying to renew it, but on the App Store i only see a note, that I should log into the account on Mac, iPad or iPhone and renew there. Unfortunately there is no Renew button anywhere, neither on my Mac or my iPad that i logged in from. My Settings->Subscriptions are empty. I can find the expired Apple Developer Membership when I login to the "Developer App", but I can only see it on there, not take any action. I can't find any place on appstoreconnect, where I could renew, not on the developer portal, not in the settings/user area of my 2 local devices... Can someone please tell me where to renew our Dev membership?
Posted
by
Post not yet marked as solved
1 Replies
43 Views
The following is a UIKit app with a collection view with one section, whose supplementary view sports a search bar. When you type, it often resigns first responder. import UIKit class ViewController: UIViewController { let words = ["foo", "bar"] var filteredWords = ["foo", "bar"] { didSet { dataSource.apply(self.snapshot) } } var collectionView: UICollectionView! var dataSource: UICollectionViewDiffableDataSource<String, String>! var snapshot: NSDiffableDataSourceSnapshot<String, String> { var snapshot = NSDiffableDataSourceSnapshot<String, String>() snapshot.appendSections(["main"]) snapshot.appendItems(filteredWords) return snapshot } override func viewDidLoad() { super.viewDidLoad() navigationItem.rightBarButtonItem = .init(title: "Apply", style: .plain, target: self, action: #selector(apply)) configureHierarchy() configureDataSource() } @objc func apply() { dataSource.apply(self.snapshot) } func configureHierarchy() { collectionView = .init(frame: .zero, collectionViewLayout: createLayout()) view.addSubview(collectionView) collectionView.frame = view.bounds collectionView.autoresizingMask = [.flexibleWidth, .flexibleHeight] } func createLayout() -> UICollectionViewLayout { UICollectionViewCompositionalLayout { section, layoutEnvironment in var config = UICollectionLayoutListConfiguration(appearance: .insetGrouped) config.headerMode = .supplementary return NSCollectionLayoutSection.list(using: config, layoutEnvironment: layoutEnvironment) } } func configureDataSource() { let cellRegistration = UICollectionView.CellRegistration<UICollectionViewListCell, String> { _, _, _ in } dataSource = .init(collectionView: collectionView) { collectionView, indexPath, itemIdentifier in collectionView.dequeueConfiguredReusableCell(using: cellRegistration, for: indexPath, item: itemIdentifier) } let searchbarHeaderRegistration = UICollectionView.SupplementaryRegistration<SearchBarCell>(elementKind: UICollectionView.elementKindSectionHeader) { cell, elementKind, indexPath in cell.searchBar.delegate = self } dataSource.supplementaryViewProvider = { collectionView, kind, indexPath in collectionView.dequeueConfiguredReusableSupplementary(using: searchbarHeaderRegistration, for: indexPath) } dataSource.apply(self.snapshot, animatingDifferences: false) } } extension ViewController: UISearchBarDelegate { func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { DispatchQueue.main.async { [weak self] in guard let self else { return } filteredWords = words.filter { $0.hasPrefix(searchText) } } } func searchBarTextDidEndEditing(_ searchBar: UISearchBar) { DispatchQueue.main.async { [weak self] in guard let self else { return } filteredWords = words } } } class SearchBarCell: UICollectionViewListCell { let searchBar = UISearchBar() override init(frame: CGRect) { super.init(frame: frame) contentView.addSubview(searchBar) searchBar.pinToSuperview() } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } } extension UIView { func pin( to object: CanBePinnedTo, top: CGFloat = 0, bottom: CGFloat = 0, leading: CGFloat = 0, trailing: CGFloat = 0 ) { self.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ self.topAnchor.constraint(equalTo: object.topAnchor, constant: top), self.bottomAnchor.constraint(equalTo: object.bottomAnchor, constant: bottom), self.leadingAnchor.constraint(equalTo: object.leadingAnchor, constant: leading), self.trailingAnchor.constraint(equalTo: object.trailingAnchor, constant: trailing), ]) } func pinToSuperview( top: CGFloat = 0, bottom: CGFloat = 0, leading: CGFloat = 0, trailing: CGFloat = 0, file: StaticString = #file, line: UInt = #line ) { guard let superview = self.superview else { print(">> \(#function) failed in file: \(String.localFilePath(from: file)), at line: \(line): could not find \(Self.self).superView.") return } self.pin(to: superview, top: top, bottom: bottom, leading: leading, trailing: trailing) } func pinToSuperview(constant c: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { self.pinToSuperview(top: c, bottom: -c, leading: c, trailing: -c, file: file, line: line) } } @MainActor protocol CanBePinnedTo { var topAnchor: NSLayoutYAxisAnchor { get } var bottomAnchor: NSLayoutYAxisAnchor { get } var leadingAnchor: NSLayoutXAxisAnchor { get } var trailingAnchor: NSLayoutXAxisAnchor { get } } extension UIView: CanBePinnedTo { } extension UILayoutGuide: CanBePinnedTo { } extension String { static func localFilePath(from fullFilePath: StaticString = #file) -> Self { URL(fileURLWithPath: "\(fullFilePath)").lastPathComponent } } By the way if you remove the dispatch blocks, the app simply crashes complaining that you're trying to apply datasource snapshots from both the main queue and other queues. Xcode 15.3 iOS 17.4 simulator, MacBook Air M1 8GB macOS Sonoma 14.4.1
Posted
by
Post not yet marked as solved
1 Replies
42 Views
Hi everyone I have an app already on-line on app store connect and I am looking for a way to upload a batch of in-app purchased items (csv file or similar): Can you help? Thank you, Federico
Posted
by
Post not yet marked as solved
2 Replies
60 Views
As an exercise in learning Swift, I rewrote a toy C++ command line tool in Swift. After switching to an UnsafeRawBufferPointer in a critical part of the code, the Release build of the Swift version was a little faster than the Release build of the C++ version. But the Debug build took around 700 times as long. I expect a Debug build to be somewhat slower, but by that much? Here's the critical part of the code, a function that gets called many thousands of times. The two string parameters are always 5-letter words in plain ASCII (it's related to Wordle). By the way, if I change the loop ranges from 0..<5 to [0,1,2,3,4], then it runs about twice as fast in Debug, but twice as slow in Release. func Score( trial: String, target: String ) -> Int { var score = 0 withUnsafeBytes(of: trial.utf8) { rawTrial in withUnsafeBytes(of: target.utf8) { rawTarget in for i in 0..<5 { let trial_i = rawTrial[i]; if trial_i == rawTarget[i] // strong hit { score += kStrongScore } else // check for weak hit { for j in 0..<5 { if j != i { let target_j = rawTarget[j]; if (trial_i == target_j) && (rawTrial[j] != target_j) { score += kWeakScore break } } } } } } } return score }
Posted
by
Post not yet marked as solved
0 Replies
42 Views
Please treat me as a beginner of Unity. Now I want to learn to develop visionOS VR App through unity. I try to find a relatively complete route and start learning, but Unity's official website does not have much explanation for visionOS VR App, so I hope you can give me a comparison. The whole route, thank you!
Posted
by
Post not yet marked as solved
0 Replies
47 Views
I have a customer who wants to protect the REST API of their app with a private certificate. They would then distribute the client certificate to the authorized users. Their app would not work unless the client certificate is already installed on the user's phone before they run the app. I have never done this before. Is it possible to install a client certificate on an iPhone without running an app, for example if it were sent in an email message? And if it is possible, is App Review going to let such an app into the app store? Thanks, Frank
Posted
by
Post not yet marked as solved
0 Replies
33 Views
An error occurred. Unable to import “Apple Development: Name ()”. Error: -25294 Mac mini M1 macOS Sonoma Version 14.4.1
Posted
by
Post not yet marked as solved
0 Replies
38 Views
I noticed that I have duplicate Apps on my iPhone! I've signed up for the Public Beta program, so this might be a feature/bug in the Beta. What I first noticed was that one of my apps showed up in the Doc (I don't remember putting it there) a few days ago, and in looking around, I still have the same app in a folder on my home screen. I thought this could be a nice feature allowing me quick access to it from the Dock and from my folder, but it wasn't the app that I'd want there. I thought I might be able to move it off the dock and back to the folder, but when I did that, the app showed up twice in the folder! I moved a different app to the dock, and it disappeared from the folder which is what I'd expect. So...if I delete 1 of the duplicates in the folder (or from the dock), will that delete both? Here you can see the Alula app in both the 'Remote Control' folder and the Dock: Here too (although the dock is fuzzy because the folder is open): I moved the app from the dock back to the folder, and now there are two there: Here's the Public Beta that I'm running
Posted
by
Post not yet marked as solved
0 Replies
34 Views
Hello, everyone. I'm using Bubble.io to develop a matching app for a transportation company and try to publish it to the App Store by using BDK plugin. The URL of the matching app is as follows https://carrier-s.com I received the following message from the App Store, and I'm not sure what to do. The いいね can be purchased in the app using payment mechanisms other than in-app purchase. If anyone knows anything about in-app purchases, please let me know. Currently, payments are made via Stripe.
Posted
by
Post not yet marked as solved
0 Replies
71 Views
Hello, I've been trying to get my org approved but Apple keeps asking me for documents. I have uploaded certificates of incorporations and that still doesn't work. I wish they were more clear on what type of documentation I need to provide. [Edited by Moderator]
Posted
by
Post not yet marked as solved
0 Replies
42 Views
I am trying to determine the corners of a RoomPlan-detected wall using the information available in the ARView session's frame, but can't quite figure out what I'm doing wrong. The corners appear to be correct relative to each other, but the wall appears too large when I render it. (I'm also not sure I'm handling the image rotation correctly either, which may be compounding my problem). Here is the code I currently have, along with a sample image, and the resulting image when I pass it through the perspective filter. it is close but isn't cropping the walls and floors correctly. func captureSession(_ session: RoomCaptureSession, didChange room: CapturedRoom) { for surface in room.walls { if let frame = self.arView.session.currentFrame { var image: CGImage? = nil VTCreateCGImageFromCVPixelBuffer(frame.capturedImage, options: nil, imageOut: &image) let wallTransform = surface.transform let cameraTransform = frame.camera.transform let intrinsics = frame.camera.intrinsics let projectionMatrix = frame.camera.projectionMatrix let width = surface.dimensions.y let height = surface.dimensions.x let inverseCameraTransform = simd_inverse(cameraTransform) let wallTopRight = simd_float4(width/2, height/2, 0, 1) let wallTopLeft = simd_float4(-width/2, height/2, 0, 1) let wallBottomRight = simd_float4(width/2, -height/2, 0, 1) let wallBottomLeft = simd_float4(-width/2, -height/2, 0, 1) let worldTopRight = wallTransform * wallTopRight let worldTopLeft = wallTransform * wallTopLeft let worldBottomRight = wallTransform * wallBottomRight let worldBottomLeft = wallTransform * wallBottomLeft let cameraTopRight = projectionMatrix * inverseCameraTransform * worldTopRight let cameraTopLeft = projectionMatrix * inverseCameraTransform * worldTopLeft let cameraBottomRight = projectionMatrix * inverseCameraTransform * worldBottomRight let cameraBottomLeft = projectionMatrix * inverseCameraTransform * worldBottomLeft let imageTopRight = intrinsics * simd_float3(cameraTopRight.x / cameraTopRight.w, cameraTopRight.y / cameraTopRight.w, cameraTopRight.z / cameraTopRight.w) let imageTopLeft = intrinsics * simd_float3(cameraTopLeft.x / cameraTopLeft.w, cameraTopLeft.y / cameraTopLeft.w, cameraTopLeft.z / cameraTopLeft.w) let imageBottomRight = intrinsics * simd_float3(cameraBottomRight.x / cameraBottomRight.w, cameraBottomRight.y / cameraBottomRight.w, cameraBottomRight.z / cameraBottomRight.w) let imageBottomLeft = intrinsics * simd_float3(cameraBottomLeft.x / cameraBottomLeft.w, cameraBottomLeft.y / cameraBottomLeft.w, cameraBottomLeft.z / cameraBottomLeft.w) let topRight = CGPoint(x: CGFloat(imageTopRight.x), y: CGFloat(imageTopRight.y)) let topLeft = CGPoint(x: CGFloat(imageTopLeft.x), y: CGFloat(imageTopLeft.y)) let bottomRight = CGPoint(x: CGFloat(imageBottomRight.x), y: CGFloat(imageBottomRight.y)) let bottomLeft = CGPoint(x: CGFloat(imageBottomLeft.x), y: CGFloat(imageBottomLeft.y)) if let image { let filter = CIFilter.perspectiveCorrection() filter.inputImage = CIImage(image: UIImage(cgImage: image)) filter.topRight = topRight filter.topLeft = topLeft filter.bottomRight = bottomRight filter.bottomLeft = bottomLeft let transformedImage = filter.outputImage if let transformedImage { let context = CIContext() if let outputImage = context.createCGImage(transformedImage, from: transformedImage.extent) { let wall = Wall(id: surface.identifier, image: outputImage, surface: surface) self.walls.append(wall) } } } } } }
Posted
by

TestFlight Public Links

Get Started

Pinned Posts

Categories

See all