Post

Replies

Boosts

Views

Activity

Question: How to stop a sound that has lost control (AVSpeechSynthesizer)
I'm struggling with a recent bug in iOS 16. There are various errors and bugs Currently struggling with AVSpeechSynthesizer. AutoReleasePool crashes frequently. I also posted a similar post on the forum before. https://developer.apple.com/forums/tags/speech There seems to be a lot of similar cases in the forum posts above. When AVSpeechSynthesizer is stopped, it does not stop immediately, but continues to play to the end. In that situation, even if you stop again, you lose control and cannot stop. Is there any way to stop the currently playing sound at will when I lose control like this? (I was also able to confirm that the error persisted without being fixed when I tested it on a device that just installed the 16.2 beta.)
2
0
939
Nov ’22
The problem that specific character height and spacing 0 cannot be set using NSMutableAttributedString
We are adding a function to change the height and spacing of only certain characters (NewLine) using NSMutableAttributedString. Set font size to 0 and lineSpacing to 0. For characters other than specific characters, enter the font size and lineSpacing separately. (e.g. font size = 28.0 / lineSpacing = 16.0) When applied to UITextView , the space in that part is higher than the lineSpacing set for other lines. (In other words, I set the font size and linespace to 0 for a blank line, but the height occurs in the blank line.) I thought that by setting the font size and lineSpacing to 0, the line height would be 0. But it doesn't appear that way. Does anyone know of this issue? If there is something I don't understand, please let me know, it will help me to solve it. The iOS version is being developed in the 16.1 environment.
0
0
1.1k
Oct ’22
Has anyone solved the UITableView text persistence or overlapping issue in iOS 16.1 iPhone 14 Pro and 14 Pro Max?
Has anyone solved the UITableView text persistence or overlapping issue in iOS 16.1 iPhone 14 Pro and 14 Pro Max? If anyone has solved the problem by modifying the code, please reply. I posted on the forum a while ago and forwarded the issue to Apple Feedback. Link to the forum post: https://developer.apple.com/forums/thread/718401 (Sample code and video links are in the article above.) However, it was confirmed today that iOS 16.1 did not improve on the iPhone 14 Pro Max. After making the cell of UITableView display text with UITextView or UILabel The text color is set to black and the background to white. (The afterimage is displayed in black, so it must be reproduced with a white background.) UITableView srollToRow Calls the next or previous Row in the current Row without any animation effects as shown in the code below. tableView!.scrollToRow(at: IndexPath(row: self.pIndex, section: 0), at: .top, animated: false) And the call to scrollToRow is UITapGestureRecognizer , which makes it scroll one page at a time when the user taps. At this time, the cell height of UITableView is set to the total height of the device. This will briefly display the text content that was just previously displayed in black. (Sometimes it is displayed a little longer.) So the current page text and the previous page text overlap. There is a phenomenon that the contents of the previous page disappear. In a slightly animated effect, it feels like a transition to the next page, leaving an afterimage of the previous page content. But I didn't add any animation effects in the motion. This is definitely happening on the iPhone 14 Pro and 14 Pro Max. We think it might be an iOS error. I don't think it will be improved as iOS will be updated soon. (No feedback from Apple as of today.) So, if you have experienced the same problem and solved it through code, please help. Even if it is improved with an OS update in the future, there are users who are currently uncomfortable, so if there is a way, I am thinking of including it in the app update.
1
0
1.2k
Oct ’22
UITableView scrollToRow When switching to the next or previous page, the contents of the previous page do not disappear immediately, but remain as an afterimage and overlap for a while.
UITableView scrollToRow When switching to the next or previous page, the contents of the previous page do not disappear immediately, but remain as an afterimage and overlap for a while. Use UITableView's scrollToRow to switch to the previous or next page. There were no strange symptoms until iOS 15. However, starting with iOS 16, there is a strange phenomenon. Make scrollToRow work with no animation. (code below) tableView!.scrollToRow(at: IndexPath(row: self.pIndex, section: 0), at: .top, animated: false) When I keep switching to the next or previous page, the content displayed on the next or previous page remains as an afterimage and disappears. So, the contents of the page you moved briefly to and the contents of the previous page are overlapped. And the contents of the previous page disappear. Does anyone have a cause or solution for this issue? This is especially the case with the iPhone 14 Pro or 14 Pro Max, but the same phenomenon occurs even if the promotional display function is disabled. In info.plist, the CADisableMinimumFrameDurationOnPhone value is set to YES. And when I switch pages with scrollToRow , it happens when I switch from the current page to the next or previous page. But when I switch to a page that is a bit far from the current page, it doesn't seem to happen. The same phenomenon does not occur in iPhone 8 and iPhone 12 Pro Max with iOS 16.0.3 installed, such as iPhone 14 Pro Max.
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
1.3k
Oct ’22
An issue where the content of the dynamic island disappears and is displayed repeatedly
An issue where the content of the dynamic island disappears and is displayed repeatedly The issue is similar to the one below. https://developer.apple.com/forums/thread/717795 Currently using the function to make the bottom home indicator disappear with setNeedsUpdateOfHomeIndicatorAutoHidden In case the status bar information is always displayed at the top As the bottom home indicator appears and disappears, the content of the dynamic island also appears and disappears. Although this is Apple's intention, users who watch the content for a long time may think that this is a bug or an error in the app because the dynamic island at the top repeatedly appears and disappears repeatedly. Our app is an app for viewing documents. At the bottom, there are many users who do not like that the home indicator is always on, so a function (optional) that automatically disappears unless you touch it is implemented. And the status bar information is always displayed at the top of the content viewing screen. (battery or time information) In that situation, when you switch to a tab page, the home indicator and dynamic island icon or text at the bottom are displayed and disappear again if you do not tap. This phenomenon repeats over and over again as the pages are turned. (Because users keep repeating tabs as they turn pages) While viewing the content, the icon or text of the Dynamic Island keeps appearing and disappearing. For example, the issue arises when the content is always displayed on the dynamic island as shown below. Alarm triggered by Apple's default app Connect to other Bluetooth devices Tethering Hopefully Apple will provide an option to separate the disappearance of the bottom home bar from the disappearance of the dynamic island content on the top. Set the option to make the home bar disappear to True, and we hope to provide an option where the content of the dynamic island is always maintained even when the status bar is displayed. video link https://youtube.com/shorts/0Qn6qTELxmg?feature=share
Topic: UI Frameworks SubTopic: UIKit Tags:
0
0
1.8k
Oct ’22
Dynamic Island appears and then disappears
Trigger an alarm on the iPhone 14 Pro Max so that the time is displayed on the dynamic island at the top. And when you perform a specific action in the currently sold app, the time or icon displayed on the dynamic island appears and disappears. Is there anything special I need to do in my app to just keep the current dynamic island icon or time display? Other apps seem to keep the time or icon displayed on the dynamic island. Add We confirmed that if we make the bottom home indicator disappear automatically with setNeedsUpdateOfHomeIndicatorAutoHidden, the dynamic island also disappears. Is there a way to setNeedsUpdateOfHomeIndicatorAutoHidden to show the current dynamic island even though the home bar disappears? Some users believe that the app is malfunctioning because it repeats that the content of the dynamic island is displayed when you touch the app and disappears when you don't touch it.
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
2k
Oct ’22
AVSpeechSynthesizer continues to play even after playback stops and the app crashes (iOS 16+)
Currently, there is an issue that only occurs on iOS 16 devices. We provide TTS function to pronounce Text using AVSpeechSynthesizer. When I stop AVSpeechSynthesizer, sometimes the sentence is played without stopping. After that, if we put nil or declare a new AVSpeechSynthesizer object like the code below "self.synthesizer = nil or self.synthesizer = AVSpeechSynthesizer()" The app crashes. This issue was previously posted on the forum https://developer.apple.com/forums/thread/716963 It's like this problem. (It is believed to be the cause of this problem.) This phenomenon occurs randomly when playing, stopping, and repeating a sentence. So it is not easy to reproduce. We're getting crash reports from our app, but it's only happening on iOS 16 devices. Does anyone have a cause or solution for this symptom? I've been looking for a solution for a few weeks now and haven't been able to find a suitable solution. We believe this may be a bug in iOS 16. I am currently testing on the latest version of iOS 16.0.3. It still happens occasionally. If we can reproduce this phenomenon with 100% probability, we will give feedback to Apple, but we have to repeat it several times, so we do not think about feedback. and additionally Even when leaving the current screen, the app dies after this happens. If we nil or not initialize the AVSpeechSynthesizer object after stopping the TTS loop in our app, "self.synthesizer!.speak(utterance)" As in the code above, there is a phenomenon that playback does not play even if you try to play it.
0
0
755
Oct ’22
Is there any way to fix screen rotation in iPad apps that don't use the Requires Full Screen option?
Is there a way to lock the rotation of the app when the app is in full screen state in an iPad app that doesn't use Requires Full Screen? Disable Requires Full Screen option func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) I know that even if the above function returns a value that locks the rotation, the device is not. But iPad users who use my app send me an email asking if I can provide a function to lock the rotation of the app. I would like to know if there is a way to lock the rotation even when in full screen. Or can't Apple support it in a future update?
0
0
703
Oct ’22
Can you tell me the cause of the crash that occurs when AVSpeechSynthesizer is stopped?
We are providing the ability to speak text in our app using AVSpeechSynthesizer . Stop the AVSpeechSynthesizer at random I get a crash like the screenshot below. What causes this error to occur? It happens occasionally during testing, but it doesn't go away even if I fix it in various ways. Is this a bug in iOS or is there something I need to fix or add? If a crash occurs, the message below is also displayed in the log window during debugging. [AXTTSCommon] _BeginSpeaking: speech cancelled error: Error Domain=TTSErrorDomain Code=-4005 "(null)" [AXTTSCommon] _BeginSpeaking: couldn't begin playback TTS Create Code let utterance = AVSpeechUtterance(string: playText) if Singletone.sharedInstance().ttsIdentifier != nil { utterance.voice = AVSpeechSynthesisVoice(identifier: Singletone.sharedInstance().ttsIdentifier!) } else {         utterance.voice = AVSpeechSynthesisVoice(language: "en-US") }          utterance.rate = 0.4 utterance.pitchMultiplier = 1.0 utterance.preUtteranceDelay = -1.0 utterance.postUtteranceDelay =  -1.0 utterance.volume = 1.0          if self.synthesizer == nil { self.synthesizer = AVSpeechSynthesizer() self.synthesizer!.delegate = self }          self.synthesizer!.speak(utterance) TTS Stop Code self.synthesizer!.stopSpeaking(at: .immediate) self.synthesizer!.delegate = nil self.synthesizer = nil
1
0
1.1k
Oct ’22
In Live Text API, text selection or clicking the highlight button on the right does not work
I am implementing Live Text function using ImageAnalysisInteraction and ImageAnalyzer. After loading an image file into UIImageView , I am trying to implement a function to select like a TextView using Live Text function. On the right side of the UIImageView, a button to change the Live Text highlight state is displayed. However, there is a phenomenon that this button cannot be clicked. Also, even if you change the highlight state to Live Text, it is not selected like UITextView. imageView.addInteraction(interaction) I added an interaction to the imageview like this. Even if I keep changing preferredInteractionTypes to multiple types, there is no choice. interaction.view!.isUserInteractionEnabled = true imageView.isUserInteractionEnabled = true So I also changed the isUserInteractionEnabled value to true . Have any of you solved this problem?
0
0
987
Oct ’22
Error when using Live Text API
I am developing a function using Live Text. (I used ImageAnalyzer and ImageAnalysisInteraction.) When executed, the following error log is displayed and the Live Text Button is displayed but not clicked or highlighted. That is, it does nothing. [Unknown process name] Error: this application, or a library it uses, has passed an invalid numeric value (NaN, or not-a-number) to CoreGraphics API and this value is being ignored. Please fix this problem. [Unknown process name] If you want to see the backtrace, please set CG_NUMERICS_SHOW_BACKTRACE environmental variable. [api] -[CIImage initWithCVPixelBuffer:options:] failed because the buffer is nil. Are there any possible causes and solutions for this not working? Or is there a setting I'm missing in order to use LiveText? Below is part of the code. Changing preferredInteractionTypes to all types doesn't change anything. UIImageViews are displayed by switching left and right through UIPageViewController and calling the LiveText function. Task { var analyzer:ImageAnalyzer? = ImageAnalyzer()             if analyzer == nil {                 return             }             let configuration = ImageAnalyzer.Configuration([.text])             do {                 let pAnalysis = try await analyzer!.analyze(image!, configuration: configuration)                 DispatchQueue.main.async {                                          //interaction!.preferredInteractionTypes = .automatic                     interaction.preferredInteractionTypes = .textSelection                     //interaction!.preferredInteractionTypes = .dataDetectors                     //interaction!.preferredInteractionTypes = [.textSelection, .dataDetectors]                     //interaction.preferredInteractionTypes = [.textSelection, .dataDetectors, .automatic]                     interaction.selectableItemsHighlighted = true                     interaction.analysis = pAnalysis                     interaction.setContentsRectNeedsUpdate()                 }             } catch {}             analyzer = nil }
0
1
1.3k
Sep ’22
Does repurchasing non-consumable items have the same effect as restoration?
I have a question about Apple in-app purchases. If a user purchases a non-consumable item that has already been purchased again instead of restoring it, does the same effect as the restoration occur, or does a new payment incur expenses for consumers? The app has a restore button and a process to restore. There are users who sometimes fail to restore, and I am thinking of guiding them to purchase again if the repurchase has the same effect as the restoration.
2
0
893
Sep ’22
Can you check with @available if your iOS app is running on Mac?
I don't want the function to be included if the iOS app is running on a Mac. (Designed for iPad) For example the sample code below @available(iOS 13.4, *) func keyPressed(_ key: UIKey) { .. } The keyPressed function is included when running in iOS or iPadOS. I would like to know if there is a way to prevent the keyPressed function from being included at launch time, even when running an iOS app as "Designed for iPad" on M1/M2 devices. "targetEnvironment(macCatalyst)" When this is called, false is unconditionally displayed, so the distinction cannot be made. #if ProcessInfo().isiOSAppOnMac func keyPressed(_ key: UIKey) { .. } #endif If you use the code above, ProcessInfo cannot be executed in RunTime, so false is output unconditionally. So far I'm looking for a possible way, but there doesn't seem to be any possible way. If anyone has solved this problem, please reply.
1
0
697
Sep ’22
Xcode 14 & iOS 16 purple warnings starting with "[Security] This method should not .. "
Updated to Xcode 14.0 and built with iOS 16 device. In purple it says "[Security] This method should not be called on the main thread as it may lead to UI unresponsiveness." A warning is displayed. location is @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate {... There is a part where it is difficult to know exactly which function it is because a warning is displayed at the location. I also replaced the admob library with the latest version, but I have the same problem. Does anyone know the cause of this issue? I need help.
17
5
22k
Sep ’22