I'm building a custom camera screen that displays the camera image on a preview layer and then captures an image, using AVCaptureSession. When the picture is captured, I immediately load it into a UIImageView in order to display it to the user for approval.
I've actually done this many times before, but this is the first time I've tried to do it in an app that supports interface rotation. If I hold the phone in Portrait mode and capture a picture, everything works as expected.
When the user rotates the phone into Landscape orientation, I detect this and I replace the preview layer (AVCaptureVideoPreviewLayer) with a new one, specifying connection.videoRotationAngle in order to make the image appear in the right orientation. I'm a little surprised that this is necessary, and it's not a smooth transition, but that doesn't matter.
What does matter is that when I capture the image, it is in the wrong orientation. I tried rotating it myself, but this doesn't seem to make any difference. What am I doing wrong?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm unable to use Organizer due to this error.
The app shown in the error message is an old, unused test app. I'd delete it if I could, but there doesn't seem to be a way to do that.
The app is named "@Home Test" and I suspect that the @ character is what's causing the problem.
I need to use Organizer for a completely different app on another team, but I can't get past this.
Topic:
Developer Tools & Services
SubTopic:
Xcode
I've been aware for some time that Push notifications work on the iOS simulator now -- I see them pop up while I'm working.
However, it would seem that SILENT push notifications do not work. I came to this conclusion only after several frustrating hours of debugging my app, thinking either the app was broken or the server wasn't sending the notification. Finally I tested it on a device and found that it actually works fine.
Why does such a limitation exist? If I can't depend on the simulator to handle ALL of the notifications, I'd rather it didn't work at all. Having it work part of the time on some notifications is really confusing.
Hi,I'm having two problems using the scheduleBuffer function of AVAudioPlayerNode.Background: my app generates audio programatically, which is why I am using this function. I also need low latency. Therefore, I'm using a strategy of scheduling a small number of buffers, and using the completion handler to keep the process moving forward by scheduling one more buffer for each one that completes.I'm seeing two problems with this approach:One, the total memory consumed by my app grows steadily while the audio is playing, which suggests that the audio buffers are never being deallocated or some other runaway process is underway. (The Leaks tool doesn't detect any leaks, however).Two, audio playback sometimes stops, particularly on slower devices. By "stops", what I mean is that at some point I schedule a buffer and the completion block for that buffer is never called. When this happens, I can't even clear the problem by stopping the player.Now, regarding the first issue, I suspected that if my completion block recursively scheduled another buffer with another completion block, I would probably end up blowing out the stack with an infinite recursion. To get around this, instead of directly scheduling the buffer in the completion block, I set it up to enqueue the schedule in a dispatch queue. However, this doesn't seem to solve the problem.Any advice would be appreciated. Thanks.
Hi,I'm having a really weird problem. Brand new project, using a UINavigationController. I want to set the background color of my navigation bar to match the background color of my root view controller.I thought that this was the right way to do it: [[UINavigationBar appearance] setTranslucent:NO];
[[UINavigationBar appearance] setBarTintColor:[UIColor colorWithRed:0x2d/255.0 green:0x55/255.0 blue:0x97/255.0 alpha:1.0]];However, this generates a navigation bar with a color value of #234185 instead of the expected #2D5597. What is the explanation for this, and how do I fix it?Thanks,Frank
Hi,How do I check to see if a Character is in a Character Set?In Objective-C, I could write:[[NSCharacterSet lowercaseLetterCharacterSet] characterIsMember:c]Where "c" is a variable of type char.In Swift, I tried to write:CharacterSet.lowercaseLetters.contains(c)Where "c" is of type Character, but I received an error saying that the function was expecting a parameter of type "Unicode.Scalar".Thanks,Frank
Hi,I have a universal app that uses the camera along with a preview layer (AVCaptureVideoPreviewLayer) to display a preview of the live camera view.It works fine on an iPhone and fine on an iPad as long as my app is full screen.However, if I open another app in split-view mode, my app loses its live camera view and freezes on the last frame captured.I've tried stopping the AVCaptureSession before the transition and restarting it afterward, and even tearing the whole thing down and building a new one, but neither works.My app is checking permissions and the permissions are fine, and all of the objects created seem valid.Is there some rule that disallows apps from accessing the camera in split screen mode?Frank
Hi,I'm familiar with the "willTransition" method of view controllers that lets you detect when a transition to a new UITraitCollection is about to begin.What I need is a callback that happens after the transition is finished. There doesn't seem to be any "didTransition" method, nor any delegate property on the UIViewControllerTransitionCoordinator that I can use for this.How does one obtain this callback?Thanks,Frank
How do I get a background image to fill the screen in my launch screen on an iPhone X?I have aligned the image to the top and bottom layout guides, but this leaves large white gaps.
Whenever I try to upload an app from Xcode, I get this error right as the file upload begins:
App Store Connect Operation Error
An error occurred uploading to the App Store.
This is not a transient problem. I have had this issue for months, ever since I started using an M1 Mac Mini for most of my development.
The only workaround I've been able to find so far is to use a different Mac to upload my builds. Luckily, I have another one, but I'm getting tired of doing this.
Both Macs are running the same version of Mac OS, same version of Xcode, and are on the same Wifi network. I also checked to make sure the network settings are identical.
How can I debug this problem?
Hi,
I've been asked to estimate a project that would require ARKit, unfortunately I'm new to the technology and need some quick answers as to how it works.
The app my customer wants to build would overlay simple graphics at street addresses, as the user pointed their camera at buildings or storefronts.
For this to work, I'd need to be able to have the AR view tell me what map locations or street addresses are being seen in the camera view. Is this possible?
Thanks,
Frank
I need to do something that seems simple but I can't figure out the right syntax.
Given a string, I need to search for the first occurrence of a substring (not a character). If found, I need to create a new string by removing the part of the old string that is before the substring.
I can't see how this is done in Swift. There is a "firstIndexOf" function, but it only searches for one character at a time.
I also know that there is a "range(of:)" function, but I can't find its documentation, and I don't know what the return type is, or how I would use it.
Thanks,
Frank
Hi,
I'm looking at the function activityViewController(_:dataTypeIdentifierForActivityType:) in the UIActivityItemSource protocol. The documentation says "For items that are provided as data, returns the UTI for the item." The return type of the function is a String.
I don't know what "UTI" means in this context. The data I'm trying to provide is an HTML document (a string containing HTML). I tried returning "text/html", but I don't think this worked.
I'm also unsure whether my "itemForActivityType" function ought to be providing the HTML as a String, or perhaps converting it to Data first.
The end result I'm seeing is that I can share the HTML document via Mail, and it looks fine, but if I try to air drop it, I get an error that says "Extension request contains input items but the extension point does not specify a set of allowed payload classes."
I'd like my app to be able to share the HTML document via Mail or Airdrop. I don't care if it doesn't support sharing to any other services.
Thanks,
Frank
I have an app that I distribute to an Enterprise customer via private app store distribution. Recently, I published an update. The update went through the App Store review process, was approved, and is currently listed as Ready for Sale.
However, my Enterprise customer says he cannot access the update. His view of the app still shows the latest version as being the prior version.
I can't figure out what is wrong. Is there some additional step I need to take to make sure the app is available to him?
Thanks,
Frank
Topic:
App Store Distribution & Marketing
SubTopic:
App Store Connect
Tags:
Enterprise
App Store Connect
I'm not getting any values from the floorsAscended or floorsDescended properties of CMPedometerData. I tested it by walking up and down a flight of stairs twice while monitoring for pedometer updates for 60 seconds. I also queried for the pedometer data separately at the end of the time period in case there were any updates I missed.
I'm using an iPhone 13 pro for my tests and I did check to make sure CMPedometer.isFloorCountingAvailable() is true, and I am getting other kinds of pedometer data such as distance, pace, and steps.
Is there something else I need to do in order to enable floor counting?
Thanks,
Frank