Skip to content
This repository was archived by the owner on Jan 15, 2026. It is now read-only.
This repository was archived by the owner on Jan 15, 2026. It is now read-only.

Wrong content offset with install option scrollToRevealFirstResponder #122

@nataliq

Description

@nataliq

Expected Behavior

scrollToRevealFirstResponder is one of the default install options when using the methods in
UIViewController+Install.swift. When the first responder is visible the scroll view should not change its content offset.

Current Behavior

In certain situations the content will be visible but the method will change the offset of the scroll view to a negative value resulting in empty space on the screen and layout glitch.

Steps to Reproduce

TBD - I will push a branch with a test that reproduces it

Context

Basically if the view controller is in a navigation controller the calculation of the y-position of the visible rect is not correct and if the first responder is the first view on the top of the scroll view we might think that its not fully visible which results in not necessary content offset adjustment.

  • Operating Version: Reproducible on iOS 11+, works fine on iOS 10 (there is difference in the way content insets are propagated to scroll views)

Failure Logs

TBD - include a screenshot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions