I'm experiencing an issue in my iOS app where tapping to select text in a UITextView that is embedded within a UIScrollView causes the scroll view to jump to an incorrect position. This problem seems to occur only on iOS 15. Does anyone know how to fix this issue, or is there a known bug regarding this behavior on iOS 15?
class ViewController: UIViewController, UITextViewDelegate, UIGestureRecognizerDelegate {
@IBOutlet weak var textView: UITextView!
@IBOutlet weak var scrollView: UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()
textView.isScrollEnabled = false
textView.layoutManager.allowsNonContiguousLayout = false
}
}
UIKit
RSS for tagConstruct and manage graphical, event-driven user interfaces for iOS or tvOS apps using UIKit.
Posts under UIKit tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I have already searched for a lot of information about this issue. Many people have encountered it with UISplitViewController or on iPadOS, but I am experiencing this problem on iOS 18. It does occasionally occur on iOS 17, but it definitely happens on iOS 18. The error messages are as follow:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Layout requested for visible navigation bar, <UINavigationBar: 0x14a6b3c00; frame = (0 44; 375 44); autoresize = W; tintColor = UIExtendedGrayColorSpace 1 1; layer = <CALayer: 0x3026a9da0>> delegate=0x14a674600 standardAppearance=0x300d1d0a0 scrollEdgeAppearance=0x300d1cf50, when the top item belongs to a different navigation bar. topItem = <UINavigationItem: 0x14a7f8780> style=navigator leftBarButtonItems=0x302423b40, navigation bar = <UINavigationBar: 0x14adcb700; frame = (0 0; 375 44); autoresize = W; tintColor = UIExtendedGrayColorSpace 1 1; layer = <CALayer: 0x302680940>> delegate=0x14ade8c00 standardAppearance=0x300d7a7d0 scrollEdgeAppearance=0x300d7a610, possibly from a client attempt to nest wrapped navigation controllers.'
*** First throw call stack:
(0x193f3a08c 0x191242698 0x19330a8fc 0x196939290 0x1966847b4 0x1967cdc88 0x1959ba6d8 0x1966c86bc 0x196769d50 0x1967cae58 0x196771f28 0x196b0fcb8 0x196764800 0x196684280 0x1959ba6d8 0x1959ba264 0x195a12edc 0x195990560 0x1968295f0 0x193f1c218 0x193f0a4c0 0x193f09b84 0x193f09368 0x1e00fc1c4 0x196a569b0 0x196b04d54 0x10462b1fc 0x1ba144734)
libc++abi: terminating due to uncaught exception of type NSException
I am sure about the process on iOS 17, first I use UINavigationController.present(UINavigationController()) and then call keyWindow.rootViewController = UINavigationController(), it crashes. So I can dismiss the presentedViewController before assign keyWindow.rootViewController. However, on iOS 18, the app crash when launch.
To enable editing in the elevated Tab Bar or sidebar on iPadOS, we need to use UITabBar. However, using UITabBar restricts reordering in compact mode with the bottom tab bar. Instead of showing the tabs, the editing view only displays the message 'Drag the icons to organize tabs.' How can we resolve this issue?
Find demo project here
In iOS 18.0, UICollectionView/scrollToItem(at:at:animated:) causes UICollectionView to scroll with an awkward stuttered animation at about 4 frames per second on the device.
This behavior is not observed in iOS 15, 16, or 17.
I submitted FB13986989 about this issue 6 weeks ago when I first observed it in iOS 18 beta 1, but I have not received a response.
The issue has not been fixed in iOS 18.0 beta 2, 3, or 4.
Is this a known issue? Does Apple intend to fix it?
Assuming Apple has not prioritized fixing this bug, could a UIKit engineer suggest a workaround?
My app relies on scrollTo working properly and now looks awful on iOS 18.
Thank you for any assistance you can provide.
FB14569448
Since iOS 18 beta came out, our app has been failing at some point when a view controller is dismissed and it appears the main thread ends up looping in layout logic and logs the following to the console. The app hangs until it's terminated due to a memory overallocation issue.
Anyone else seen this?
<_UINavigationBarItemStackEntry: 0x302ac73f0> normalLayout[active]=0x1391ad880 searchLayout=0x0 item=<UINavigationItem: 0x13913a080> style=navigator: Ignoring unexpected nonmatching counterpart: (null)
This is an internal UIKit bug.
Snapshotting a view (0x1391e7c00, _UIButtonBarStackView) that has not been rendered at least once requires afterScreenUpdates:YES.
frame #0: 0x000000019bb07000 libobjc.A.dylibobjc_msgSend frame #1: 0x00000001a0fb4224 UIKitCore-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededCollectingViews:forSecondPass:] + 144
frame #2: 0x00000001c270a030 CoreAutoLayout-[NSISEngine withBehaviors:performModifications:] + 84 frame #3: 0x00000001a0fe5424 UIKitCore__100-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:]_block_invoke + 120
frame #4: 0x00000001a0fe3ae0 UIKitCore-[UIView(AdditionalLayoutSupport) _withUnsatisfiableConstraintsLoggingSuspendedIfEngineDelegateExists:] + 112 frame #5: 0x00000001a0fe2b4c UIKitCore-[UIView(AdditionalLayoutSupport) _updateConstraintsIfNeededWithViewForVariableChangeNotifications:] + 172
frame #6: 0x00000001a0fa9e90 UIKitCore-[UIView _updateConstraintsAtEngineLevelIfNeededWithViewForVariableChangeNotifications:] + 400 frame #7: 0x00000001a0fa9a18 UIKitCore-[UIView _updateConstraintsAsNecessaryAndApplyLayoutFromEngine] + 312
frame #8: 0x00000001a0fa97a4 UIKitCore-[UIView(Hierarchy) layoutSubviews] + 204 frame #9: 0x00000001a124fa78 UIKitCore-[_UIButtonBarStackView layoutSubviews] + 56
frame #10: 0x00000001a0f6430c UIKitCore-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2492 frame #11: 0x00000001a029d8d0 QuartzCoreCA::Layer::layout_if_needed(CA::Transaction*) + 496
frame #12: 0x00000001a0fa81d0 UIKitCore-[UIView(Hierarchy) layoutBelowIfNeeded] + 300 frame #13: 0x00000001a1843fa4 UIKitCore-[_UINavigationBarTransitionContextCrossfade _prepareContentView] + 132
frame #14: 0x00000001a18443bc UIKitCore-[_UINavigationBarTransitionContextCrossfade prepare] + 84 frame #15: 0x00000001a184e59c UIKitCore-[_UINavigationBarVisualProviderModernIOS _performAnimationWithTransitionCompletion:transition:] + 1524
frame #16: 0x00000001a180f938 UIKitCore-[UINavigationBar _popNavigationItemWithTransitionAssistant:] + 220 frame #17: 0x00000001a180f5f8 UIKitCore-[UINavigationBar _popNavigationItemWithTransition:] + 224
frame #18: 0x00000001a13bec9c UIKitCore-[UINavigationBar _setItemsUpToItem:transition:] + 240 frame #19: 0x00000001a13be76c UIKitCore-[UIViewController _removeNavigationItemsFromNavigationController:transition:] + 232
frame #20: 0x00000001a19c9dc0 UIKitCore__89-[UINavigationController _immediatelyApplyViewControllers:transition:animated:operation:]_block_invoke_3 + 800 frame #21: 0x00000001a19d0b2c UIKitCore__98-[UINavigationController _shouldSkipHostedRefreshControlUpdateSchedulingDeferredUpdateIfNecessary]_block_invoke + 40
frame #22: 0x00000001a19d7574 UIKitCore-[UINavigationController transitionConductor:didStartDeferredTransition:context:] + 792 frame #23: 0x00000001a21c9600 UIKitCore-[_UIViewControllerTransitionConductor startDeferredTransitionIfNeeded] + 688
frame #24: 0x00000001a10ab040 UIKitCore-[UINavigationController __viewWillLayoutSubviews] + 84 frame #25: 0x00000001a1350bcc UIKitCore-[UILayoutContainerView layoutSubviews] + 172
frame #26: 0x00000001a0f6430c UIKitCore-[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2492 frame #27: 0x00000001a029d8d0 QuartzCoreCA::Layer::layout_if_needed(CA::Transaction*) + 496
frame #28: 0x00000001a029d45c QuartzCoreCA::Layer::layout_and_display_if_needed(CA::Transaction*) + 148 frame #29: 0x00000001a02f64e0 QuartzCoreCA::Context::commit_transaction(CA::Transaction*, double, double*) + 472
frame #30: 0x00000001a02736c4 QuartzCoreCA::Transaction::commit() + 648 frame #31: 0x00000001a02b6584 QuartzCoreCA::Transaction::flush_as_runloop_observer(bool) + 88
frame #32: 0x00000001a1002c3c UIKitCore_UIApplicationFlushCATransaction + 52 frame #33: 0x00000001a10002dc UIKitCore_UIUpdateSequenceRun + 84
frame #34: 0x00000001a0ffff2c UIKitCoreschedulerStepScheduledMainSection + 172 frame #35: 0x00000001a1000df0 UIKitCorerunloopSourceCallback + 92
frame #36: 0x000000019e7edf90 CoreFoundation__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 frame #37: 0x000000019e7edf24 CoreFoundation__CFRunLoopDoSource0 + 176
frame #38: 0x000000019e7eba10 CoreFoundation__CFRunLoopDoSources0 + 244 frame #39: 0x000000019e7eac14 CoreFoundation__CFRunLoopRun + 840
frame #40: 0x000000019e7ea4c8 CoreFoundationCFRunLoopRunSpecific + 572 frame #41: 0x00000001eb06d1c4 GraphicsServicesGSEventRunModal + 164
frame #42: 0x00000001a1334a90 UIKitCore-[UIApplication _run] + 816 frame #43: 0x00000001a13e2d1c UIKitCoreUIApplicationMain + 340
frame #44: 0x000000010038ca7c LabWare Developmentmain at AppDelegate.swift:31:7 frame #45: 0x00000001c4f4e9b4 dyldstart + 2724
I'm creating a Netflix like app on tvOS, here is my compositional layout that I use with my collectionView.
private func createLayout() -> UICollectionViewCompositionalLayout {
return UICollectionViewCompositionalLayout { (section, _) -> NSCollectionLayoutSection? in
// item
let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1),
heightDimension: .fractionalHeight(1.0))
let item = NSCollectionLayoutItem(layoutSize: itemSize)
item.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 10, bottom: 0, trailing: 10)
// group
let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1/5),
heightDimension: .estimated(350))
let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])
// section
let section = NSCollectionLayoutSection(group: group)
section.orthogonalScrollingBehavior = .groupPaging
let headerSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),
heightDimension: .estimated(UIFont(name: "MyFont", size: 36)!.lineHeight))
let sectionHeader = NSCollectionLayoutBoundarySupplementaryItem(
layoutSize: headerSize,
elementKind: "SectionHeader",
alignment: .top)
section.boundarySupplementaryItems = [sectionHeader]
section.contentInsets = NSDirectionalEdgeInsets(top: 0, leading: 20, bottom: 30, trailing: 0)
return section
}
}
So:
My collection view is composed by several row (that are the sections).
Each section is composed by groups containing 1 item each.
Each section can be scrolled horizontally.
And you can scroll vertically to move from a section to an other.
I'm expecting to have the following behavior when scrolling: Horizontal scrolling:
Before focus shifts
--------------------------
| vA vB vC vD vE |
| [v1] v2 v3 v4 v5 |
| vU vW vX vY vZ |
--------------------------
After focus shifts
--------------------------
| vA vB vC vD vE |
| [v2] v3 v4 v5 v6 |
| vU vW vX vY vZ |
--------------------------
Vertical scroll:
Before focus shifts
--------------------------
| [vA] vB vC vD vE |
| v1 v2 v3 v4 v5 |
| vU vW vX vY vZ |
--------------------------
After focus shifts
--------------------------
| [v1] v2 v3 v4 v5 |
| vU vW vX vY vZ |
| vF vG vH vI vJ |
--------------------------
Thanks to section.orthogonalScrollingBehavior = .groupPaging the horizontal scrolling is working as expected. (I've put 1 item per group to achieve this)
But I'm going crazy with the vertical scroll, I'm not able to achieve it as expected, the focused section still centered verticaly on the screen ! What I'm getting:
Before focus shifts
--------------------------
| [vA] vB vC vD vE |
| v1 v2 v3 v4 v5 |
| vU vW vX vY vZ |
--------------------------
After focus shifts
--------------------------
| vA vB vC vD vE |
| [v1] v2 v3 v4 v5 |
| vU vW vX vY vZ |
--------------------------
After an other focus shifts
--------------------------
| v1 v2 v3 v4 v5 |
| [vU] vW vX vY vZ |
| vF vG vH vI vJ |
--------------------------
I've tried to play with the didUpdateFocusIn function without success
func collectionView(_ collectionView: UICollectionView, didUpdateFocusIn context: UICollectionViewFocusUpdateContext, with coordinator: UIFocusAnimationCoordinator) {
if let nextFocusedItemIndexPath = context.nextFocusedIndexPath {
let section = nextFocusedItemIndexPath.section
let sectionIndexPath = IndexPath(item: 0, section: section)
collectionView.scrollToItem(at: sectionIndexPath, at: .top, animated: true)
}
}
The collectionview is behaving strangely when using the didUpdateFocusIn function and I feel it's not the good way to perform what I'm expecting...
I've also try to play with the scrollViewWillEndDragging function without success
func scrollViewWillEndDragging(_ scrollView: UIScrollView, withVelocity velocity: CGPoint, targetContentOffset:
}
Everything that I tried looks like a hack and I can't believe Apple has not plan something for this use case, which is in my sense a common use case....
I have a UIImageView and a bottom container view inside a UIScrollView.
I set the scrollView's contentInsetAdjustmentBehavior to .never because I want the scrollView's content to anchor to top of the view, such that the content of the scroll view, in this case the imageView, shows inside the top safe area.
The ImageView currently shows all the way to the top. However, the problem is that when the user scrolls down, and the bottomContainer view meets the top Safe Area, the top of the bottomContainer view stretches. The bottom container has all its constraint set for its subviews, from top to bottom. I don't understand why the bottomContainer view would stretch vertically.
The constraint for these views are as follows:
// adds view as subview with `translatesAutoResizingMasksIntoConstraints = false
self.view.add(subviews: mainScrollView)
NSLayoutConstraint.activate([
self.mainScrollView.topAnchor.constraint(equalTo: self.view.topAnchor),
self.mainScrollView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor),
self.mainScrollView.leftAnchor.constraint(equalTo: self.view.leftAnchor),
self.mainScrollView.rightAnchor.constraint(equalTo: self.view.rightAnchor),
self.mainScrollView.contentLayoutGuide.widthAnchor.constraint(equalTo: self.view.widthAnchor)
])
// adds views as subviews with `translatesAutoResizingMasksIntoConstraints = false
self.mainScrollView.add(subviews: [self.profileImageView, self.bottomContainer])
// adds constraints to caller view's edges on axis
self.mainScrollView.make(views: [self.profileImageView, self.bottomContainer], flushAlongAxes: [.horizontal])
// Adds VLF constraints to views on the callers edges
self.mainScrollView.addConstraints(
withVisualFormat: "V:|[profileView(\(self.profileViewHeight))]-(-10)-[bottomContainer]-15-|",
views: ["profileView": self.profileImageView, "bottomContainer": self.bottomContainer])
I will attach a some screenshots to clarify what is happening:
Here is how it is supposed to look:
Here is how it stretches as the bottomContainer scrolls under the SafeArea:
How do I prevent the bottomContainer from stretching when it scrolls under the top safe area?
I'm getting a crash on iOS 14.4.1 and other older versions when entering text into a UITextBox in my game. I tried disabling auto correct on the field and it seemed to make the issue occur less often, but it is not solving 100% of the cases. Does anyone know how to prevent this exception and turn off auto complete on the text field entirely? None of the call stack is actually my code other than main.
Update: I am already setting self.textInput.autocorrectionType = UITextAutocorrectionTypeNo;
0 CoreFoundation +0x125868 ___exceptionPreprocess
1 libobjc.A.dylib +0x6c4c _objc_exception_throw
2 CoreFoundation +0x1e4a0 +[NSException raise:format:]
3 QuartzCore +0x16adb0 CA::Layer::set_position(CA::Vec2&lt;double&gt; const&amp;, bool)
4 QuartzCore +0x16ace0 -[CALayer setPosition:]
5 QuartzCore +0x16a7b8 -[CALayer setFrame:]
6 UIKitCore +0x10f8184 -[UIView(Geometry) setFrame:]
7 UIKitCore +0x9b7038 -[UIKeyboardImpl updateAutocorrectPrompt:correctionRects:]
8 UIKitCore +0x9b6a54 -[UIKeyboardImpl updateAutocorrectPrompt:executionContext:]
9 UIKitCore +0x9d5274 ___56-[UIKeyboardScheduledTask handleDeferredTimerFiredEvent]_block_invoke
10 UIKitCore +0x9d57d8 -[UIKeyboardTaskEntry execute:]
11 UIKitCore +0x9d420c -[UIKeyboardTaskQueue continueExecutionOnMainThread]
12 UIKitCore +0x9d518c -[UIKeyboardScheduledTask handleDeferredTimerFiredEvent]
13 CoreFoundation +0x12a8f0 ___invoking___
14 CoreFoundation +0x1df4 -[NSInvocation invoke]
15 UIKitCore +0xfa5778 -[_UIActionWhenIdle invoke]
16 CoreFoundation +0xa0354 ___CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
17 CoreFoundation +0x9a5c0 ___CFRunLoopDoObservers
18 CoreFoundation +0x9ab70 ___CFRunLoopRun
19 CoreFoundation +0x9a218 _CFRunLoopRunSpecific
20 GraphicsServices +0x3780 _GSEventRunModal
21 UIKitCore +0xbc8ee4 -[UIApplication _run]
22 UIKitCore +0xbce758 _UIApplicationMain
23 Wizard-of-Oz +0x20f8268 main (main.mm:38:19)
24 libdyld.dylib +0x16ac _start
iOS 18 introduced the elevated tab bar for iPad devices. However, the tint color for UITabBar items is not changing. Adjusting the barTintColor and tintColor properties of the tab bar items does not seem to have any effect.
In our application we have one banner via UIStackview which has one UIBotton & UILabel in horizontal stackview.
In UI is working fine in all the iOS Version & devices but it is creating issue for iOS 14.2 iPhone 6s.
We have verified the same in iOS 15.3.1 iPhone 6s, its is working fine.
We are attaching 2 screenshot:
Our Storybaord specific ui component.
The distorted UI of iOS 14.2 iPhone 6s.
Kindly update us on priority as end customer is facing issue.
Topic description: when a user wants to create a new Account and ignores the "Use strong password" or "choose other option" and clicks on button to next screen, the app will hang.
User Interaction / Experience
A Screen with usernameInputField, a passwordInputField and a Button to create the account. The next screen will be pushed (not modally). The second screen allows some userinteraction (in the example counting upwards and displaying this, which allows checking if the app responds to input).
How to reproduce
The user types in a username and klicks on the passwordTextField. A strong password is suggested by Apple. The overlay shows at the bottom. We ignore the Buttons provided by the overlay and press on the button in the app to create the account. Transition to next page animates, but the next screen is unresponsive.
Expected behavior (which works sometimes, when running with debugger)
On the second screen the Do you want to store the password action sheet should be displayed (like in the screenshot).
Findings
This bug occures for our production App with UIKit and SwiftUI implementation. I could also find an App on the AppStore with the same Bug and similar patterns (usernameField + passwordField + nextButton + navigation by pushing the next viewController).
I implemented the most basic to reproduce the bug and be sure it is nothing in my code. I cannot provide a standalone project, because https://<fully qualified domain>/.well-known/apple-app-site-association Information needs to be given for strong password to be suggested.
Screenshots when not running into bug.
// AppDelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
appWindow = UIWindow(frame: UIScreen.main.bounds)
let viewController = UIHostingController(rootView: ContentView())
let navigationController = UINavigationController(rootViewController: viewController)
appWindow.rootViewController = navigationController
appWindow.makeKeyAndVisible()
return true
}
// Create Account implementation
struct CounterView: View {
@State var counter = 0
var body: some View {
VStack {
Text(String(counter))
.font(.title)
Button("+", action: { counter += 1 })
.buttonStyle(BorderedProminentButtonStyle())
}
}
}
struct ContentView: View {
@State var username = ""
@State var password = ""
var body: some View {
VStack {
Text("Choose your login credentials")
.padding()
TextField("username", text: $username)
.textContentType(.username)
SecureField("password", text: $password)
.textContentType(.newPassword)
NavigationLink(destination: CounterView()) {
Text("create account")
}
}
.padding(40)
}
}
The bug does NOT occure when you have the debugger attached from the start. I was able to get the bug and then attach to the process. I could see that memory raised drastically and the app crashed after a long time.
While testing, I could see once
View <:0x0> does not conform to UITextInput protocol
being printed to the console.
The bug does not occure when you present the next screen modally.
With Debugger attached the App response as expected and presents the action sheet for do you want to store the password.
My guess
I think when the transition to the next screen happens, the reference to some critical information for save password gets deallocated and then some Apple Api tries to show the action sheet but this does not work because some Information is missing. This seems to prevent the userinteraction and some code runs in an endless loop which would explain the memory raising quickly (our production build runs normally between 30 MB and 80 MB Memory).
Does anyone have similar issues?
I think all Ideas to fix this are some sort of hacks to make it work and I would think Apple needs to fix this, what do you think?
I want to achieve Fold animation when the user scrolls UICollectionView. I have UICollectionView with full-screen size cell and vertically scrolling with paging enabled. For that I've created sub-class of UICollectionViewFlowLayout which is as described below.
class FoldingFlowLayout: UICollectionViewFlowLayout {
private let logger = Logger(subsystem: bundleIdentifier, category: "FlowLayout")
override func prepare() {
super.prepare()
scrollDirection = .vertical
minimumLineSpacing = 0
minimumInteritemSpacing = 0
}
override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
let attributes = super.layoutAttributesForElements(in: rect)
attributes?.forEach { attribute in
transformLayoutAttributes(attribute)
}
return attributes
}
override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
return true
}
private func transformLayoutAttributes(_ attributes: UICollectionViewLayoutAttributes) {
guard let collectionView = collectionView else { return }
let contentOffsetY = collectionView.contentOffset.y
let cellOffsetY = attributes.frame.origin.y - contentOffsetY
let cellHeight = attributes.frame.height
var transform = CATransform3DIdentity
transform.m34 = -1.0 / 500.0 // Apply perspective
if cellOffsetY < cellHeight && cellOffsetY > -cellHeight {
let angle = (cellOffsetY / cellHeight) * .pi / 2
transform = CATransform3DRotate(transform, angle, -1, 0, 0)
attributes.transform3D = transform
attributes.alpha = 1.0 - (abs(cellOffsetY) / cellHeight)
} else {
attributes.transform3D = CATransform3DIdentity
attributes.alpha = 1.0
}
}
}
But this is not working as I expected. I want to create replica of this kind of animation.
What am I missing here?
My app needs to recognize screen gestures the hard way. I have working code for flick recognition (a combination of distance, direction, and velocity), but it's not as reliable as whatever Apple uses. Does anyone know exactly what defines a flick in iOS?
UIWindowScene.screen.isCaptured property returned false if the recording is already happening and launch the app in iOS 18 Beta 4.
I also tried with UIScreen.main.isCapture (also returned false) and
sceneCaptureState (UITraitCollection) (which returned .inactive)
The flag returned true if the app is already opened in the foreground or put it in the background when the screen recording starts.
Is it a bug in iOS 18 Beta or is there any other API I need to use it for iOS 18?
in iOS 15.0 Devices when implementing UItableView Drag/Drop using delegate, I am facing an issue.
UITableViewDropDelegate Methods are not called.
func tableView(_ tableView: UITableView, dropSessionDidEnter session: UIDropSession) {
//This is called
}
func tableView(_ tableView: UITableView, canHandle session: UIDropSession) -> Bool {
//This gets called
return true
}
func tableView(
_ tableView: UITableView,
dropSessionDidUpdate session: UIDropSession,
withDestinationIndexPath destinationIndexPath: IndexPath?
) -> UITableViewDropProposal {
//Does not gets called
}
/**
This delegate method is the only opportunity for accessing and loading
the data representations offered in the drag item. The drop coordinator
supports accessing the dropped items, updating the table view, and specifying
optional animations.
*/
func tableView(_ tableView: UITableView, performDropWith coordinator: UITableViewDropCoordinator) {
//Does not gets called
}
The issue only occurs in iOS 15.0 devices. OS version>15.0 it works fine.
Delegate method registered using
tableView.dragInteractionEnabled = true
tableView.dragDelegate = self
tableView.dropDelegate = self
Is there any solution to this?
Xcode15 has been running normally, upgrade to Xcode16 beta4, running crash, crash code is as follows:
What am I supposed to do to fix this.
Can't my property be named maskView in Xcode16 beta4?
In iOS 18, with the elevated tab bar, the title of the primary view controller in a UISplitViewController automatically hides when the Split View is expanded. However, the title label is still present in the view hierarchy. How to resolve this issue?
Why is the testFieldDidChangeSelection function called three times when the return key is pressed?
Here is what I did
enter text in TextField
press the Return key
The result is that the textFieldDidChangeSelection function is called three times.
I would like to know why.
As a supplement, I asked ChatGPT and the results are below.
At the moment the Return key is pressed: The cursor is updated at the position of the last character entered in the text field.
Insertion of a newline: When the Return key is pressed, a new line is added, and the cursor moves to the beginning of the new line.
Finalization of the edit: Finally, the content of the text field is confirmed, and the position of the cursor is finalized.
Also, is the above answer true?
In iOS 18 on iPad, the elevated tab bar order is persisted by the system. After reordering the tabs, how can I retrieve the current order of the tabs? and how to override the order programatically.
I am experimenting with drag-and-drop on iPadOS.
If I drag a JPEG image from a webpage in Safari to my app, I get items of types public.jpeg and public.url.
Typically, the URL is the URL of the image.
If, however, the image is itself a link, then the URL seems to be the target of the link.
Is there some way that I can always get the URL of the image itself? Is there some way that I can determine whether the URL I have received is the URL of the image or of a link?