Jelajahi Sumber

Modify Class Name

MJ Lee 11 tahun lalu
induk
melakukan
4ef300d9f2

+ 12 - 12
MJRefreshExample/MJRefreshExample.xcodeproj/project.pbxproj

@@ -8,8 +8,8 @@
 
 /* Begin PBXBuildFile section */
 		2D1D8FB21935C0CD0019D689 /* UIScrollView+MJRefresh.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D1D8FB11935C0CD0019D689 /* UIScrollView+MJRefresh.m */; };
-		2D1D8FB51935EABD0019D689 /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D1D8FB41935EABD0019D689 /* UIView+Extension.m */; };
-		2D1D8FB81935EACA0019D689 /* UIScrollView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D1D8FB71935EACA0019D689 /* UIScrollView+Extension.m */; };
+		2D1D8FB51935EABD0019D689 /* UIView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D1D8FB41935EABD0019D689 /* UIView+MJExtension.m */; };
+		2D1D8FB81935EACA0019D689 /* UIScrollView+MJExtension.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D1D8FB71935EACA0019D689 /* UIScrollView+MJExtension.m */; };
 		2D1D8FBC19360E040019D689 /* MJTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D1D8FBA19360E040019D689 /* MJTestViewController.m */; };
 		2D1D8FBD19360E040019D689 /* MJTestViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2D1D8FBB19360E040019D689 /* MJTestViewController.xib */; };
 		2D9CAF6B192FAD750011F500 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D9CAF6A192FAD750011F500 /* Foundation.framework */; };
@@ -49,10 +49,10 @@
 /* Begin PBXFileReference section */
 		2D1D8FB01935C0CD0019D689 /* UIScrollView+MJRefresh.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+MJRefresh.h"; sourceTree = "<group>"; };
 		2D1D8FB11935C0CD0019D689 /* UIScrollView+MJRefresh.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+MJRefresh.m"; sourceTree = "<group>"; };
-		2D1D8FB31935EABD0019D689 /* UIView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; };
-		2D1D8FB41935EABD0019D689 /* UIView+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Extension.m"; sourceTree = "<group>"; };
-		2D1D8FB61935EACA0019D689 /* UIScrollView+Extension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+Extension.h"; sourceTree = "<group>"; };
-		2D1D8FB71935EACA0019D689 /* UIScrollView+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+Extension.m"; sourceTree = "<group>"; };
+		2D1D8FB31935EABD0019D689 /* UIView+MJExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+MJExtension.h"; sourceTree = "<group>"; };
+		2D1D8FB41935EABD0019D689 /* UIView+MJExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+MJExtension.m"; sourceTree = "<group>"; };
+		2D1D8FB61935EACA0019D689 /* UIScrollView+MJExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+MJExtension.h"; sourceTree = "<group>"; };
+		2D1D8FB71935EACA0019D689 /* UIScrollView+MJExtension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+MJExtension.m"; sourceTree = "<group>"; };
 		2D1D8FB919360E040019D689 /* MJTestViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MJTestViewController.h; sourceTree = "<group>"; };
 		2D1D8FBA19360E040019D689 /* MJTestViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MJTestViewController.m; sourceTree = "<group>"; };
 		2D1D8FBB19360E040019D689 /* MJTestViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MJTestViewController.xib; sourceTree = "<group>"; };
@@ -249,10 +249,10 @@
 				2D9CAFBA192FAD9F0011F500 /* MJRefreshHeaderView.m */,
 				2D1D8FB01935C0CD0019D689 /* UIScrollView+MJRefresh.h */,
 				2D1D8FB11935C0CD0019D689 /* UIScrollView+MJRefresh.m */,
-				2D1D8FB31935EABD0019D689 /* UIView+Extension.h */,
-				2D1D8FB41935EABD0019D689 /* UIView+Extension.m */,
-				2D1D8FB61935EACA0019D689 /* UIScrollView+Extension.h */,
-				2D1D8FB71935EACA0019D689 /* UIScrollView+Extension.m */,
+				2D1D8FB31935EABD0019D689 /* UIView+MJExtension.h */,
+				2D1D8FB41935EABD0019D689 /* UIView+MJExtension.m */,
+				2D1D8FB61935EACA0019D689 /* UIScrollView+MJExtension.h */,
+				2D1D8FB71935EACA0019D689 /* UIScrollView+MJExtension.m */,
 			);
 			path = MJRefresh;
 			sourceTree = "<group>";
