import Foundation
import UIKit
//
// UIScrollView.h
// UIKit
//
// Copyright (c) 2007-2016 Apple Inc. All rights reserved.
//
/** 指示器的样式*/
public enum UIScrollViewIndicatorStyle : Int {
/** 默认样式*/
case `default` // black with white border. good against any background
case black // black only. smaller. good against a white background
case white // white only. smaller. good against a black background
}
/** 滑动的时候如果键盘正在显示,对于键盘的处理*/
@available(iOS 7.0, *)
public enum UIScrollViewKeyboardDismissMode : Int {
case none /** 不做任何处理*//** 开始拖动的时候dismiss键盘*/
case onDrag // dismisses the keyboard when a drag begins
/** 一种交互式效果,具体效果就是:当键盘showing的时候,下拉scrollview到top的时候,继续下 拉,这时候键盘也会跟随scrollview下移,并在某个时刻消失*/
case interactive // the keyboard follows the dragging touch off screen, and may be pulled upward again to cancel the dismiss
}
/** 类似tableview右侧的index,一种索引模式*/
public enum UIScrollViewIndexDisplayMode : Int {
case automatic // the index will showor hide automatically as needed
case alwaysHidden // the index will never be displayed
}
/** 减速常量*/
@available(iOS 3.0, *)
public let UIScrollViewDecelerationRateNormal: CGFloat
@available(iOS 3.0, *)
public let UIScrollViewDecelerationRateFast: CGFloat
@available(iOS 2.0, *)
open class UIScrollView : UIView, NSCoding {
/** 当前偏移量*/
open var contentOffset: CGPoint // default CGPointZero
/** scrollview的可移动范围,通俗点理解就是scrollview的真正大小*/
open var contentSize: CGSize // default CGSizeZero
/** 内间距的偏移量*/
open var contentInset: UIEdgeInsets // default UIEdgeInsetsZero. add additional scroll area around content
weak open var delegate: UIScrollViewDelegate? // default nil. weak reference
/** 是否锁定一个方向上的滑动,YES:初始状态下,用户水平滑动,那么垂直方向上的滑动就被禁止;反之亦然。但是如果用户直接斜着滑动,那么便不会锁定某一个方向*/
open var isDirectionalLockEnabled: Bool // defaultNO. if YES, try tolock vertical or horizontal scrolling while dragging
/** 一种弹簧效果(在顶部继续上滑或者底部继续下拉的时候,仅在可滑动的情况下有效)*/
open var bounces: Bool // default YES. if YES, bounces past edge of content and back again
/** 我们知道,只有当scrollview的contentsize大于frame(其它可滑动等属性都已设置)的情况下,scrollview才可以滑动并产生弹簧效果;如果设置该属性为YES,那么即使contentsize很小的情况,只要bounces为YES,也可以产生弹簧效果,作用于垂直方向*/
open var alwaysBounceVertical: Bool // defaultNO. if YES and bounces is YES, even if content is smaller than bounds, allow drag vertically
/** 同上,作用于水平方向*/
open var alwaysBounceHorizontal: Bool // defaultNO. if YES and bounces is YES, even if content is smaller than bounds, allow drag horizontally
/** 分页效果,系统会自动根据
UIScrollView相关文档理解import Foundationimport UIKit//// UIScrollView.h// UIKit//// Copyright (c) 2007-2016 Apple Inc. All rights reserved.///** 指示器的样式*/public enum UIScrollViewIndicatorStyle : In