Skip to content

Instantly share code, notes, and snippets.

@hamsternik
Last active March 1, 2021 01:19
Show Gist options
  • Save hamsternik/56c04ec7a7877ccbd153e7112b86bef1 to your computer and use it in GitHub Desktop.
Save hamsternik/56c04ec7a7877ccbd153e7112b86bef1 to your computer and use it in GitHub Desktop.
/// # UIKit basic implementation
open class UIScrollView : UIView, NSCoding, UIFocusItemScrollableContainer {
open var contentOffset: CGPoint // default CGPointZero
open var contentSize: CGSize // default CGSizeZero
open var contentInset: UIEdgeInsets // default UIEdgeInsetsZero. add additional scroll area around content
// all another code ...
}
/// # Article basic implementation
class SimpleScrollView: UIView {
var contentView: UIView?
var contentSize: CGSize
var contentOffset: CGPoint
}
/// Source: [Как работает UIScrollView](https://medium.com/@esskeetit/как-работает-uiscrollview-2e7052032d97)
@hamsternik
Copy link
Author

open class UIScrollView : UIView, NSCoding, UIFocusItemScrollableContainer {
    open var contentOffset: CGPoint // default CGPointZero
    open var contentSize: CGSize // default CGSizeZero
    open var contentInset: UIEdgeInsets // default UIEdgeInsetsZero. add additional scroll area around content

    // all another code ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment