Auto Layout

RSS for tag

Create a user interface that dynamically responds to changes in the available screen space using Auto Layout.

Posts under Auto Layout tag

18 Posts
Sort by:
Post not yet marked as solved
0 Replies
72 Views
giving this every time *** Assertion failure in void _engineVar_rawRemove(NSISEngineVar)(), NSISEngine_EngineVar.h:181 2024-03-21 16:29:48.644662+0530 Yanabea[6857:1455909] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Not possible to remove variable: 922: <unknown var (bug!) with engine as delegate:0x282bd7d80>{id: 10158} colIndex:103 from engine <NSISEngine: 0x1500b4350>{ delegate:0x14bdc8ca0 EngineVars: . . . . 78 -> 2 79 -> 1 80 -> 1 }.' terminating with uncaught exception of type NSException and rest thousands of line of logs that I am tried to attached in the attachment but it is not supporting.
Posted Last updated
.
Post not yet marked as solved
0 Replies
323 Views
I am new to using iOS Objective-C size classes like Regular, compact, Any. I found that Compact size classes are anything less than ~640 pts and Regular size classes are anything larger than ~640 pts . Is that correct for both iphone and ipad? How can I use size class to make an image full screen on all the iphone and ipad devices and on any orientation? How many images will I need? Any help and insight is greatly appreciated!
Posted
by m2024.
Last updated
.
Post not yet marked as solved
0 Replies
139 Views
I am trying to self size DTAttributedTextContentView inside the collection cell based on its attributed text. The problem I face is that when I set attributedTextContentView width constraints like so: attributedTextContentView.widthAnchor.constraint(lessThanOrEqualToConstant: 260) it applies the whole constant width (in this case 260) to the textContentView, even if attributedString length is smaller than the width, leaving some extra space: My question is, how to size the frame of DTAttributedTextContentView so that it just encloses the text that it contains? Initially I used basic UITextView, but the scrolling of cells through collection view is not that smooth when there are multiple cells, and also it gives possibility to easy access the last line of the text inside, which I need for my app, so I would like to stick to DTAttributedTextContentView. Here is the sample code for testing: class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() configureCollectionView() } // MARK: - Collection view setup let collectionView: UICollectionView = { let layout = UICollectionViewCompositionalLayout { (section, environment) -> NSCollectionLayoutSection? in let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0), heightDimension: .estimated(10)) let item = NSCollectionLayoutItem(layoutSize: itemSize) let group = NSCollectionLayoutGroup.vertical(layoutSize: itemSize, subitems: [item]) let section = NSCollectionLayoutSection(group: group) section.interGroupSpacing = 5 return section } layout.configuration.scrollDirection = .vertical let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) collectionView.register(ConversationCollectionViewCell.self, forCellWithReuseIdentifier: "ConversationCell") return collectionView }() private func configureCollectionView() { collectionView.dataSource = self collectionView.backgroundColor = .brown view.addSubview(collectionView) collectionView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ collectionView.leadingAnchor.constraint(equalTo: view.leadingAnchor), collectionView.trailingAnchor.constraint(equalTo: view.trailingAnchor), collectionView.topAnchor.constraint(equalTo: view.topAnchor), collectionView.bottomAnchor.constraint(equalTo: view.bottomAnchor) ]) } } // MARK: - Collection Data Source extension ViewController: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return 10 } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "ConversationCell", for: indexPath) as! ConversationCollectionViewCell return cell } } // MARK: - Collection View Custon Cell final class ConversationCollectionViewCell: UICollectionViewCell, DTAttributedTextContentViewDelegate { var mainCellContainerView = UIView() var attributedTextContentView = DTAttributedTextContentView() //MARK: - LIFECYCLE override init(frame: CGRect) { super.init(frame: frame) setupmainCellContainerView() setupAttributedTextContentView() layoutIfNeeded() } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } // MARK: - UI STEUP private func setupmainCellContainerView() { contentView.addSubview(mainCellContainerView) mainCellContainerView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ mainCellContainerView.topAnchor.constraint(equalTo: contentView.topAnchor), mainCellContainerView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor), mainCellContainerView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor), mainCellContainerView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor), ]) } private func setupAttributedTextContentView() { mainCellContainerView.addSubview(attributedTextContentView) attributedTextContentView.backgroundColor = .systemIndigo attributedTextContentView.delegate = self attributedTextContentView.sizeToFit() let attributedString = NSAttributedString(string: "Simple message for testing purpose @", attributes: [ .font: UIFont(name: "HelveticaNeue", size: 17), .foregroundColor: UIColor.white, .paragraphStyle: { let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .left paragraphStyle.lineBreakMode = .byWordWrapping return paragraphStyle }() ]) attributedTextContentView.attributedString = attributedString attributedTextContentView.contentMode = .redraw attributedTextContentView.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ attributedTextContentView.widthAnchor.constraint(lessThanOrEqualToConstant: 260), attributedTextContentView.topAnchor.constraint(equalTo: mainCellContainerView.topAnchor), attributedTextContentView.bottomAnchor.constraint(equalTo: mainCellContainerView.bottomAnchor), ]) } }
Posted
by prandrei.
Last updated
.
Post marked as solved
1 Replies
307 Views
I have this ToastView that will animate by expanding the height from the top of the screen. All the components are created programmatically. This is the code: final class ToastView: UIView { private static let instance = createContainer() private let labelHeightOffset: CGFloat = 32 private let messageLabel: UILabel = { let label = UILabel() label.textAlignment = .center label.numberOfLines = 0 return label }() private var heightConstraint: NSLayoutConstraint! static func show(message: String) { let keyWindow = UIWindow.getKeyWindow() //extension to get the kley window show(on: keyWindow, message: message) } private static func show(on parentView: UIView? = nil, message: String) { guard let parentView = parentView ?? UIViewController.getTopViewController()?.view, instance.superview == nil, let toast = toast else { return } parentView.addSubview(instance, method: .fill) toast.messageLabel.text = message toast.messageLabel.textColor = .red toast.messageLabel.textAlignment = .center toast.messageLabel.sizeToFit() toast.show(for: 3) } private func show(for duration: TimeInterval = 0) { isHidden = false layoutIfNeeded() UIView.animate(withDuration: 0.4, animations: { let labelLineHeight = self.messageLabel.getRect(maxLine: 3).size.height //getRect is an extension func to get the rect based on the content of the label let lineSpaces = CGFloat((self.messageLabel.getLineNumber() - 1) * 2) //getLineNumber is an extension func to get the total number of lines based on the content //Get the height by the content of the label self.heightConstraint.constant = self.labelLineHeight + self.labelHeightOffset + lineSpaces self.setNeedsUpdateConstraints() self.superview?.layoutIfNeeded() }, completion: { _ in self.hide(delay: duration) }) } private func hide(delay: TimeInterval = 0) { UIView.animate(withDuration: 0.4, delay: delay, animations: { self.heightConstraint.constant = 0 self.setNeedsUpdateConstraints() self.superview?.layoutIfNeeded() }, completion: { _ in self.isHidden = true self.messageLabel.text = nil ToastView.instance.removeFromSuperview() }) } } private extension ToastView { static var toast: ToastView? { return instance.subviews[0] as? ToastView } static func createContainer() -> UIView { let container = UIView(frame: .zero) container.backgroundColor = .clear let toast = ToastView(frame: .zero) toast.backgroundColor = .white toast.addCorner(radius: 8) container.addSubview(toast) toast.layoutMessageLabel() toast.layoutToast() return container } func layoutMessageLabel() { addSubview(messageLabel) messageLabel.center = center messageLabel.translatesAutoresizingMaskIntoConstraints = false let constraints = [ centerYAnchor.constraint(equalTo: messageLabel.centerYAnchor), leftAnchor.constraint(equalTo: messageLabel.leftAnchor, constant: 16), rightAnchor.constraint(equalTo: messageLabel.rightAnchor, constant: 16) ] NSLayoutConstraint.activate(constraints) messageLabel.setNeedsUpdateConstraints() layoutIfNeeded() } func layoutToast() { translatesAutoresizingMaskIntoConstraints = false let topConstants: CGFloat = UIWindow.getKeyWindow()?.safeAreaInsets.top ?? 0 + 16 let topConstraint = topAnchor.constraint(equalTo: superview!.topAnchor, constant: topConstants) heightConstraint = heightAnchor.constraint(equalToConstant: 0) let constraints = [ topConstraint, heightConstraint!, leftAnchor.constraint(equalTo: superview!.leftAnchor, constant: 16), superview!.rightAnchor.constraint(equalTo: rightAnchor, constant: 16) ] NSLayoutConstraint.activate(constraints) setNeedsUpdateConstraints() superview!.layoutIfNeeded() } } The code is working fine EXCEPT for the first time it appears. It always animates from the bottom of the screen and rising above ot the top. But if you'll have a look at the code, I only animte the heightConstraint's constant value. Why is this happening? Can you help me fix this? thanks.
Posted Last updated
.
Post not yet marked as solved
2 Replies
509 Views
I am developing an iOS app using SwiftUI and have encountered an Auto Layout constraint conflict issue that appears when tapping on a TextField within a LoginView. I've tried several troubleshooting steps but haven't been able to resolve it. Error Message: Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x6000021298b0 'accessoryView.bottom' _UIRemoteKeyboardPlaceholderView:0x10460dd10.bottom == _UIKBCompatInputView:0x1059220e0.top (active)>", "<NSLayoutConstraint:0x60000217a620 'assistantHeight' SystemInputAssistantView.height == 45 (active, names: SystemInputAssistantView:0x10591ce60 )>", "<NSLayoutConstraint:0x60000217d090 'assistantView.bottom' SystemInputAssistantView.bottom == _UIKBCompatInputView:0x1059220e0.top (active, names: SystemInputAssistantView:0x10591ce60 )>", "<NSLayoutConstraint:0x60000217d040 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x10460dd10]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x10591ce60 )>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x60000217d040 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x10460dd10]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x10591ce60 )> This error appears in the console when I click on the TextField in my LoginView while running the code on a simulation. The app doesn't crash, but the console indicates there is a constraint conflict related to the keyboard. Here's my LoginView: struct LoginView: View { @StateObject var viewModel = LoginViewModel() var body: some View { NavigationStack { VStack { Spacer() Image("logo") .resizable() .scaledToFit() .frame(width: 150, height: 100) VStack { TextField("Enter your email", text: $viewModel.email) .autocapitalization(/*@START_MENU_TOKEN@*/.none/*@END_MENU_TOKEN@*/) .modifier(TextFieldModifier()) SecureField("Enter your password", text: $viewModel.password) .modifier(TextFieldModifier()) } Button { print("Show forgot password") } label: { Text("Forgot Password") .font(.footnote) .fontWeight(.semibold) .padding(.top) .padding(.trailing, 20) } .frame(maxWidth: .infinity, alignment: .trailing) Button { Task { try await viewModel.signIn() } } label: { Text("Login") .font(.subheadline) .fontWeight(.semibold) .foregroundColor(.white) .frame(width: 360, height: 44) .background(Color(.black)) .cornerRadius(8) } .padding(.vertical) HStack { Rectangle() .frame(width: (UIScreen.main.bounds.width / 2) - 40, height: 0.5) Text("OR") .font(.footnote) .fontWeight(.semibold) .foregroundColor(.gray) Rectangle() .frame(width: (UIScreen.main.bounds.width / 2) - 40, height: 0.5) } .foregroundColor(.gray) HStack { Image("facebook_logo") .resizable() .frame(width: 20, height: 20) Text("Continue with Facebook") .font(.footnote) .fontWeight(.semibold) .foregroundColor(Color(.systemBlue)) } .padding(.top, 8) Spacer() Divider() NavigationLink { AddEmailView() .navigationBarBackButtonHidden(true) } label: { HStack (spacing: 3) { Text("Don't have an account?") Text("Sign Up") .fontWeight(.semibold) } .font(.footnote) } .padding(.vertical, 16) } } } } #Preview { LoginView() } And my TextFieldModifier: struct TextFieldModifier: ViewModifier { func body(content: Content) ->some View { content .font(.subheadline) .padding(12) .background(Color(.systemGray6)) .cornerRadius(10) .padding(.horizontal, 24) .padding(.top) } } Attempts to Resolve: I've checked the TextFieldModifier for any potential issues but it seems standard. I've tried simplifying the view by removing other elements, but the issue persists. The issue seems to occur regardless of the simulator device or iOS version I use. Questions: What could be causing this Auto Layout constraint conflict in a SwiftUI app? Are there any known issues with SwiftUI's TextField and keyboard interactions that might lead to such constraints issues? Any suggestions on how to debug or resolve this constraint conflict?
Posted
by best_pc.
Last updated
.
Post not yet marked as solved
1 Replies
534 Views
I am looking for some older WWDC sessions, for example "High Performance Auto Layout". It was available month ago by link https://developer.apple.com/videos/play/wwdc2018/220/. Now the session is unavailable, and there are only few left from WWDC2018. The same issue I experience with some other WWDC sessions. Why does Apple remove older sessions? And where can I find them?
Posted
by ohnidets.
Last updated
.
Post not yet marked as solved
1 Replies
1.4k Views
We’re attempting to use UICollectionView compositional layout to describe a section layout, but it’s giving us some trouble. What we’d like to achieve: A total of 7 cells 3 cells stacked, each 30% height and 100% width, with orthogonal scrolling to see the next 3 When the user reaches the last cell, it would be 100% height and 100% width of the container. ASCII art and screenshots of the imperfect example are below. Our starting point was Apple’s example code, specifically OrthogonalScrollingViewController, but what we’ve found is if we expand the widths there, the height settings seem to longer be respected. The most basic version of a layout that we tried is this: func createLayout() -> UICollectionViewLayout { let layout = UICollectionViewCompositionalLayout { (sectionIndex: Int, layoutEnvironment: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection? in // Small items at roughly 30% of the container height. let smallItem = NSCollectionLayoutItem( layoutSize: NSCollectionLayoutSize( widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(0.3) ) ) // The large item should be 100% of the container width. let largeItem = NSCollectionLayoutItem( layoutSize: NSCollectionLayoutSize( widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1.0) ) ) // We want 3 items to appear stacked with orthogonal scrolling. let smallItemGroup = NSCollectionLayoutGroup.vertical( layoutSize: NSCollectionLayoutSize( widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1.0) ), subitem: smallItem, count: 3 ) let containerGroup = NSCollectionLayoutGroup.horizontal( layoutSize: NSCollectionLayoutSize( widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(0.5) ), subitems: [smallItemGroup, largeItem] ) let section = NSCollectionLayoutSection(group: containerGroup) section.orthogonalScrollingBehavior = .paging return section } return layout } We’ve tried many variations of nested groups and using the .vertical and .horizontal initializers, but each of them has the same result: The last cell is always the same size as all the others. // +------------------------------+ These would be off-screen // | +-------------------------+ | +-------------------------+ +-------------------------+ // | | 1 | | | 4 | | | // | +-------------------------+ | +-------------------------+ | | // | +-------------------------+ | +-------------------------+ | | // | | 2 | | | 5 | | 7 | // | +-------------------------+ | +-------------------------+ | | // | +-------------------------+ | +-------------------------+ | | // | | 3 | | | 6 | | | // | +-------------------------+ | +-------------------------+ +-------------------------+ // | | // | | // | | // | rest of the screen | // | | // | | // | | // | | // +------------------------------+ The last cell in the third screenshot, (0,6), is the one we want 100% height of the section. Is there a way to achieve this layout where the last cell is 100% of the section height?
Posted
by ackack.
Last updated
.
Post not yet marked as solved
3 Replies
824 Views
Before iOS 17 beta, the .pickerStyle(.segmented) modifier makes the Picker take up the entire available width in a toolbar. In iOS 17, it tightly fits the width of the text. I can use .fixedSize() modifier to make the segmented control tightly fit the content. In reverse, what is the recommended way to make it expand to fill the whole width? In iOS 17 beta, I tried .frame(idealWidth: UIScreen.main.bounds.width) and it works, but it doesn't have effect in iOS 16 and prior. Also, it is semantically wrong to set the ideal width to an arbitrary big value. Example: iOS 16, full iOS 17, tight
Posted
by cht1995.
Last updated
.
Post not yet marked as solved
1 Replies
429 Views
I am a new uikit developer. I have a problem on my app. App has 2 different parts. Rectangle view and button. Rectangle view can drag with pan touch gesture. Button can change own image with tap gestures. When user taps the button, it changes own image. But when I tap the button, rectangle view moves to the at the beginning position.(view did load position). I checked logs and I see viewDidLayout methods calling when I tap the button. How can I handle this problem, is there anyone help me ? Thanks a lot. import UIKit final class SampleViewController: UIViewController { private var isTapped: Bool = false let button: UIButton = { let button = UIButton() let image = UIImageView(image: UIImage(systemName: "play")) button.translatesAutoresizingMaskIntoConstraints = false button.backgroundColor = .yellow return button }() let littleView: UIView = { let view = UIView() view.translatesAutoresizingMaskIntoConstraints = false view.layer.borderColor = UIColor.red.cgColor view.layer.borderWidth = 4 view.isUserInteractionEnabled = true view.backgroundColor = .red return view }() override func viewDidLoad() { super.viewDidLoad() self.view.addSubview(button) self.view.addSubview(littleView) littleView.addGestureRecognizer(UIPanGestureRecognizer(target: self, action: #selector(handlePan(_:)))) button.addTarget(self, action: #selector(buttonTapped), for: .touchUpInside) NSLayoutConstraint.activate([ button.bottomAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.bottomAnchor), button.centerXAnchor.constraint(equalTo: self.view.centerXAnchor), littleView.heightAnchor.constraint(equalTo: self.view.heightAnchor, multiplier: 1/5), littleView.widthAnchor.constraint(equalTo: self.view.heightAnchor, multiplier: 1/3), ]) } override func viewDidLayoutSubviews() { littleView.frame = CGRect(x: 0, y: 0, width: littleView.frame.width, height: littleView.frame.height) } override func viewWillLayoutSubviews() { littleView.frame = CGRect(x: 0, y: 0, width: littleView.frame.width, height: littleView.frame.height) } @objc private func buttonTapped() { button.setImage(UIImage(systemName: isTapped ? "play.slash" : "play"), for: .normal) self.view.layoutIfNeeded() isTapped.toggle() print("Button tapped") } @objc private func handlePan(_ gesture: UIPanGestureRecognizer) { guard let viewToMove = gesture.view else { return } if gesture.state == .began || gesture.state == .changed { let translation = gesture.translation(in: view) let newX = max(0, min(view.frame.width - viewToMove.frame.width, viewToMove.frame.origin.x + translation.x)) let newY = max(0, min((view.frame.height - viewToMove.frame.height), viewToMove.frame.origin.y + translation.y)) viewToMove.frame.origin = CGPoint(x: newX, y: newY) gesture.setTranslation(CGPoint.zero, in: view) } } } Github link
Posted
by mkg10.
Last updated
.
Post not yet marked as solved
9 Replies
5.2k Views
** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Not possible to remove variable: 400: unknown var (bug!) with engine as delegate:0x283c8ed40{id: 33112} colIndex:32 from engine NSISEngine: 0x129248130{ delegate:0x12934eaa0 EngineVars:  0: objective{id: 33102} rowIndex:0  1: UIImageView:0x12924ec90.Height{id: 32592} rowIndex:1073741824  2: 0x280a04be0.marker{id: 32591} colIndex:1073741825  3: UIImageView:0x12924ec90.Width{id: 32807} rowIndex:1  4: 0x280dc35a0.posErrorMarker{id: 32871} colIndex:1  5: 0x280dc35a0.negError{id: 32872} rowIndex:88  6: 0x280dc3d80.posErrorMarker{id: 32873} colIndex:1073741826  7: 0x280dc3d80.negError{id: 32874} rowIndex:1073741825  8: UIImageView:0x129353f00.Width{id: 32594} rowIndex:2  9: 0x280979d60.marker{id: 32593} colIndex:3 10: 0x280dc1e60.posErrorMarker{id: 32875} colIndex:4 11: 0x280dc1e60.negError{id: 32876} rowIndex:3 12: UIImageView:0x129353f00.Height{id: 32822} rowIndex:1073741826 13: 0x280dc39c0.posErrorMarker{id: 32877} colIndex:1073741827 14: 0x280dc39c0.negError{id: 32878} rowIndex:1073741898 15: UIButton:0x1293540d0.Width{id: 32817} rowIndex:4 16: 0x280dc2040.posErrorMarker{id: 32879} rowIndex:93 17: 0x280dc2040.negError{id: 32880} colIndex:6 18: UIButton:0x1293540d0.Height{id: 32820} rowIndex:1073741827 19: 0x280dc3de0.posErrorMarker{id: 32881} rowIndex:96 20: 0x280dc3de0.negError{id: 32882} colIndex:1073741830 21: UILabel:0x129353300.Width{id: 32811} rowIndex:5 22: 0x280dc3e40.posErrorMarker{id: 32883} colIndex:44 23: 0x280dc3e40.negError{id: 32884} rowIndex:90 24: UILabel:0x129353300.Height{id: 32842} colIndex:1073741828 25: 0x280dc27c0.posErrorMarker{id: 32885} colIndex:1073741831 26: 0x280dc27c0.negError{id: 32886} rowIndex:1073741828 27: UILabel:0x129353c90.Width{id: 32840} rowIndex:6 28: 0x280dc1da0.posErrorMarker{id: 32887} colIndex:9 29: 0x280dc1da0.negError{id: 32888} rowIndex:97 30: UILabel:0x129353c90.Height{id: 32829} colIndex:1073741832 31: 0x280dc31e0.posErrorMarker{id: 32889} colIndex:1073741833 32: 0x280dc31e0.negError{id: 32890} rowIndex:1073741900 33: UIImageView:0x12934e490.Width{id: 32596} rowIndex:1073741905 34: UIImageView:0x12934e490.Height{id: 32597} colIndex:1073741844 35: 0x280963a70.marker{id: 32595} colIndex:11 36: 0x280dc2ee0.posErrorMarker{id: 32891} colIndex:12 37: 0x280dc2ee0.negError{id: 32892} rowIndex:8 38: 0x280dc1d40.posErrorMarker{id: 32893} colIndex:1073741835 39: 0x280dc1d40.negError{id: 32894} rowIndex:1073741830 40: UIButton:0x1293543b0.Width{id: 32832} rowIndex:9 41: 0x280dc1440.posErrorMarker{id: 32895} colIndex:0 42: 0x280dc1440.negError{id: 32896} rowIndex:1073741845 43: UIButton:0x1293543b0.Height{id: 32827} rowIndex:1073741831 44: 0x280dc3840.posErrorMarker{id: 32897} colIndex:1073741836 45: 0x280dc3840.negError{id: 32898} rowIndex:1073741829 46: UILabel:0x129353a20.Width{id: 32848} rowIndex:10 and another thousand or so lines. this crash occurs after I change the language and open the workout page to start a workout immediately, and sometimes on the second time, I open the workout page.
Posted
by BibinAlex.
Last updated
.
Post not yet marked as solved
0 Replies
797 Views
What might be a good way to constrain a view's top anchor to be just at the edge of a device's Face ID sensor housing if it has one? This view is a product photo that would be clipped too much if it ignored the top safe area inset, but if it was positioned relative to the top safe area margin this wouldn't be ideal either because of the slight gap between the sensor housing and the view (the view is a photo of pants cropped at the waist). What might be a good approach here?
Posted
by Curiosity.
Last updated
.
Post not yet marked as solved
0 Replies
390 Views
I have facing issue related design. It's work fine when I run from Xcode and then killed the app and reopened app it breaks the design in some screens. Here, I have attached a video link for your reference. https://drive.google.com/file/d/1-bZMA59UyrquPB5l1C6DkC9XLZSc_zgP/view?usp=share_link
Posted
by Birendra.
Last updated
.
Post not yet marked as solved
0 Replies
898 Views
Hi All, Our crash reporting solution show app crashes for the user with crash reports which are not getting symbolicating to anything useful. it just says, App crashed on thread 0 (CoreAutoLayout -[NSISEngine negativeErrorVarForBrokenConstraintWithMarker:errorVar:] with it ending up on main.swift file. We have not able to replicate at our end, and it is happening only for a small fraction of our user (&lt; 1%). This issue is spread across multiple iOS versions and device models. We have verified all our UI actions are being done on main thread. Any pointers for solving this are welcome. Regards, Ishan
Posted Last updated
.
Post not yet marked as solved
0 Replies
698 Views
Stage manager controls are overlapping top area of an app if the status bar is hidden despite constraints are relative to the safe area. It is surprise for me that the stage manager is not included in the safe area and designed that the status bar will be responsible for making enough margin to avoid overlapping. Is there anything I am missing on how to treat such problem except avoiding controls in the top area at all and enabling the status bar in the app (users got used to it and we don't see it is possible to explain such changes to all of them)? I see that safe are is disrespected, and I do not find any helpful api or settings in interface builder. The only patch I have right now is to auto hide home indicator override func viewDidLoad() { super.viewDidLoad() setNeedsStatusBarAppearanceUpdate() } override var prefersHomeIndicatorAutoHidden: Bool { return true } The stage manager controls are hidden with home indicator until first user interaction. This might help just a little to have at least possibility click something in the top center once in a while. But overall experience is bad. Steps: Create a new project for iOS in Xcode using storyboard as interface. Add a button or any other view/control to the main view controller view in interface builder. Add the constraints to connect the button with its parent viewcontroller’s view: the top constraint should be related to top safe area with 0 space; centerX of the button aligned with parent’s centerX. In main view controller override prefersStatusBarHidden to return true. override var prefersStatusBarHidden: Bool { get { return true } Launch the app and try to click created button. Expected: Created button is clickable and placed slightly below the stage manger’s controls. Safe area does respect the stage manager controls even if the status bar is hidden the same way it behaves in case of avoiding iPhone notches. Or at least there is any API to check if the stage manager is enabled. Actual: Created button is overlapped by the stage manager’s controls and not clickable.
Posted Last updated
.
Post not yet marked as solved
0 Replies
694 Views
I've been playing around with the awesome UIViewPropertyAnimator, but are observing something during scrubbing I don't quite understand. Linearly scrubbing a UIViewPropertyAnimator configured with "fast" timing parameters and/or low animation duration, causes the animated properties to snap between (larger) values at the start of scrubbing. This can be made visible with a simple bottom sheet example (recorded on iPhone 14 Pro with iOS 16.4.1): Small/"fast" timing parameters: Large/"slow" timing parameters: The UIViewPropertyAnimator is instantiated as follows (the issue also observed with other initializers): // duration set to 0.25 gives the unwanted snapping at the start of scrubbing: UIViewPropertyAnimator(duration: 0.25, dampingRatio: 1) // duration set to 1.25 gives the expected smooth scrubbing. UIViewPropertyAnimator(duration: 1.25, dampingRatio: 1) Any ideas about what's going on here? I would expect the scrubbing to be smooth independent of what parameters are given? It's especially odd that the snapping only happens at the start of the scrubbing... Also attached the full example code: BottomSheetAnimationViewController.txt
Posted
by Smed1.
Last updated
.
Post not yet marked as solved
0 Replies
770 Views
Hi, the problem is not dangerous to life, I don't want see the yellow button on top of the editor. 'Autoresizing Mask' is set to about 50 items, that works, except tableView, 10 warnings. The tableView has 10 columns of 20 pixels width, min 10 and max 100000. The ' Add new constraints' options are all grayed, so what ? In an other project a warning was set for arrayController, I don't like Auto Layout, the blue help lines are enough. My question is : How do i can suppress this warnings ? Kindly, Uwe
Posted Last updated
.
Post not yet marked as solved
0 Replies
542 Views
I'm trying to get the row index of a NSTableRowView that has experienced a mouseEnter event. It should be easy with rowAtPoint using NSEvent.locationInWindow. I can't get it to work. The NSTableView lies inside a NSStackView. Of course the NSStackView adjusts the visual size of the NSTableView etc. Is NSStackView interfering? If so, how should I adjust my call to rowAtPoint?
Posted Last updated
.
Post not yet marked as solved
2 Replies
600 Views
hello Developers, im using Iphone 14 pro max and found out that when the Device camera or mic is in use then a notification dot can be seen in the Dynamic island. But if the notification dot is there and we perform another action related to Dynamic island. Like set a Timer or Connect the device with charger. Then the notication dot from middle goes all the way to the right side of the screen. Doesn’t it should just stay in the middle? As none of the other dynamic island related actions consumes that dead pixel part of screen.
Posted Last updated
.