@@ -357,9 +357,9 @@
 			buildActionMask = 2147483647;
 			files = (
 				2D9CAFC5192FAD9F0011F500 /* MJRefreshFooterView.m in Sources */,
-				2D1D8FB81935EACA0019D689 /* UIScrollView+Extension.m in Sources */,
+				2D1D8FB81935EACA0019D689 /* UIScrollView+MJExtension.m in Sources */,
 				2D9CAFBE192FAD9F0011F500 /* MJTableViewController.m in Sources */,
-				2D1D8FB51935EABD0019D689 /* UIView+Extension.m in Sources */,
+				2D1D8FB51935EABD0019D689 /* UIView+MJExtension.m in Sources */,
 				2D9CAFBD192FAD9F0011F500 /* MJSampleIndexViewController.m in Sources */,
 				2D9CAFBF192FAD9F0011F500 /* MJSampleIndex.m in Sources */,
 				2D9CAFC4192FAD9F0011F500 /* MJRefreshConst.m in Sources */,

TEMPAT SAMPAH
MJRefreshExample/MJRefreshExample.xcodeproj/project.xcworkspace/xcuserdata/mj.xcuserdatad/UserInterfaceState.xcuserstate


+ 6 - 6
MJRefreshExample/MJRefreshExample/MJRefresh/MJRefreshBaseView.m

@@ -8,8 +8,8 @@
 
 #import "MJRefreshBaseView.h"
 #import "MJRefreshConst.h"
-#import "UIView+Extension.h"
-#import "UIScrollView+Extension.h"
+#import "UIView+MJExtension.h"
+#import "UIScrollView+MJExtension.h"
 #import <objc/message.h>
 
 @interface  MJRefreshBaseView()
@@ -85,8 +85,8 @@ - (void)layoutSubviews
     [super layoutSubviews];
     
     // 1.箭头
-    CGFloat arrowX = self.width * 0.5 - 100;
-    self.arrowImage.center = CGPointMake(arrowX, self.height * 0.5);
+    CGFloat arrowX = self.mj_width * 0.5 - 100;
+    self.arrowImage.center = CGPointMake(arrowX, self.mj_height * 0.5);
     
     // 2.指示器
     self.activityView.center = self.arrowImage.center;
@@ -103,9 +103,9 @@ - (void)willMoveToSuperview:(UIView *)newSuperview
         [newSuperview addObserver:self forKeyPath:MJRefreshContentOffset options:NSKeyValueObservingOptionNew context:nil];
         
         // 设置宽度
-        self.width = newSuperview.width;
+        self.mj_width = newSuperview.mj_width;
         // 设置位置
-        self.x = 0;
+        self.mj_x = 0;
         
         // 记录UIScrollView
         _scrollView = (UIScrollView *)newSuperview;

+ 11 - 11
MJRefreshExample/MJRefreshExample/MJRefresh/MJRefreshFooterView.m

@@ -8,8 +8,8 @@
 
 #import "MJRefreshFooterView.h"
 #import "MJRefreshConst.h"
-#import "UIView+Extension.h"
-#import "UIScrollView+Extension.h"
+#import "UIView+MJExtension.h"
+#import "UIScrollView+MJExtension.h"
 
 @interface MJRefreshFooterView()
 @property (assign, nonatomic) int lastRefreshCount;
@@ -59,11 +59,11 @@ - (void)willMoveToSuperview:(UIView *)newSuperview
 - (void)adjustFrameWithContentSize
 {
     // 内容的高度
-    CGFloat contentHeight = self.scrollView.contentSizeHeight;
+    CGFloat contentHeight = self.scrollView.mj_contentSizeHeight;
     // 表格的高度
-    CGFloat scrollHeight = self.scrollView.height - self.scrollViewOriginalInset.top - self.scrollViewOriginalInset.bottom;
+    CGFloat scrollHeight = self.scrollView.mj_height - self.scrollViewOriginalInset.top - self.scrollViewOriginalInset.bottom;
     // 设置位置和尺寸
-    self.y = MAX(contentHeight, scrollHeight);
+    self.mj_y = MAX(contentHeight, scrollHeight);
 }
 
 #pragma mark 监听UIScrollView的属性
@@ -91,7 +91,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
 - (void)adjustStateWithContentOffset
 {
     // 当前的contentOffset
-    CGFloat currentOffsetY = self.scrollView.contentOffsetY;
+    CGFloat currentOffsetY = self.scrollView.mj_contentOffsetY;
     // 尾部控件刚好出现的offsetY
     CGFloat happenOffsetY = [self happenOffsetY];
     
@@ -100,7 +100,7 @@ - (void)adjustStateWithContentOffset
     
     if (self.scrollView.isDragging) {
         // 普通 和 即将刷新 的临界点
-        CGFloat normal2pullingOffsetY = happenOffsetY + self.height;
+        CGFloat normal2pullingOffsetY = happenOffsetY + self.mj_height;
         
         if (self.state == MJRefreshStateNormal && currentOffsetY > normal2pullingOffsetY) {
             // 转为即将刷新状态
@@ -137,7 +137,7 @@ - (void)setState:(MJRefreshState)state
             if (MJRefreshStateRefreshing == oldState) {
                 self.arrowImage.transform = CGAffineTransformMakeRotation(M_PI);
                 [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{
-                    self.scrollView.contentInsetBottom = self.scrollViewOriginalInset.bottom;
+                    self.scrollView.mj_contentInsetBottom = self.scrollViewOriginalInset.bottom;
                 }];
             } else {
                 // 执行动画
@@ -150,7 +150,7 @@ - (void)setState:(MJRefreshState)state
             int currentCount = [self totalDataCountInScrollView];
             // 刚刷新完毕
             if (MJRefreshStateRefreshing == oldState && deltaH > 0 && currentCount != self.lastRefreshCount) {
-                self.scrollView.contentOffsetY = self.scrollView.contentOffsetY;
+                self.scrollView.mj_contentOffsetY = self.scrollView.mj_contentOffsetY;
             }
 			break;
         }
@@ -169,12 +169,12 @@ - (void)setState:(MJRefreshState)state
             self.lastRefreshCount = [self totalDataCountInScrollView];
             
             [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{
-                CGFloat bottom = self.height + self.scrollViewOriginalInset.bottom;
+                CGFloat bottom = self.mj_height + self.scrollViewOriginalInset.bottom;
                 CGFloat deltaH = [self heightForContentBreakView];
                 if (deltaH < 0) { // 如果内容高度小于view的高度
                     bottom -= deltaH;
                 }
-                self.scrollView.contentInsetBottom = bottom;
+                self.scrollView.mj_contentInsetBottom = bottom;
             }];
 			break;
         }

+ 11 - 11
MJRefreshExample/MJRefreshExample/MJRefresh/MJRefreshHeaderView.m

@@ -8,8 +8,8 @@
 
 #import "MJRefreshConst.h"
 #import "MJRefreshHeaderView.h"
-#import "UIView+Extension.h"
-#import "UIScrollView+Extension.h"
+#import "UIView+MJExtension.h"
+#import "UIScrollView+MJExtension.h"
 
 @interface MJRefreshHeaderView()
 // 最后的更新时间
@@ -61,8 +61,8 @@ - (void)layoutSubviews
     
     CGFloat statusX = 0;
     CGFloat statusY = 0;
-    CGFloat statusHeight = self.height * 0.5;
-    CGFloat statusWidth = self.width;
+    CGFloat statusHeight = self.mj_height * 0.5;
+    CGFloat statusWidth = self.mj_width;
     // 1.状态标签
     self.statusLabel.frame = CGRectMake(statusX, statusY, statusWidth, statusHeight);
     
@@ -79,7 +79,7 @@ - (void)willMoveToSuperview:(UIView *)newSuperview
     [super willMoveToSuperview:newSuperview];
     
     // 设置自己的位置和尺寸
-    self.y = - self.height;
+    self.mj_y = - self.mj_height;
 }
 
 #pragma mark - 状态相关
@@ -142,7 +142,7 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N
 - (void)adjustStateWithContentOffset
 {
     // 当前的contentOffset
-    CGFloat currentOffsetY = self.scrollView.contentOffsetY;
+    CGFloat currentOffsetY = self.scrollView.mj_contentOffsetY;
     // 头部控件刚好出现的offsetY
     CGFloat happenOffsetY = - self.scrollViewOriginalInset.top;
     
@@ -151,7 +151,7 @@ - (void)adjustStateWithContentOffset
     
     if (self.scrollView.isDragging) {
         // 普通 和 即将刷新 的临界点
-        CGFloat normal2pullingOffsetY = happenOffsetY - self.height;
+        CGFloat normal2pullingOffsetY = happenOffsetY - self.mj_height;
         
         if (self.state == MJRefreshStateNormal && currentOffsetY < normal2pullingOffsetY) {
             // 转为即将刷新状态
@@ -189,7 +189,7 @@ - (void)setState:(MJRefreshState)state
                 self.lastUpdateTime = [NSDate date];
                 
                 [UIView animateWithDuration:MJRefreshSlowAnimationDuration animations:^{
-                    self.scrollView.contentInsetTop = self.scrollViewOriginalInset.top;
+                    self.scrollView.mj_contentInsetTop = self.scrollViewOriginalInset.top;
                 }];
             } else {
                 // 执行动画
@@ -214,11 +214,11 @@ - (void)setState:(MJRefreshState)state
             // 执行动画
             [UIView animateWithDuration:MJRefreshFastAnimationDuration animations:^{
                 // 1.增加滚动区域
-                CGFloat top = self.scrollViewOriginalInset.top + self.height;
-                self.scrollView.contentInsetTop = top;
+                CGFloat top = self.scrollViewOriginalInset.top + self.mj_height;
+                self.scrollView.mj_contentInsetTop = top;
                 
                 // 2.设置滚动位置
-                self.scrollView.contentOffsetY = - top;
+                self.scrollView.mj_contentOffsetY = - top;
             }];
 			break;
         }

+ 0 - 22
MJRefreshExample/MJRefreshExample/MJRefresh/UIScrollView+Extension.h

@@ -1,22 +0,0 @@
-//
-//  UIScrollView+Extension.h
-//  MJRefreshExample
-//
-//  Created by MJ Lee on 14-5-28.
-//  Copyright (c) 2014年 itcast. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface UIScrollView (Extension)
-@property (assign, nonatomic) CGFloat contentInsetTop;
-@property (assign, nonatomic) CGFloat contentInsetBottom;
-@property (assign, nonatomic) CGFloat contentInsetLeft;
-@property (assign, nonatomic) CGFloat contentInsetRight;
-
-@property (assign, nonatomic) CGFloat contentOffsetX;
-@property (assign, nonatomic) CGFloat contentOffsetY;
-
-@property (assign, nonatomic) CGFloat contentSizeWidth;
-@property (assign, nonatomic) CGFloat contentSizeHeight;
-@end

+ 0 - 107
MJRefreshExample/MJRefreshExample/MJRefresh/UIScrollView+Extension.m

@@ -1,107 +0,0 @@
-//
-//  UIScrollView+Extension.m
-//  MJRefreshExample
-//
-//  Created by MJ Lee on 14-5-28.
-//  Copyright (c) 2014年 itcast. All rights reserved.
-//
-
-#import "UIScrollView+Extension.h"
-
-@implementation UIScrollView (Extension)
-- (void)setContentInsetTop:(CGFloat)contentInsetTop
-{
-    UIEdgeInsets inset = self.contentInset;
-    inset.top = contentInsetTop;
-    self.contentInset = inset;
-}
-
-- (CGFloat)contentInsetTop
-{
-    return self.contentInset.top;
-}
-
-- (void)setContentInsetBottom:(CGFloat)contentInsetBottom
-{
-    UIEdgeInsets inset = self.contentInset;
-    inset.bottom = contentInsetBottom;
-    self.contentInset = inset;
-}
-
-- (CGFloat)contentInsetBottom
-{
-    return self.contentInset.bottom;
-}
-
-- (void)setContentInsetLeft:(CGFloat)contentInsetLeft
-{
-    UIEdgeInsets inset = self.contentInset;
-    inset.left = contentInsetLeft;
-    self.contentInset = inset;
-}
-
-- (CGFloat)contentInsetLeft
-{
-    return self.contentInset.left;
-}
-
-- (void)setContentInsetRight:(CGFloat)contentInsetRight
-{
-    UIEdgeInsets inset = self.contentInset;
-    inset.right = contentInsetRight;
-    self.contentInset = inset;
-}
-
-- (CGFloat)contentInsetRight
-{
-    return self.contentInset.right;
-}
-
-- (void)setContentOffsetX:(CGFloat)contentOffsetX
-{
-    CGPoint offset = self.contentOffset;
-    offset.x = contentOffsetX;
-    self.contentOffset = offset;
-}
-
-- (CGFloat)contentOffsetX
-{
-    return self.contentOffset.x;
-}
-
-- (void)setContentOffsetY:(CGFloat)contentOffsetY
-{
-    CGPoint offset = self.contentOffset;
-    offset.y = contentOffsetY;
-    self.contentOffset = offset;
-}
-
-- (CGFloat)contentOffsetY
-{
-    return self.contentOffset.y;
-}
-
-- (void)setContentSizeWidth:(CGFloat)contentSizeWidth
-{
-    CGSize size = self.contentSize;
-    size.width = contentSizeWidth;
-    self.contentSize = size;
-}
-
-- (CGFloat)contentSizeWidth
-{
-    return self.contentSize.width;
-}
-
-- (void)setContentSizeHeight:(CGFloat)contentSizeHeight
-{
-    CGSize size = self.contentSize;
-    size.height = contentSizeHeight;
-    self.contentSize = size;
-}
-
-- (CGFloat)contentSizeHeight
-{
-    return self.contentSize.height;
-}
-@end

+ 22 - 0
MJRefreshExample/MJRefreshExample/MJRefresh/UIScrollView+MJExtension.h

@@ -0,0 +1,22 @@
+//
+//  UIScrollView+Extension.h
+//  MJRefreshExample
+//
+//  Created by MJ Lee on 14-5-28.
+//  Copyright (c) 2014年 itcast. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UIScrollView (MJExtension)
+@property (assign, nonatomic) CGFloat mj_contentInsetTop;
+@property (assign, nonatomic) CGFloat mj_contentInsetBottom;
+@property (assign, nonatomic) CGFloat mj_contentInsetLeft;
+@property (assign, nonatomic) CGFloat mj_contentInsetRight;
+
+@property (assign, nonatomic) CGFloat mj_contentOffsetX;
+@property (assign, nonatomic) CGFloat mj_contentOffsetY;
+
+@property (assign, nonatomic) CGFloat mj_contentSizeWidth;
+@property (assign, nonatomic) CGFloat mj_contentSizeHeight;
+@end

+ 107 - 0
MJRefreshExample/MJRefreshExample/MJRefresh/UIScrollView+MJExtension.m

@@ -0,0 +1,107 @@
+//
+//  UIScrollView+Extension.m
+//  MJRefreshExample
+//
+//  Created by MJ Lee on 14-5-28.
+//  Copyright (c) 2014年 itcast. All rights reserved.
+//
+
+#import "UIScrollView+MJExtension.h"
+
+@implementation UIScrollView (MJExtension)
+- (void)setMj_contentInsetTop:(CGFloat)mj_contentInsetTop
+{
+    UIEdgeInsets inset = self.contentInset;
+    inset.top = mj_contentInsetTop;
+    self.contentInset = inset;
+}
+
+- (CGFloat)mj_contentInsetTop
+{
+    return self.contentInset.top;
+}
+
+- (void)setMj_contentInsetBottom:(CGFloat)mj_contentInsetBottom
+{
+    UIEdgeInsets inset = self.contentInset;
+    inset.bottom = mj_contentInsetBottom;
+    self.contentInset = inset;
+}
+
+- (CGFloat)mj_contentInsetBottom
+{
+    return self.contentInset.bottom;
+}
+
+- (void)setMj_contentInsetLeft:(CGFloat)mj_contentInsetLeft
+{
+    UIEdgeInsets inset = self.contentInset;
+    inset.left = mj_contentInsetLeft;
+    self.contentInset = inset;
+}
+
+- (CGFloat)mj_contentInsetLeft
+{
+    return self.contentInset.left;
+}
+
+- (void)setMj_contentInsetRight:(CGFloat)mj_contentInsetRight
+{
+    UIEdgeInsets inset = self.contentInset;
+    inset.right = mj_contentInsetRight;
+    self.contentInset = inset;
+}
+
+- (CGFloat)mj_contentInsetRight
+{
+    return self.contentInset.right;
+}
+
+- (void)setMj_contentOffsetX:(CGFloat)mj_contentOffsetX
+{
+    CGPoint offset = self.contentOffset;
+    offset.x = mj_contentOffsetX;
+    self.contentOffset = offset;
+}
+
+- (CGFloat)mj_contentOffsetX
+{
+    return self.contentOffset.x;
+}
+
+- (void)setMj_contentOffsetY:(CGFloat)mj_contentOffsetY
+{
+    CGPoint offset = self.contentOffset;
+    offset.y = mj_contentOffsetY;
+    self.contentOffset = offset;
+}
+
+- (CGFloat)mj_contentOffsetY
+{
+    return self.contentOffset.y;
+}
+
+- (void)setMj_contentSizeWidth:(CGFloat)mj_contentSizeWidth
+{
+    CGSize size = self.contentSize;
+    size.width = mj_contentSizeWidth;
+    self.contentSize = size;
+}
+
+- (CGFloat)mj_contentSizeWidth
+{
+    return self.contentSize.width;
+}
+
+- (void)setMj_contentSizeHeight:(CGFloat)mj_contentSizeHeight
+{
+    CGSize size = self.contentSize;
+    size.height = mj_contentSizeHeight;
+    self.contentSize = size;
+}
+
+- (CGFloat)mj_contentSizeHeight
+{
+    return self.contentSize.height;
+}
+@end

+ 0 - 18
MJRefreshExample/MJRefreshExample/MJRefresh/UIView+Extension.h

@@ -1,18 +0,0 @@
-//
-//  UIView+Extension.h
-//  MJRefreshExample
-//
-//  Created by MJ Lee on 14-5-28.
-//  Copyright (c) 2014年 itcast. All rights reserved.
-//
-
-#import <UIKit/UIKit.h>
-
-@interface UIView (Extension)
-@property (assign, nonatomic) CGFloat x;
-@property (assign, nonatomic) CGFloat y;
-@property (assign, nonatomic) CGFloat width;
-@property (assign, nonatomic) CGFloat height;
-@property (assign, nonatomic) CGSize size;
-@property (assign, nonatomic) CGPoint origin;
-@end

+ 18 - 0
MJRefreshExample/MJRefreshExample/MJRefresh/UIView+MJExtension.h

@@ -0,0 +1,18 @@
+//
+//  UIView+Extension.h
+//  MJRefreshExample
+//
+//  Created by MJ Lee on 14-5-28.
+//  Copyright (c) 2014年 itcast. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UIView (MJExtension)
+@property (assign, nonatomic) CGFloat mj_x;
+@property (assign, nonatomic) CGFloat mj_y;
+@property (assign, nonatomic) CGFloat mj_width;
+@property (assign, nonatomic) CGFloat mj_height;
+@property (assign, nonatomic) CGSize mj_size;
+@property (assign, nonatomic) CGPoint mj_origin;
+@end

+ 20 - 20
MJRefreshExample/MJRefreshExample/MJRefresh/UIView+Extension.m → MJRefreshExample/MJRefreshExample/MJRefresh/UIView+MJExtension.m

@@ -6,77 +6,77 @@
 //  Copyright (c) 2014年 itcast. All rights reserved.
 //
 
-#import "UIView+Extension.h"
+#import "UIView+MJExtension.h"
 
-@implementation UIView (Extension)
-- (void)setX:(CGFloat)x
+@implementation UIView (MJExtension)
+- (void)setMj_x:(CGFloat)mj_x
 {
     CGRect frame = self.frame;
-    frame.origin.x = x;
+    frame.origin.x = mj_x;
     self.frame = frame;
 }
 
-- (CGFloat)x
+- (CGFloat)mj_x
 {
     return self.frame.origin.x;
 }
 
-- (void)setY:(CGFloat)y
+- (void)setMj_y:(CGFloat)mj_y
 {
     CGRect frame = self.frame;
-    frame.origin.y = y;
+    frame.origin.y = mj_y;
     self.frame = frame;
 }
 
-- (CGFloat)y
+- (CGFloat)mj_y
 {
     return self.frame.origin.y;
 }
 
-- (void)setWidth:(CGFloat)width
+- (void)setMj_width:(CGFloat)mj_width
 {
     CGRect frame = self.frame;
-    frame.size.width = width;
+    frame.size.width = mj_width;
     self.frame = frame;
 }
 
-- (CGFloat)width
+- (CGFloat)mj_width
 {
     return self.frame.size.width;
 }
 
-- (void)setHeight:(CGFloat)height
+- (void)setMj_height:(CGFloat)mj_height
 {
     CGRect frame = self.frame;
-    frame.size.height = height;
+    frame.size.height = mj_height;
     self.frame = frame;
 }
 
-- (CGFloat)height
+- (CGFloat)mj_height
 {
     return self.frame.size.height;
 }
 
-- (void)setSize:(CGSize)size
+- (void)setMj_size:(CGSize)mj_size
 {
     CGRect frame = self.frame;
-    frame.size = size;
+    frame.size = mj_size;
     self.frame = frame;
 }
 
-- (CGSize)size
+- (CGSize)mj_size
 {
     return self.frame.size;
 }
 
-- (void)setOrigin:(CGPoint)origin
+- (void)setMj_origin:(CGPoint)mj_origin
 {
     CGRect frame = self.frame;
-    frame.origin = origin;
+    frame.origin = mj_origin;
     self.frame = frame;
 }
 
-- (CGPoint)origin
+- (CGPoint)mj_origin
 {
     return self.frame.origin;
 }