Skip to content
Make a scrollview quick!
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example Project
.gitignore
LICENSE
README.md
ShaneWork-ScrollView.swift

README.md

ShaneWork-ScrollView

Make a scrollview quick!

    scrollView = ShaneWorkScrollView(frame: self.view.frame) //Make a scrollview at any frame
    self.view.addSubview(scrollView)                         //Add the scrollview as a subview
    scrollView.insertView(orange)                            //Add any UIView that you want to scroll

  1. Copy ShaneWork-ScrollView.swift to your project.

  2. In your view controller, make a property called scrollView

var scrollView = ShaneWorkScrollView()
  1. In your viewDidLoad (or any function)
override func viewDidLoad() {
  super.viewDidLoad()

  //Orange is our subview that we want to scroll
  let orange = UIView(frame: self.view.frame)
  orange.backgroundColor = UIColor(patternImage: UIImage(named: "pattern.jpg")!)

  //Create a scrollView, add it to the current view and set the view you want to scroll
  scrollView = ShaneWorkScrollView(frame: self.view.frame)
  self.view.addSubview(scrollView)
  scrollView.insertView(orange)
}
You can’t perform that action at this time.