https://github.com/darrarski/scrollviewcontroller
Wraps your custom view and presents it on the screen in the way it fills visible area
https://github.com/darrarski/scrollviewcontroller
cocoapods ios keyboard onscreen-keyboard uikit uiscrollview
Last synced: 6 months ago
JSON representation
Wraps your custom view and presents it on the screen in the way it fills visible area
- Host: GitHub
- URL: https://github.com/darrarski/scrollviewcontroller
- Owner: darrarski
- License: mit
- Created: 2017-11-07T18:39:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-19T13:53:34.000Z (over 3 years ago)
- Last Synced: 2024-11-15T16:42:27.661Z (7 months ago)
- Topics: cocoapods, ios, keyboard, onscreen-keyboard, uikit, uiscrollview
- Language: Swift
- Homepage:
- Size: 878 KB
- Stars: 25
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ScrollViewController



[](https://cocoapods.org/pods/ScrollViewController)
[](https://github.com/Carthage/Carthage)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`.

Starting from version `v1.1.0`, ScrollViewController does no longer depends on [KeyboardFrameChangeListener](https://github.com/darrarski/KeyboardFrameChangeListener) and [ScrollViewKeyboardAvoider](https://github.com/darrarski/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](https://swift.org/package-manager/). You can add it as a dependency to your [Xcode project](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app) or [swift package](https://github.com/apple/swift-package-manager/blob/master/Documentation/Usage.md#defining-dependencies).
### CocoaPods
You can integrate `ScrollViewController` with your project using [CocoaPods](https://cocoapods.org). Just add this line to your `Podfile`:
```ruby
pod 'ScrollViewController', '~> 1.3'
```### Carthage
You can also use [Carthage](https://github.com/Carthage/Carthage) if you prefer by adding following line to your `Cartfile`:
```
github "darrarski/ScrollViewController" ~> 1.3
```## Use
Example can be found in [DemoApp](DemoApp).
**TL;DR**
```swift
let yourContentView: UIViewlet scrollViewController = ScrollViewController()
scrollViewController.contentView = yourContentView
```## Develop
Requirements:
- [Xcode](https://developer.apple.com/xcode/) v13.1
- [Ruby](https://www.ruby-lang.org/) with [Bundler](https://bundler.io/pl)To bootstrap the project run:
```sh
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:
```sh
bundle exec pod lib lint --allow-warnings
```To deploy the pod run:
```sh
bundle exec pod trunk push --allow-warnings
```## ☕️ Do you like the project?
## License
Copyright © 2022 Dariusz Rybicki Darrarski
[MIT License](LICENSE)