Latest 1.0.9
License MIT
Platforms ios 10.0, requires ARC
Dependencies KeyboardFrameChangeListener, ScrollViewKeyboardAvoider
Frameworks UIKit

Swift v4.2
Test Coverage
Build Status
Carthage compatible

Wraps your custom view and presents it on the screen in the way it fills visible area (not covered by navigation bar, keyboard etc.). If your custom view is too big, you will be able to scroll the content thanks to embedded UIScrollView.

ScrollViewController Demo App

Uses KeyboardFrameChangeListener to observe keyboard frame changes and then
adjusts insets using ScrollViewKeyboardAvoider so the keyboard does not cover the content. Supports "safe area layout" and makes the content fill visible area.

Designed to work on iPhone (including iPhone X) in portrait orientation (should also support other screen orientations as well as iPad screen).


Minimum deployment target: iOS 10.0 (on iOS >= 11 uses Safe Area Layout for iPhone X compatibility)


You can integrate ScrollViewController with your project using CocoaPods. Just add this line to your Podfile:

pod 'ScrollViewController', '~> 1.0'


You can also use Carthage if you prefer by adding following line to your Cartfile:

github "darrarski/ScrollViewController" ~> 1.0

ScrollViewController depends on KeyboardFrameChangeListener and ScrollViewKeyboardAvoider. Dependencies will be automatically resolved by Carthage, but you will have to integrate dependent frameworks with your app as well. For more information refer to Carthage docs.


Example can be found in DemoApp.


let yourContentView: UIView

let scrollViewController = ScrollViewController()
scrollViewController.contentView = yourContentView



To bootstrap the project run:

bundle install
bundle exec fastlane setup

Then open ScrollViewController.xcworkspace in Xcode.

Use DemoApp build scheme for building and runing demo app.

Use Tests build scheme for runing tests.

To run tests from command line execute:

bundle exec fastlane test

To generate and open test coverage report in HTML format, run:

bundle exec fastlane coverage


MIT License – check out LICENSE file.

Latest podspec

    "name": "ScrollViewController",
    "version": "1.0.9",
    "summary": "Controls UIScrollView so the content is in the right place",
    "homepage": "",
    "authors": {
        "Dariusz Rybicki": "[email protected]"
    "social_media_url": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "source": {
        "git": "",
        "tag": "v1.0.9"
    "platforms": {
        "ios": "10.0"
    "swift_version": "4.2",
    "source_files": "Sources",
    "requires_arc": true,
    "frameworks": "UIKit",
    "dependencies": {
        "KeyboardFrameChangeListener": [
            "~> 1.0"
        "ScrollViewKeyboardAvoider": [
            "~> 1.0"

Pin It on Pinterest

Share This