lascic / UIOnboarding

Apple-esque animated welcome screen for iOS and iPadOS. Configurable.
MIT License
713 stars 28 forks source link

Multiple Constrains / Layout Failure in iPad (12.9) #10

Closed 224XS closed 1 year ago

224XS commented 2 years ago

iPhone layout is perfect, however, in iPad runtime, there are multiple conflicts:

1) 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:0x60000031d180 UIOnboarding.UIOnboardingTitleLabel:0x7f7f5428a020.width == 904 (active)>", "<NSLayoutConstraint:0x600000316e40 UIOnboarding.UIOnboardingStack:0x7f7f542854b0.width == 480 (active)>", "<NSLayoutConstraint:0x60000032ec10 'UISV-alignment' UIOnboarding.UIOnboardingTitleLabel:0x7f7f542a1eb0.leading == UIOnboarding.UIOnboardingTitleLabel:0x7f7f5428a020.leading (active)>", "<NSLayoutConstraint:0x60000032ec60 'UISV-alignment' UIOnboarding.UIOnboardingTitleLabel:0x7f7f542a1eb0.trailing == UIOnboarding.UIOnboardingTitleLabel:0x7f7f5428a020.trailing (active)>", "<NSLayoutConstraint:0x60000032f2f0 'UISV-alignment' UIView:0x7f7f54247180.leading == UIOnboarding.UIOnboardingTitleLabelStack:0x7f7f542535a0.leading (active)>", "<NSLayoutConstraint:0x60000032eb20 'UISV-canvas-connection' UIOnboarding.UIOnboardingTitleLabelStack:0x7f7f542535a0.leading == UIOnboarding.UIOnboardingTitleLabel:0x7f7f542a1eb0.leading (active)>", "<NSLayoutConstraint:0x60000032ead0 'UISV-canvas-connection' H:[UIOnboarding.UIOnboardingTitleLabel:0x7f7f542a1eb0]-(0)-| (active, names: '|':UIOnboarding.UIOnboardingTitleLabelStack:0x7f7f542535a0 )>", "<NSLayoutConstraint:0x60000032ee90 'UISV-canvas-connection' UIOnboarding.UIOnboardingStack:0x7f7f542854b0.leading == UIView:0x7f7f54247180.leading (active)>", "<NSLayoutConstraint:0x60000032eee0 'UISV-canvas-connection' H:[_UILayoutSpacer:0x600001f5ce10'UISV-alignment-spanner']-(0)-| (active, names: '|':UIOnboarding.UIOnboardingStack:0x7f7f542854b0 )>", "<NSLayoutConstraint:0x60000032f160 'UISV-spanning-boundary' _UILayoutSpacer:0x600001f5ce10'UISV-alignment-spanner'.trailing >= UIOnboarding.UIOnboardingTitleLabelStack:0x7f7f542535a0.trailing (active)>" )

Will attempt to recover by breaking constraint <NSLayoutConstraint:0x60000031d180 UIOnboarding.UIOnboardingTitleLabel:0x7f7f5428a020.width == 904 (active)>

2) ( "<NSLayoutConstraint:0x600000316e40 UIOnboarding.UIOnboardingStack:0x7f7f542854b0.width == 480 (active)>", "<NSLayoutConstraint:0x60000031df90 UIOnboarding.UIOnboardingTitleLabel:0x7f7f542a1eb0.width == 904 (active)>", "<NSLayoutConstraint:0x60000032f2f0 'UISV-alignment' UIView:0x7f7f54247180.leading == UIOnboarding.UIOnboardingTitleLabelStack:0x7f7f542535a0.leading (active)>", "<NSLayoutConstraint:0x60000032eb20 'UISV-canvas-connection' UIOnboarding.UIOnboardingTitleLabelStack:0x7f7f542535a0.leading == UIOnboarding.UIOnboardingTitleLabel:0x7f7f542a1eb0.leading (active)>", "<NSLayoutConstraint:0x60000032ead0 'UISV-canvas-connection' H:[UIOnboarding.UIOnboardingTitleLabel:0x7f7f542a1eb0]-(0)-| (active, names: '|':UIOnboarding.UIOnboardingTitleLabelStack:0x7f7f542535a0 )>", "<NSLayoutConstraint:0x60000032ee90 'UISV-canvas-connection' UIOnboarding.UIOnboardingStack:0x7f7f542854b0.leading == UIView:0x7f7f54247180.leading (active)>", "<NSLayoutConstraint:0x60000032eee0 'UISV-canvas-connection' H:[_UILayoutSpacer:0x600001f5ce10'UISV-alignment-spanner']-(0)-| (active, names: '|':UIOnboarding.UIOnboardingStack:0x7f7f542854b0 )>", "<NSLayoutConstraint:0x60000032f160 'UISV-spanning-boundary' _UILayoutSpacer:0x600001f5ce10'UISV-alignment-spanner'.trailing >= UIOnboarding.UIOnboardingTitleLabelStack:0x7f7f542535a0.trailing (active)>" )

Will attempt to recover by breaking constraint <NSLayoutConstraint:0x60000031df90 UIOnboarding.UIOnboardingTitleLabel:0x7f7f542a1eb0.width == 904 (active)>

