Post

Replies

Boosts

Views

Activity

Animating SCNCamera.fStop with property key path doesn't work, only inside implicit SCNTransaction
This code strangely doesn't animate the fStop: cameraNode.camera!.wantsDepthOfField = true cameraNode.camera!.focusDistance = 2 let animation = CABasicAnimation(keyPath: "fStop") animation.toValue = 0.5 animation.duration = 0.3 cameraNode.camera!.addAnimation(animation, forKey: nil) while this one does: SCNTransaction.begin() SCNTransaction.animationDuration = 0.3 cameraNode.camera!.fStop = 0.5 SCNTransaction.commit() Why?
0
0
470
Feb ’21
SceneKit objects become sharp when viewed through non-opaque objects with depth of field enabled
By adding this code to the default SceneKit Xcode project, one can reproduce the issue (the default ship object is blurred when viewed directly by the camera, and sharp when viewed through the semi-transparent square): cameraNode.camera!.wantsDepthOfField = true cameraNode.camera!.focusDistance = 2 cameraNode.camera!.fStop = 0.5 let plane = SCNNode(geometry: SCNPlane(width: 1, height: 1)) plane.position = SCNVector3(x: 0.5, y: 0, z: 13) plane.opacity = 0.5 scene.rootNode.addChildNode(plane) Is this something expected, and is there a workaround for making objects seen through semi-transparent objects appear blurred as well?
0
0
628
Feb ’21
Playing back audio recorded with AVCaptureAudioDataOutput
I'm trying to record video and audio and sending them over the network so that they can be played back in real time on other clients. I've managed to record and play back video successfully, but audio still cannot be played back (see AVAudioPlayer at the bottom of the code below). What am I doing wrong or what is missing? Thank you in advance for any input. let captureSession = AVCaptureSession() private func startVideoAudioFeed() {     let sessionPreset = AVCaptureSession.Preset.low     if captureSession.canSetSessionPreset(sessionPreset) {         captureSession.sessionPreset = sessionPreset     }     switch AVCaptureDevice.authorizationStatus(for: .video) {     case .notDetermined:         AVCaptureDevice.requestAccess(for: .video) { success in             self.startVideoAudioFeed()         }     case .authorized:         captureSession.beginConfiguration()         let captureVideoDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .front)!         let captureVideoInput = try! AVCaptureDeviceInput(device: captureVideoDevice)         if captureSession.canAddInput(captureVideoInput) {             captureSession.addInput(captureVideoInput)         }         let captureVideoOutput = AVCaptureVideoDataOutput()         captureVideoOutput.setSampleBufferDelegate(self, queue: DispatchQueue.main)         if captureSession.canAddOutput(captureVideoOutput) {             captureSession.addOutput(captureVideoOutput)         }         captureSession.commitConfiguration()         captureSession.startRunning()     default:         break     }     switch AVCaptureDevice.authorizationStatus(for: .audio) {     case .notDetermined:         AVCaptureDevice.requestAccess(for: .audio) { success in             self.startVideoAudioFeed()         }     case .authorized:         captureSession.beginConfiguration()         let captureAudioDevice = AVCaptureDevice.default(for: .audio)!         let captureAudioInput = try! AVCaptureDeviceInput(device: captureAudioDevice)         if captureSession.canAddInput(captureAudioInput) {             captureSession.addInput(captureAudioInput)         }         let captureAudioOutput = AVCaptureAudioDataOutput()         captureAudioOutput.audioSettings = [AVFormatIDKey: kAudioFormatLinearPCM, AVNumberOfChannelsKey: NSNumber(value: 1), AVSampleRateKey: NSNumber(value: 44100)]         captureAudioOutput.setSampleBufferDelegate(self, queue: DispatchQueue.main)         if captureSession.canAddOutput(captureAudioOutput) {             captureSession.addOutput(captureAudioOutput)         }         captureSession.commitConfiguration()     default:         break     } } func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {     if let imageBuffer = sampleBuffer.imageBuffer {         let ciImage = CIImage(cvPixelBuffer: imageBuffer)         let cgImage = CIContext().createCGImage(ciImage, from: ciImage.extent)!         let data = CFDataCreateMutable(nil, 0)!         let imageDestination = CGImageDestinationCreateWithData(data, kUTTypeJPEG, 1, nil)!         CGImageDestinationAddImage(imageDestination, cgImage, [kCGImageDestinationLossyCompressionQuality: NSNumber(value: 0)] as CFDictionary)         CGImageDestinationFinalize(imageDestination)         play(data: data as Data)     } else if let dataBuffer = sampleBuffer.dataBuffer {         let data = try! dataBuffer.dataBytes()         play(data: data)     } } private func play(data: Data) {     if let image = CGImage(jpegDataProviderSource: CGDataProvider(data: data as CFData)!, decode: nil, shouldInterpolate: false, intent: .defaultIntent) { 				// image is a valid image     } else if let audioPlayer = try? AVAudioPlayer(data: data) {         audioPlayer.play() 				// audioPlayer is always nil with error: Error Domain=NSOSStatusErrorDomain Code=1954115647 "(null)"     } }
0
0
992
Feb ’21
Xcode crashes when distributing product for App Store Connect
After building the Product Archive, the Organizer window opens, I click Distribute App. Next. Next. Next. Next. Crash. The crash happens before I'm able to export anything, so I cannot even use the Application Loader. The last message above the indeterminate progress indicator I can read before it crashes is "Packaging MyApp ...". It would be really nice if an Apple engineer could help sort this out, because I already contacted the App Store Connect support and they told me that the only way I can get help is by writing on this forum, searching the Xcode documentation, or using one of the 2 free TSIs I get each year (which I have already used). Stacktrace (I tried to paste the whole crash report, but I get an error that the message is too long and that I should click on the icon to attach a file instead, but I don't see such an icon): Process:&#9;&#9;&#9;&#9;&#9;&#9;&#9; Xcode [834] Path:&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;/Applications/Xcode.app/Contents/MacOS/Xcode Identifier:&#9;&#9;&#9;&#9;&#9;&#9;com.apple.dt.Xcode Version:&#9;&#9;&#9;&#9;&#9;&#9;&#9; 12.2 (17535) Build Info:&#9;&#9;&#9;&#9;&#9;&#9;IDEFrameworks-17535000000000000~23 (12B45b) App Item ID:&#9;&#9;&#9;&#9;&#9; 497799835 App External ID:&#9;&#9;&#9; 838360538 Code Type:&#9;&#9;&#9;&#9;&#9;&#9; X86-64 (Native) Parent Process:&#9;&#9;&#9;&#9;??? [1] Responsible:&#9;&#9;&#9;&#9;&#9; Xcode [834] User ID:&#9;&#9;&#9;&#9;&#9;&#9;&#9; 501 Date/Time:&#9;&#9;&#9;&#9;&#9;&#9; 2020-12-07 17:22:11.231 +0100 OS Version:&#9;&#9;&#9;&#9;&#9;&#9;macOS 11.0.1 (20B29) Report Version:&#9;&#9;&#9;&#9;12 Bridge OS Version:&#9;&#9; 3.0 (14Y908) Anonymous UUID:&#9;&#9;&#9;&#9;7A3F67B1-D68A-4230-40B2-B7EE13B51792 Sleep/Wake UUID:&#9;&#9;&#9; 4913FE52-7DB5-45E0-9396-EFBA2ADD0B5C Time Awake Since Boot: 47000 seconds Time Since Wake:&#9;&#9;&#9; 5900 seconds System Integrity Protection: enabled Crashed Thread:&#9;&#9;&#9;&#9;17&#9;Dispatch queue: ConcurrentQueue: -[IDEDistributionPackagingStepViewController viewDidInstall]_block_invoke Exception Type:&#9;&#9;&#9;&#9;EXC_CRASH (SIGABRT) Exception Codes:&#9;&#9;&#9; 0x0000000000000000, 0x0000000000000000 Exception Note:&#9;&#9;&#9;&#9;EXC_CORPSE_NOTIFY Application Specific Information: Possibly stale failure hints from 2020-12-07 16:21:03 +0000: &#9;0: Calling block provided by: &#9;0&#9; DVTDispatchAsync (in DVTFoundation) &#9;1&#9; __56-[IDEArchiveProductSource updateArchivesWithCompletion:]_block_invoke_2 (in IDEProducts) &#9;2&#9; DVT_CALLING_CLIENT_BLOCK (in DVTFoundation) &#9;3&#9; __DVTDispatchAsync_block_invoke (in DVTFoundation) &#9;4&#9; _dispatch_call_block_and_release (in libdispatch.dylib) &#9;5&#9; _dispatch_client_callout (in libdispatch.dylib) &#9;6&#9; _dispatch_continuation_pop (in libdispatch.dylib) &#9;7&#9; _dispatch_async_redirect_invoke (in libdispatch.dylib) &#9;8&#9; _dispatch_root_queue_drain (in libdispatch.dylib) &#9;9&#9; _dispatch_worker_thread2 (in libdispatch.dylib) 10&#9; _pthread_wqthread (in libsystem_pthread.dylib) 11&#9; start_wqthread (in libsystem_pthread.dylib) ProductBuildVersion: 12B45b ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-17518/DVTFoundation/FilePaths/DVTFilePath.m:912 Details:&#9;url should be an instance inheriting from NSURL, but it is nil Object:&#9; <DVTFilePath> Method:&#9; +filePathForFileURL: Thread:&#9; <NSThread: 0x7fa6c43458e0>{number = 4468, name = (null)} Open FDs: 115/7168 Hints:&#9; &#9;0: Calling block provided by: &#9;0&#9; DVTDispatchAsync (in DVTFoundation) &#9;1&#9; DVTAsyncPerformBlock (in DVTFoundation) &#9;2&#9; -[IDEDistributionPackagingStepViewController viewDidInstall] (in IDEKit) &#9;3&#9; -[DVTViewController _viewDidInstall] (in DVTViewControllerKit) &#9;4&#9; -[_DVTViewController_ViewLifecycleInterpositions viewDidMoveToWindow] (in DVTViewControllerKit) &#9;5&#9; -[NSView _setWindow:] (in AppKit) &#9;6&#9; -[NSView addSubview:] (in AppKit) &#9;7&#9; -[NSView setSubviews:] (in AppKit) &#9;8&#9; -[DVTBorderedView setContentView:] (in DVTUserInterfaceKit) &#9;9&#9; -[IDEDistributionAssistantWindowController setDistributionStepViewController:] (in IDEKit) 10&#9; -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:maybeNewValuesDict:usingBlock:] (in Foundation) 11&#9; -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] (in Foundation) 12&#9; _NSSetObjectValueAndNotify (in Foundation) 13&#9; -[IDEDistributionAssistantWindowController next:] (in IDEKit) 14&#9; __79-[IDEDistributionAutomaticSigningAssetsStepViewController _locateSigningAssets]_block_invoke_2 (in IDEKit) 15&#9; DVT_CALLING_CLIENT_BLOCK (in DVTFoundation) 16&#9; ___DVTAsyncPerformBlockOnMainRunLoop_block_invoke (in DVTFoundation) 17&#9; CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK (in CoreFoundation) 18&#9; __CFRunLoopDoBlocks (in CoreFoundation) 19&#9; __CFRunLoopRun (in CoreFoundation) 20&#9; CFRunLoopRunSpecific (in CoreFoundation) 21&#9; RunCurrentEventLoopInMode (in HIToolbox) 22&#9; ReceiveNextEventCommon (in HIToolbox) 23&#9; _BlockUntilNextEventMatchingListInModeWithFilter (in HIToolbox) 24&#9; _DPSNextEvent (in AppKit) 25&#9; -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] (in AppKit) 26&#9; -[DVTApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in DVTKit) 27&#9; -[NSApplication run] (in AppKit) 28&#9; NSApplicationMain (in AppKit) 29&#9; start (in libdyld.dylib) Backtrace: &#9;0&#9; -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in IDEKit) &#9;1&#9; _DVTAssertionHandler (in DVTFoundation) &#9;2&#9; _DVTAssertionFailureHandler (in DVTFoundation) &#9;3&#9; +[DVTFilePath filePathForFileURL:] (in DVTFoundation) &#9;4&#9; -[IDEDistributionSymbolsStep runWithError:] (in IDEFoundation) &#9;5&#9; -[IDEDistributionProcessingPipeline process:] (in IDEFoundation) &#9;6&#9; -[IDEDistributionPackagingStepViewController _runPipeline] (in IDEKit) &#9;7&#9; __60-[IDEDistributionPackagingStepViewController viewDidInstall]_block_invoke_2 (in IDEKit) &#9;8&#9; DVT_CALLING_CLIENT_BLOCK (in DVTFoundation) &#9;9&#9; __DVTDispatchAsync_block_invoke (in DVTFoundation) 10&#9; _dispatch_call_block_and_release (in libdispatch.dylib) 11&#9; _dispatch_client_callout (in libdispatch.dylib) 12&#9; _dispatch_continuation_pop (in libdispatch.dylib) 13&#9; _dispatch_async_redirect_invoke (in libdispatch.dylib) 14&#9; _dispatch_root_queue_drain (in libdispatch.dylib) 15&#9; _dispatch_worker_thread2 (in libdispatch.dylib) 16&#9; _pthread_wqthread (in libsystem_pthread.dylib) 17&#9; start_wqthread (in libsystem_pthread.dylib) abort() called Application Specific Signatures: (url) != nil ...
10
0
3.4k
Apr ’21
How to disable weekly "We are interested in investigating your feedback" reminders
Since a year or so I get frequent email reminders for feedbacks to which Apple answered and to which I still didn't reply. The interval between Apple's answer and the automatic reminder can be as small as 5 days and are repeated weekly until I respond to them. There is apparently no way of disabling them. How can it be that I have to respond within 5 days and Apple can take up to 8 years (the longest I've waited for a response for now)? I've already reported this several times but to no avail. I would also like to be able to send weekly reminders to Apple for not responding to pressing issues, but unfortunately that's not possible and this comes across as being quite arrogant.
2
0
662
Jun ’21
No email notification for answers to own posts
It's been known for at least 4 months that there is no email notification for answers to own posts, like an Apple engineer confirmed here https://developer.apple.com/forums/thread/656787?login=true Why does it take so long to fix a basic issue like this? How long will we have to check daily for new answers without being able to count on a simple notification?
9
0
1.5k
Nov ’21
Resolve bookmark created in iOS app in Share Extension
I create a URL bookmark with URL.bookmarkData(options: [], includingResourceValuesForKeys: [.localizedNameKey]) and resolve it with NSURL(resolvingBookmarkData: bookmarkData, options: [], relativeTo: nil, bookmarkDataIsStale: nil) asURL. This works fine within my main app, but when sharing the bookmarkData via an App Group with my Share Extension, it gives the error "The file couldn't be opened because you don't have permission to view it.". Is there any way I can do this?
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
488
Nov ’21
"Frame for "View" will be different at runtime" keeps reappearing with always different frame
For a couple of years now Xcode has been showing many similar warnings when opening a storyboard file. I have opened FB8245368 more than a year ago without response. If there is a way of solving these warnings inside the storyboard without adding artificial constraints that are removed at build time? Open the project at https://www.icloud.com/iclouddrive/0bNxa2_8jNRVFbpKsTyrB5yMg#problem Select that warning, then click Update Frames at the bottom right of the canvas. You can keep pressing the button until the view is entirely collapsed.
0
0
721
Nov ’21
Setting UITextView text color after text change causes caret rect to jump up and down
It seems that when typing inside a textview that has insets and padding, the caret keeps jumping up and down on most keystrokes. Is there a solution to this? class ViewController: UIViewController, UITextViewDelegate {     @IBOutlet weak var textView: TextView!     override func viewDidLayoutSubviews() {         let h = textView.bounds.size.height / 2         textView.textContainerInset = UIEdgeInsets(top: h, left: 0, bottom: h, right: 0)         textView.textContainer.lineFragmentPadding = 200     }     func textViewDidChange(_ textView: UITextView) {         textView.textStorage.addAttribute(.foregroundColor, value: UIColor.red, range: NSRange(location: 0, length: 1))     } } class TextView: UITextView {     override func caretRect(for position: UITextPosition) -> CGRect {         let r = super.caretRect(for: position)         print(r)         return r     } } A complete project can be found here: https://www.icloud.com/iclouddrive/0yEBQZPUCZQH1o3HiL8_6q_gQ#problem_copia
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
634
Nov ’21
How to download and install old macOS versions
I haven‘t yet found an official Apple website that lists older macOS versions. Fortunately, I have kept the installers on a separate external storage after each major upgrade, but when launching them from a macOS version newer that the installer itself, macOS shows an error that it‘s not possible to install it. What is the official way of installing older macOS versions so that I can test my App Store apps?
4
0
3.5k
Nov ’21
Xcode thinks iPad is not connected when deploying
Every now and then (say at least once a week, but possibly many times within a day) when I try to deploy to my iPad Xcode shows a sheet reading "iPad is not connected", even if it was working a minute earlier. I have reported this already several months ago, but apparently there is no fix for this yet. Usually, restarting Mac and/or iPad solves the issue, but it's really annoying when I have to do this repeatedly. Is there an easier workaround?
0
0
353
Nov ’21
Xcode projects do not build anymore after uploading them to Feedback Assistant
For many months now, projects that I download from most of the feedbacks I submit don't build anymore: some settings in the Xcode project get changed for some reason at some stage so that the directory structure is wrong. The top level folder named after the project is highlighted in red and the only compiler error is about the missing entitlements file, even though all the files are in the project folder. I already reported this months ago but this is still happening. What's the problem and why is there no solution to this yet?
0
0
482
Nov ’21
Why does Apple not mark solved bugs as solved?
I keep noticing that some bugs that I reported or features that I suggested have been corrected or added to the latest OS. For one of these I replied asking why I wasn't notified and never got an answer. Isn't Apple interested in closing as many feedbacks as possible? Now I cannot even say that perhaps I formulated them in such a way that they don't understand, because they don't seem to reply altogether.
2
0
596
Nov ’21