Latest 1.0.1
Homepage https://github.com/darrarski/ScrollViewLayout
License MIT
Platforms ios 11.0, requires ARC
Frameworks UIKit
Authors

Swift v4.2
Platform iOS
CocoaPods
Carthage compatible

Customize layout of UIScrollView‘s subviews using simple API.

example_app_1.gif
example_app_2.gif

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.

Latest podspec

{
    "name": "ScrollViewLayout",
    "version": "1.0.1",
    "summary": "Customise layout of UIScrollView's subviews",
    "homepage": "https://github.com/darrarski/ScrollViewLayout",
    "authors": {
        "Dariusz Rybicki": "[email protected]"
    },
    "social_media_url": "https://twitter.com/darrarski",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "source": {
        "git": "https://github.com/darrarski/ScrollViewLayout.git",
        "tag": "v1.0.1"
    },
    "platforms": {
        "ios": "11.0"
    },
    "source_files": "ScrollViewLayout",
    "requires_arc": true,
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This