lascic commented 2 years ago

I’ll take a look at this layout issue as soon as I can get to. Thanks a lot for your comment and for addressing this! Does it affect the UI at the moment?

224XS commented 2 years ago

Hi Lukman!

Thanks for the rapid response!!

No, the UI runs as expected, which is great! Actually, it is better looking on the iPad than the phone.

This is because, in my opinion, the bottom block with the notices and the button take up too much space on the smaller phone screen. I have so far resisted the temptation to fork your code so I can modify the height of the block, but it would be nice if it was adjustable.

Also, interestingly, the icon in the notice block displays as a mask, not as the image. Was that intentional?

Thanks for sharing this elegant piece of work!

Ira Rampil, MS, MD

On Aug 26, 2022, at 6:16 PM, Lukman Aščić @.***> wrote:

I’ll take a look at this layout issue as soon as I can get to. Thanks a lot for your comment and for addressing this! Does it affect the UI at the moment?

— Reply to this email directly, view it on GitHub https://github.com/lascic/UIOnboarding/issues/10#issuecomment-1229006495, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMHVBHOXIWS7EEWJYJ3Q23V3E64NANCNFSM57W4KUYQ. You are receiving this because you authored the thread.

lascic commented 2 years ago

Thank you, Ira. I truly value your further insight on your comment.

Glad to hear the UI‘s working! I‘ll also make sure the caption text of the notice view is optional in the future. This would not only then just show the continue button, but it‘ll give more space as well...or replace the (currently) long, interactive text view with a simpler, shorter one-line caption button…or make them as two design options the developer can choose from and a third one to not show a caption at all. I‘ll look into that too.

The icon of the caption text is indeed an NSTextAttachment instance instead of an image, which is welded together with the text view above the continue button. This made it easier for me to include it right inside an attributed string without dealing with too many constraints (thinking about Dynamic Type), but I‘ll have to separate that into an image view as other issues started rising up in iOS and iPadOS 15 with my current workaround.

I‘m planning to fix all present issues - including yours - in a v2.1 update alongside the support for Stage Manager in iPadOS 16 later this year.

And I’m looking forward to that – and much more.

Thanks again!

224XS commented 2 years ago

I think I understand the engineering constraints here. Every designer’s requirements are a bit different and you can’t satisfy all ;) Any options you can provide would be appreciated! Best Regards, Ira

Sent from my iPhone

On Aug 26, 2022, at 7:42 PM, Lukman Aščić @.***> wrote:

 Thank you, Ira. I truly value your further insight on your comment.

Glad to hear the UI‘s working! I‘ll also make sure the caption text of the notice view is optional in the future. This would not only then just show the continue button, but it‘ll give more space as well...or replace the (currently) long, interactive text view with a simpler, shorter one-line caption button…or make them as two design options the developer can choose from and a third one to not show a caption at all. I‘ll look into that too.

The icon of the caption text is indeed an NSTextAttachment instance instead of an image, which is welded together with the text view above the continue button. This made it easier for me to include it right inside an attributed string without dealing with too many constraints (thinking about Dynamic Type), but I‘ll have to separate that into an image view as other issues started rising up in iOS and iPadOS 15 with my current workaround.

I‘m planning to fix all present issues - including yours - in a v2.1 update alongside the support for Stage Manager in iPadOS 16 later this year.

And I’m looking forward to that – and much more.

Thanks again!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

224XS commented 1 year ago

Hi Lukman!

Any progress on the above issues? Cheers, Ira

lascic commented 1 year ago

Hi Ira

I‘m occupied with my studies full-time and unfortunately can‘t finalize my fixes at the moment, so it‘s still WIP. Also, I have decided to include the fixes for the present issues in the next major update.

I always appreciate and welcome contributions though. PR‘s are very welcome at this time.

Warm regards Lukman

224XS commented 1 year ago

Hey Lukman!That’s cool!  I’ll take a look at fixing what I need and see if I can match your architecture. If so, I’ll do a pull for you!Be well!IraSent from my iPhoneOn Jan 20, 2023, at 8:01 AM, Lukman „Luke“ Aščić @.***> wrote: Hi Ira I‘m occupied with my studies full-time and unfortunately can‘t finalize my fixes at the moment, so it‘s still WIP. Also, I have decided to include the fixes for the present issues in the next major update. I always appreciate and welcome contributions though. PR‘s are very welcome at this time. Warm regards Lukman

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

lascic commented 1 year ago

Hi, Ira. How's the progress on the layout issues going?

224XS commented 1 year ago

Hey Lukman!I wound up forking a bit to generate a bit more space, but mostly just nil’s some optional fields.It would be great to find a way to drop a hyperlink or a video clip into the text, but I don’t see a straightforward way without severely mangling the code 😵‍💫Thank you for your great work!IraSent from my iPhoneOn Jul 29, 2023, at 4:20 PM, Lukman Aščić @.***> wrote: Hi, Ira. How's the progress on the layout issues going?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

lascic commented 1 year ago

No worries. Sat down today and got all the layout issues resolved. Debugger should be silent in the next patch. Thank you for reporting and thank you a lot for your contribution.

lascic commented 1 year ago

v2.0.2 is up with the latest resolves to the layout errors.