//  代码地址: https://github.com/CoderMJLee/ZYJMJRefresh
//  代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000
//  UIScrollView+Extension.m
//  ZYJMJRefreshExample
//
//  Created by MJ Lee on 14-5-28.
//  Copyright (c) 2014年 小码哥. All rights reserved.
//

#import "UIScrollView+ZYJMJExtension.h"
#import <objc/runtime.h>

@implementation UIScrollView (ZYJMJExtension)

- (void)setMj_ZYJinsetT:(CGFloat)mj_ZYJinsetT
{
    UIEdgeInsets inset = self.contentInset;
    inset.top = mj_ZYJinsetT;
    self.contentInset = inset;
}

- (CGFloat)mj_ZYJinsetT
{
    return self.contentInset.top;
}

- (void)setMj_ZYJinsetB:(CGFloat)mj_ZYJinsetB
{
    UIEdgeInsets inset = self.contentInset;
    inset.bottom = mj_ZYJinsetB;
    self.contentInset = inset;
}

- (CGFloat)mj_ZYJinsetB
{
    return self.contentInset.bottom;
}

- (void)setMj_ZYJinsetL:(CGFloat)mj_ZYJinsetL
{
    UIEdgeInsets inset = self.contentInset;
    inset.left = mj_ZYJinsetL;
    self.contentInset = inset;
}

- (CGFloat)mj_ZYJinsetL
{
    return self.contentInset.left;
}

- (void)setMj_ZYJinsetR:(CGFloat)mj_ZYJinsetR
{
    UIEdgeInsets inset = self.contentInset;
    inset.right = mj_ZYJinsetR;
    self.contentInset = inset;
}

- (CGFloat)mj_ZYJinsetR
{
    return self.contentInset.right;
}

- (void)setMj_ZYJoffsetX:(CGFloat)mj_ZYJoffsetX
{
    CGPoint offset = self.contentOffset;
    offset.x = mj_ZYJoffsetX;
    self.contentOffset = offset;
}

- (CGFloat)mj_ZYJoffsetX
{
    return self.contentOffset.x;
}

- (void)setMj_ZYJoffsetY:(CGFloat)mj_ZYJoffsetY
{
    CGPoint offset = self.contentOffset;
    offset.y = mj_ZYJoffsetY;
    self.contentOffset = offset;
}

- (CGFloat)mj_ZYJoffsetY
{
    return self.contentOffset.y;
}

- (void)setMj_ZYJcontentW:(CGFloat)mj_ZYJcontentW
{
    CGSize size = self.contentSize;
    size.width = mj_ZYJcontentW;
    self.contentSize = size;
}

- (CGFloat)mj_ZYJcontentW
{
    return self.contentSize.width;
}

- (void)setMj_ZYJcontentH:(CGFloat)mj_ZYJcontentH
{
    CGSize size = self.contentSize;
    size.height = mj_ZYJcontentH;
    self.contentSize = size;
}

- (CGFloat)mj_ZYJcontentH
{
    return self.contentSize.height;
}
@end
