ScrollViewLayout
Customize layout of UIScrollView
's subviews using simple API.
Install
Minimum deployment target: iOS 11.0
CocoaPods
You can integrate ScrollViewLayout
with your project using CocoaPods. Just add this line to your Podfile
:
pod 'ScrollViewLayout', '~> 1.0'
Carthage
You can also use Carthage if you prefer by adding following line to your Cartfile
:
github "darrarski/ScrollViewLayout" ~> 1.0
Use
Example can be found in ExampleApp.
TL;DR:
let layoutController = ScrollViewLayoutController(
for: subview,
in: scrollView,
using: ScrollViewLayoutUpdater { subview, scrollView in
// update subview's frame or constraints here
}
)
Use ScrollViewTopBackgroundLayout
or ScrollViewBottomBackgroundLayout
updaters instead of generic ScrollViewLayoutUpdater
to replicate behaviour from example app. Keep strong reference to the controller as long as the layout should be applied.
Develop
Requirements:
To setup the project run:
bundle install
bundle exec fastlane setup
Then open ScrollViewLayout.xcodeproj
in Xcode.
Use ExampleApp
build scheme for building and runing example app.
Use ScrollViewLayout
build scheme for building and testing the framework.
To run tests from command line execute:
bundle exec fastlane test
To generate code coverage report in HTML format execute:
bundle exec fastlane coverage_html
The report will be saved to code_coverage
directory.
License
MIT License - check out LICENSE file.