ScrollViewController

master

Wraps your custom view and presents it on the screen in the way it fills visible area
darrarski/ScrollViewController

ScrollViewController

Platform Swift v5.5 test coverage 89% CocoaPods 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

Starting from version v1.1.0, ScrollViewController does no longer depends on KeyboardFrameChangeListener and ScrollViewKeyboardAvoider frameworks, which makes it more portable and easier to integrate. That change also makes those frameworks obsolete.

KeyboardFrameChangeListener is used to observe keyboard frame changes and then adjust 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).

Install

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

Last version developed using Swift 4.2 is v1.0.12.

Swift Package Manager

ScrollViewController is compatible with Swift Package Manager. You can add it as a dependency to your Xcode project or swift package.

CocoaPods

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

pod 'ScrollViewController', '~> 1.3'

Carthage

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

github "darrarski/ScrollViewController" ~> 1.3

Use

Example can be found in DemoApp.

TL;DR

let yourContentView: UIView

let scrollViewController = ScrollViewController()
scrollViewController.contentView = yourContentView

Develop

Requirements:

To bootstrap the project run:

bundle install

Then open ScrollViewController.xcodeproj in Xcode.

Use DemoApp build scheme for building and runing demo app.

Use Tests build scheme for runing tests.

To lint the pod run:

bundle exec pod lib lint --allow-warnings

To deploy the pod run:

bundle exec pod trunk push --allow-warnings

☕️ Do you like the project?

Buy Me A Coffee

License

Copyright © 2022 Dariusz Rybicki Darrarski

MIT License

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Thu Apr 11 2024 11:11:58 GMT-0900 (Hawaii-Aleutian Daylight Time)