Post

Replies

Boosts

Views

Activity

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
722
Sep ’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
1k
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.2k
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
732
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
785
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
2.2k
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.9k
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.4k
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.3k
Oct ’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
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
976
Nov ’22
Is there any way to get the text content displayed on the screen in WKWebView ?
I'm trying to get all of the text displayed on the screen in a WKWebView . First of all, the text inside the html file to be loaded is broken. So use evaluateJavaScript to call "document.body.textContent" or "document.body.innerText". Doing so will return the broken text verbatim. However, the content displayed on the webview screen is not broken and displayed normally. I want to know how to get all normal text rendered on this webview screen.
0
0
877
Feb ’23
How can I get the String transformed to fit the UIFont's table?
How can I get the String transformed to fit the UIFont's table? The characters (Unicode) included in the original String are all wrong. This original String is intended to be displayed normally when displayed or rendered in a UITextView using a specific UIFont. In other words, both the original String and UIFont files are not normal. Even after applying it to UITextView or UILabel, the rendering is displayed as normal characters, but when I import it as a String variable as text and display it in the log, it is still abnormal original characters. So, in the case of UITextView, even if the user makes a selection and then copies or searches, it does not work normally. I want to get the rendered (converted) String of this original String through this specific UIFont.
0
0
1.2k
Feb ’23
Watch App Review & Sales Questions
Apple has two watch app cases below. Watch App Only Phone App + Watch App (uncheck supports running without ios app installation option) I am trying to distribute it in the second situation above, "phone app + watch app". We are currently developing/researching a watch app. So, I have a few questions. First case: Documents can only be viewed on the watch app. You cannot view documents in the phone app, but it converts and transfers files from the phone app to the watch app. You can view the file by opening it in the watch app. Can a case like this pass the app review? Second case: In phone app + watch app, when both apps have the ability to view files Is it possible to sell the phone app and the watch app separately for a fee?
0
0
686
Mar ’23
Is there a way to get extra time to finish tasks in the WatchOS background?
In the Watch app, press the digital crown to go to the home screen, or the app enters the background state and tries to save the current data to iCloud. However, in this case, you may not be able to save to iCloud. In my opinion, the Watch app doesn't seem to be given any extra time to finish tasks once it enters the background. Is there any way I can do a little bit of extra background work to get things done? In the case of a background session, the system starts the app at an unspecified time after the app enters the background, so I decided that it was not particularly necessary in my case. It would be nice to be able to finish the work within 30 minutes while entering the background state, but I can't find a suitable way.
0
0
1.1k
Apr ’23