├── .gitignore ├── Image ├── Structure.png ├── a.gif └── shot.png ├── LICENSE ├── MVCProject.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── MVCProject ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── LaunchImage.launchimage │ │ ├── Contents.json │ │ ├── LaunchImage-700-568h@2x.png │ │ ├── LaunchImage-700@2x.png │ │ ├── LaunchImage-800-667h@2x.png │ │ ├── LaunchImage-800-Portrait-736h@3x.png │ │ ├── LaunchImage.png │ │ └── LaunchImage@2x.png │ ├── TabBar │ │ ├── Contents.json │ │ ├── cart.imageset │ │ │ ├── Contents.json │ │ │ └── cart@2x.png │ │ ├── cart_select.imageset │ │ │ ├── Contents.json │ │ │ └── cart_select@2x.png │ │ ├── category.imageset │ │ │ ├── Contents.json │ │ │ └── category@2x.png │ │ ├── category_select.imageset │ │ │ ├── Contents.json │ │ │ └── category_select@2x.png │ │ ├── center.imageset │ │ │ ├── Contents.json │ │ │ └── center@2x.png │ │ ├── home.imageset │ │ │ ├── Contents.json │ │ │ └── home@2x.png │ │ ├── home_select.imageset │ │ │ ├── Contents.json │ │ │ └── home_select@2x.png │ │ ├── main_badge.imageset │ │ │ ├── Contents.json │ │ │ └── main_badge.png │ │ ├── mine.imageset │ │ │ ├── Contents.json │ │ │ └── mine@2x.png │ │ ├── mine_select.imageset │ │ │ ├── Contents.json │ │ │ └── mine_select@2x.png │ │ ├── 个人.imageset │ │ │ ├── Contents.json │ │ │ └── 个人@2x.png │ │ ├── 个人_select.imageset │ │ │ ├── Contents.json │ │ │ └── 个人_select@2x.png │ │ ├── 主页.imageset │ │ │ ├── Contents.json │ │ │ └── 主页@2x.png │ │ ├── 主页_select.imageset │ │ │ ├── Contents.json │ │ │ └── 主页_select@2x.png │ │ ├── 信息.imageset │ │ │ ├── Contents.json │ │ │ └── 信息@2x.png │ │ ├── 信息_select.imageset │ │ │ ├── Contents.json │ │ │ └── 信息_select@2x.png │ │ ├── 搜索.imageset │ │ │ ├── Contents.json │ │ │ └── 搜索@2x.png │ │ └── 搜索_select.imageset │ │ │ ├── Contents.json │ │ │ └── 搜索_select@2x.png │ └── 测试 │ │ ├── Contents.json │ │ ├── a.imageset │ │ ├── Contents.json │ │ └── a.png │ │ ├── b.imageset │ │ ├── Contents.json │ │ └── b.png │ │ ├── 分享.imageset │ │ ├── Contents.json │ │ └── 分享.png │ │ └── 爱心.imageset │ │ ├── Contents.json │ │ └── 爱心.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Expand │ ├── Category │ │ ├── Foundation │ │ │ ├── NSData │ │ │ │ ├── NSData+APNSToken.h │ │ │ │ ├── NSData+APNSToken.m │ │ │ │ ├── NSData+Base64.h │ │ │ │ ├── NSData+Base64.m │ │ │ │ ├── NSData+Encrypt.h │ │ │ │ ├── NSData+Encrypt.m │ │ │ │ ├── NSData+Hash.h │ │ │ │ ├── NSData+Hash.m │ │ │ │ ├── NSData+SDDataCache.h │ │ │ │ ├── NSData+SDDataCache.m │ │ │ │ ├── NSDate+Extension.h │ │ │ │ └── NSDate+Extension.m │ │ │ ├── NSDateFormatter │ │ │ │ ├── NSDateFormatter+Make.h │ │ │ │ └── NSDateFormatter+Make.m │ │ │ ├── NSObject │ │ │ │ ├── NSObject+AddProperty.h │ │ │ │ ├── NSObject+AddProperty.m │ │ │ │ ├── NSObject+AppInfo.h │ │ │ │ ├── NSObject+AppInfo.m │ │ │ │ ├── NSObject+AssociatedObject.h │ │ │ │ ├── NSObject+AssociatedObject.m │ │ │ │ ├── NSObject+AutoCoding.h │ │ │ │ ├── NSObject+AutoCoding.m │ │ │ │ ├── NSObject+Blocks.h │ │ │ │ ├── NSObject+Blocks.m │ │ │ │ ├── NSObject+EasyCopy.h │ │ │ │ ├── NSObject+EasyCopy.m │ │ │ │ ├── NSObject+GCD.h │ │ │ │ ├── NSObject+GCD.m │ │ │ │ ├── NSObject+KVOBlocks.h │ │ │ │ ├── NSObject+KVOBlocks.m │ │ │ │ ├── NSObject+MKBlockTimer.h │ │ │ │ ├── NSObject+MKBlockTimer.m │ │ │ │ ├── NSObject+Reflection.h │ │ │ │ ├── NSObject+Reflection.m │ │ │ │ ├── NSObject+Runtime.h │ │ │ │ └── NSObject+Runtime.m │ │ │ ├── NSString │ │ │ │ ├── NSMutableString+Ruby.h │ │ │ │ ├── NSMutableString+Ruby.m │ │ │ │ ├── NSString+Base64.h │ │ │ │ ├── NSString+Base64.m │ │ │ │ ├── NSString+Contains.h │ │ │ │ ├── NSString+Contains.m │ │ │ │ ├── NSString+DictionaryValue.h │ │ │ │ ├── NSString+DictionaryValue.m │ │ │ │ ├── NSString+Emoji.h │ │ │ │ ├── NSString+Emoji.m │ │ │ │ ├── NSString+Encrypt.h │ │ │ │ ├── NSString+Encrypt.m │ │ │ │ ├── NSString+Hash.h │ │ │ │ ├── NSString+Hash.m │ │ │ │ ├── NSString+MIME.h │ │ │ │ ├── NSString+MIME.m │ │ │ │ ├── NSString+Matcher.h │ │ │ │ ├── NSString+Matcher.m │ │ │ │ ├── NSString+Pinyin.h │ │ │ │ ├── NSString+Pinyin.m │ │ │ │ ├── NSString+RegexCategory.h │ │ │ │ ├── NSString+RegexCategory.m │ │ │ │ ├── NSString+RemoveEmoji.h │ │ │ │ ├── NSString+RemoveEmoji.m │ │ │ │ ├── NSString+Ruby.h │ │ │ │ ├── NSString+Ruby.m │ │ │ │ ├── NSString+Score.h │ │ │ │ ├── NSString+Score.m │ │ │ │ ├── NSString+Size.h │ │ │ │ ├── NSString+Size.m │ │ │ │ ├── NSString+Trims.h │ │ │ │ ├── NSString+Trims.m │ │ │ │ ├── NSString+UUID.h │ │ │ │ ├── NSString+UUID.m │ │ │ │ ├── NSString+UrlEncode.h │ │ │ │ ├── NSString+UrlEncode.m │ │ │ │ ├── NSString+XML.h │ │ │ │ └── NSString+XML.m │ │ │ ├── NSTimer │ │ │ │ ├── NSTimer+Addition.h │ │ │ │ ├── NSTimer+Addition.m │ │ │ │ ├── NSTimer+Blocks.h │ │ │ │ └── NSTimer+Blocks.m │ │ │ └── NSURL │ │ │ │ ├── NSURL+Param.h │ │ │ │ ├── NSURL+Param.m │ │ │ │ ├── NSURL+QueryDictionary.h │ │ │ │ └── NSURL+QueryDictionary.m │ │ ├── UIKit │ │ │ ├── UIAlertView │ │ │ │ ├── UIAlertView+Block.h │ │ │ │ └── UIAlertView+Block.m │ │ │ ├── UIApplication │ │ │ │ ├── UIApplication+ApplicationSize.h │ │ │ │ ├── UIApplication+ApplicationSize.m │ │ │ │ ├── UIApplication+KeyboardFrame.h │ │ │ │ ├── UIApplication+KeyboardFrame.m │ │ │ │ ├── UIApplication+NetworkActivityIndicator.h │ │ │ │ ├── UIApplication+NetworkActivityIndicator.m │ │ │ │ ├── UIApplication+Permissions.h │ │ │ │ └── UIApplication+Permissions.m │ │ │ ├── UIBarButtonItem │ │ │ │ ├── UIBarButtonItem+Action.h │ │ │ │ └── UIBarButtonItem+Action.m │ │ │ ├── UIBezierPath │ │ │ │ ├── UIBezierPath+BasicShapes.h │ │ │ │ ├── UIBezierPath+BasicShapes.m │ │ │ │ ├── UIBezierPath+Length.h │ │ │ │ ├── UIBezierPath+Length.m │ │ │ │ ├── UIBezierPath+LxThroughPointsBezier.h │ │ │ │ ├── UIBezierPath+LxThroughPointsBezier.m │ │ │ │ ├── UIBezierPath+SVG.h │ │ │ │ ├── UIBezierPath+SVG.m │ │ │ │ ├── UIBezierPath+Symbol.h │ │ │ │ └── UIBezierPath+Symbol.m │ │ │ ├── UIButton │ │ │ │ ├── UIButton+BackgroundColor.h │ │ │ │ ├── UIButton+BackgroundColor.m │ │ │ │ ├── UIButton+Block.h │ │ │ │ ├── UIButton+Block.m │ │ │ │ ├── UIButton+CountDown.h │ │ │ │ ├── UIButton+CountDown.m │ │ │ │ ├── UIButton+Indicator.h │ │ │ │ ├── UIButton+Indicator.m │ │ │ │ ├── UIButton+MiddleAligning.h │ │ │ │ ├── UIButton+MiddleAligning.m │ │ │ │ ├── UIButton+Submitting.h │ │ │ │ ├── UIButton+Submitting.m │ │ │ │ ├── UIButton+TouchAreaInsets.h │ │ │ │ └── UIButton+TouchAreaInsets.m │ │ │ ├── UIColor │ │ │ │ ├── UIColor+Gradient.h │ │ │ │ ├── UIColor+Gradient.m │ │ │ │ ├── UIColor+HEX.h │ │ │ │ ├── UIColor+HEX.m │ │ │ │ ├── UIColor+Modify.h │ │ │ │ ├── UIColor+Modify.m │ │ │ │ ├── UIColor+Random.h │ │ │ │ ├── UIColor+Random.m │ │ │ │ ├── UIColor+Web.h │ │ │ │ └── UIColor+Web.m │ │ │ ├── UIControl │ │ │ │ ├── UIControl+ActionBlocks.h │ │ │ │ ├── UIControl+ActionBlocks.m │ │ │ │ ├── UIControl+Block.h │ │ │ │ └── UIControl+Block.m │ │ │ ├── UIDevice │ │ │ │ ├── UIDevice+Hardware.h │ │ │ │ ├── UIDevice+Hardware.m │ │ │ │ ├── UIDevice+PasscodeStatus.h │ │ │ │ └── UIDevice+PasscodeStatus.m │ │ │ ├── UIFont │ │ │ │ ├── UIFont+DynamicFontControl.h │ │ │ │ ├── UIFont+DynamicFontControl.m │ │ │ │ ├── UIFont+WDCustomLoader.h │ │ │ │ ├── UIFont+WDCustomLoader.m │ │ │ │ ├── UIFont-TTF.h │ │ │ │ └── UIFont-TTF.m │ │ │ ├── UIImage │ │ │ │ ├── UIImage+Alpha.h │ │ │ │ ├── UIImage+Alpha.m │ │ │ │ ├── UIImage+BetterFace.h │ │ │ │ ├── UIImage+BetterFace.m │ │ │ │ ├── UIImage+Blur.h │ │ │ │ ├── UIImage+Blur.m │ │ │ │ ├── UIImage+Capture.h │ │ │ │ ├── UIImage+Capture.m │ │ │ │ ├── UIImage+Color.h │ │ │ │ ├── UIImage+Color.m │ │ │ │ ├── UIImage+FX.h │ │ │ │ ├── UIImage+FX.m │ │ │ │ ├── UIImage+FileName.h │ │ │ │ ├── UIImage+FileName.m │ │ │ │ ├── UIImage+GIF.h │ │ │ │ ├── UIImage+GIF.m │ │ │ │ ├── UIImage+Merge.h │ │ │ │ ├── UIImage+Merge.m │ │ │ │ ├── UIImage+Orientation.h │ │ │ │ ├── UIImage+Orientation.m │ │ │ │ ├── UIImage+PDF.h │ │ │ │ ├── UIImage+PDF.m │ │ │ │ ├── UIImage+RemoteSize.h │ │ │ │ ├── UIImage+RemoteSize.m │ │ │ │ ├── UIImage+Resize.h │ │ │ │ ├── UIImage+Resize.m │ │ │ │ ├── UIImage+RoundedCorner.h │ │ │ │ ├── UIImage+RoundedCorner.m │ │ │ │ ├── UIImage+Vector.h │ │ │ │ ├── UIImage+Vector.m │ │ │ │ ├── UIImage+animatedGIF.h │ │ │ │ └── UIImage+animatedGIF.m │ │ │ ├── UIImageView │ │ │ │ ├── UIImageView+Addition.h │ │ │ │ ├── UIImageView+Addition.m │ │ │ │ ├── UIImageView+BetterFace.h │ │ │ │ ├── UIImageView+BetterFace.m │ │ │ │ ├── UIImageView+FaceAwareFill.h │ │ │ │ ├── UIImageView+FaceAwareFill.m │ │ │ │ ├── UIImageView+GeometryConversion.h │ │ │ │ ├── UIImageView+GeometryConversion.m │ │ │ │ ├── UIImageView+JWWebCache.h │ │ │ │ ├── UIImageView+JWWebCache.m │ │ │ │ ├── UIImageView+Letters.h │ │ │ │ ├── UIImageView+Letters.m │ │ │ │ ├── UIImageView+Reflect.h │ │ │ │ └── UIImageView+Reflect.m │ │ │ ├── UILable │ │ │ │ ├── UILabel+AutoSize.h │ │ │ │ ├── UILabel+AutoSize.m │ │ │ │ ├── UILabel+AutomaticWriting.h │ │ │ │ ├── UILabel+AutomaticWriting.m │ │ │ │ ├── UILabel+ESAdjustableLabel.h │ │ │ │ ├── UILabel+ESAdjustableLabel.m │ │ │ │ ├── UILabel+SuggestSize.h │ │ │ │ └── UILabel+SuggestSize.m │ │ │ ├── UINavigationBar │ │ │ │ ├── UINavigationBar+Awesome.h │ │ │ │ └── UINavigationBar+Awesome.m │ │ │ ├── UINavigationController │ │ │ │ ├── UINavigationController+BATransitions.h │ │ │ │ ├── UINavigationController+BATransitions.m │ │ │ │ ├── UINavigationController+FDFullscreenPopGesture.h │ │ │ │ ├── UINavigationController+FDFullscreenPopGesture.m │ │ │ │ ├── UINavigationController+JZExtension.h │ │ │ │ ├── UINavigationController+JZExtension.m │ │ │ │ ├── UINavigationController+KeyboardFix.h │ │ │ │ ├── UINavigationController+KeyboardFix.m │ │ │ │ ├── UINavigationController+StackManager.h │ │ │ │ └── UINavigationController+StackManager.m │ │ │ ├── UINavigationItem │ │ │ │ ├── UINavigationItem+Loading.h │ │ │ │ ├── UINavigationItem+Loading.m │ │ │ │ ├── UINavigationItem+Lock.h │ │ │ │ ├── UINavigationItem+Lock.m │ │ │ │ ├── UINavigationItem+Margin.h │ │ │ │ └── UINavigationItem+Margin.m │ │ │ ├── UIPopoverController │ │ │ │ ├── UIPopoverController+iPhone.h │ │ │ │ └── UIPopoverController+iPhone.m │ │ │ ├── UIResponder │ │ │ │ ├── UIResponder+Chain.h │ │ │ │ ├── UIResponder+Chain.m │ │ │ │ ├── UIResponder+FirstResponder.h │ │ │ │ ├── UIResponder+FirstResponder.m │ │ │ │ ├── UIResponder+UIAdapt.h │ │ │ │ └── UIResponder+UIAdapt.m │ │ │ ├── UIScreen │ │ │ │ ├── UIScreen+Frame.h │ │ │ │ └── UIScreen+Frame.m │ │ │ ├── UIScrollView │ │ │ │ ├── UIScrollView+APParallaxHeader.h │ │ │ │ ├── UIScrollView+APParallaxHeader.m │ │ │ │ ├── UIScrollView+Addition.h │ │ │ │ ├── UIScrollView+Addition.m │ │ │ │ ├── UIScrollView+EmptyDataSet.h │ │ │ │ ├── UIScrollView+EmptyDataSet.m │ │ │ │ ├── UIScrollView+Pages.h │ │ │ │ └── UIScrollView+Pages.m │ │ │ ├── UISearchBar │ │ │ │ ├── UISearchBar+Blocks.h │ │ │ │ └── UISearchBar+Blocks.m │ │ │ ├── UISplitViewController │ │ │ │ ├── UISplitViewController+QuickAccess.h │ │ │ │ └── UISplitViewController+QuickAccess.m │ │ │ ├── UITableView │ │ │ │ ├── UITableView+iOS7Style.h │ │ │ │ ├── UITableView+iOS7Style.m │ │ │ │ └── UITableView-FDTemplateLayoutCell │ │ │ │ │ ├── UITableView+FDIndexPathHeightCache.h │ │ │ │ │ ├── UITableView+FDIndexPathHeightCache.m │ │ │ │ │ ├── UITableView+FDKeyedHeightCache.h │ │ │ │ │ ├── UITableView+FDKeyedHeightCache.m │ │ │ │ │ ├── UITableView+FDTemplateLayoutCell.h │ │ │ │ │ ├── UITableView+FDTemplateLayoutCell.m │ │ │ │ │ ├── UITableView+FDTemplateLayoutCellDebug.h │ │ │ │ │ └── UITableView+FDTemplateLayoutCellDebug.m │ │ │ ├── UITableViewCell │ │ │ │ ├── UITableViewCell+NIB.h │ │ │ │ ├── UITableViewCell+NIB.m │ │ │ │ ├── UITableViewCell+TS_delaysContentTouches.h │ │ │ │ └── UITableViewCell+TS_delaysContentTouches.m │ │ │ ├── UITextField │ │ │ │ ├── UITextField+Blocks.h │ │ │ │ ├── UITextField+Blocks.m │ │ │ │ ├── UITextField+History.h │ │ │ │ ├── UITextField+History.m │ │ │ │ ├── UITextField+Select.h │ │ │ │ ├── UITextField+Select.m │ │ │ │ ├── UITextField+Shake.h │ │ │ │ └── UITextField+Shake.m │ │ │ ├── UITextView │ │ │ │ ├── UITextView+PinchZoom.h │ │ │ │ ├── UITextView+PinchZoom.m │ │ │ │ ├── UITextView+PlaceHolder.h │ │ │ │ ├── UITextView+PlaceHolder.m │ │ │ │ ├── UITextView+Select.h │ │ │ │ └── UITextView+Select.m │ │ │ ├── UIView │ │ │ │ ├── UIView+Animation.h │ │ │ │ ├── UIView+Animation.m │ │ │ │ ├── UIView+BlockGesture.h │ │ │ │ ├── UIView+BlockGesture.m │ │ │ │ ├── UIView+Constraints.h │ │ │ │ ├── UIView+Constraints.m │ │ │ │ ├── UIView+CustomBorder.h │ │ │ │ ├── UIView+CustomBorder.m │ │ │ │ ├── UIView+Debug.h │ │ │ │ ├── UIView+Debug.m │ │ │ │ ├── UIView+FDCollapsibleConstraints.h │ │ │ │ ├── UIView+FDCollapsibleConstraints.m │ │ │ │ ├── UIView+Find.h │ │ │ │ ├── UIView+Find.m │ │ │ │ ├── UIView+Frame.h │ │ │ │ ├── UIView+Frame.m │ │ │ │ ├── UIView+GestureCallback.h │ │ │ │ ├── UIView+GestureCallback.m │ │ │ │ ├── UIView+Nib.h │ │ │ │ ├── UIView+Nib.m │ │ │ │ ├── UIView+Recursion.h │ │ │ │ ├── UIView+Recursion.m │ │ │ │ ├── UIView+Screenshot.h │ │ │ │ ├── UIView+Screenshot.m │ │ │ │ ├── UIView+Shake.h │ │ │ │ ├── UIView+Shake.m │ │ │ │ ├── UIView+Toast.h │ │ │ │ ├── UIView+Toast.m │ │ │ │ ├── UIView+ViewController.h │ │ │ │ ├── UIView+ViewController.m │ │ │ │ ├── UIView+Visuals.h │ │ │ │ ├── UIView+Visuals.m │ │ │ │ ├── UIView+draggable.h │ │ │ │ └── UIView+draggable.m │ │ │ ├── UIViewController │ │ │ │ ├── UIViewController+BackButtonHandler.h │ │ │ │ ├── UIViewController+BackButtonHandler.m │ │ │ │ ├── UIViewController+BackButtonItemTitle.h │ │ │ │ ├── UIViewController+BackButtonItemTitle.m │ │ │ │ ├── UIViewController+BackButtonTouched.h │ │ │ │ ├── UIViewController+BackButtonTouched.m │ │ │ │ ├── UIViewController+BlockSegue.h │ │ │ │ ├── UIViewController+BlockSegue.m │ │ │ │ ├── UIViewController+DDPopUpViewController.h │ │ │ │ ├── UIViewController+DDPopUpViewController.m │ │ │ │ ├── UIViewController+MJPopupViewController.h │ │ │ │ ├── UIViewController+MJPopupViewController.m │ │ │ │ ├── UIViewController+StoreKit.h │ │ │ │ ├── UIViewController+StoreKit.m │ │ │ │ ├── UIViewController+TopBarMessage.h │ │ │ │ ├── UIViewController+TopBarMessage.m │ │ │ │ ├── UIViewController+Visible.h │ │ │ │ └── UIViewController+Visible.m │ │ │ ├── UIWebView │ │ │ │ ├── UIWebVIew+SwipeGesture.h │ │ │ │ ├── UIWebVIew+SwipeGesture.m │ │ │ │ ├── UIWebView+Alert.h │ │ │ │ ├── UIWebView+Alert.m │ │ │ │ ├── UIWebView+Blocks.h │ │ │ │ ├── UIWebView+Blocks.m │ │ │ │ ├── UIWebView+Canvas.h │ │ │ │ ├── UIWebView+Canvas.m │ │ │ │ ├── UIWebView+JS.h │ │ │ │ ├── UIWebView+JS.m │ │ │ │ ├── UIWebView+Load.m │ │ │ │ ├── UIWebView+MetaParser.h │ │ │ │ ├── UIWebView+MetaParser.m │ │ │ │ ├── UIWebView+Style.h │ │ │ │ ├── UIWebView+Style.m │ │ │ │ ├── UIWebView+load.h │ │ │ │ ├── WebView+Debug.h │ │ │ │ └── WebView+Debug.m │ │ │ └── UIWindow │ │ │ │ ├── UIWindow+Hierarchy.h │ │ │ │ └── UIWindow+Hierarchy.m │ │ └── UITabBar │ │ │ ├── UITabBar+RangeClick.h │ │ │ └── UITabBar+RangeClick.m │ ├── Const(常量) │ │ └── ThirdKey.h │ ├── Macro(宏) │ │ └── Macros.h │ └── Tool │ │ └── LaunchAd(启动页广告) │ │ ├── JWLaunchAd.h │ │ └── JWLaunchAd.m ├── Info.plist ├── Main │ ├── Base │ │ ├── NavigationController.h │ │ ├── NavigationController.m │ │ ├── TabBarController.h │ │ └── TabBarController.m │ ├── Home │ │ ├── Controller │ │ │ ├── HomeVC.h │ │ │ └── HomeVC.m │ │ └── View │ │ │ ├── HomeCell.h │ │ │ ├── HomeCell.m │ │ │ └── HomeCell.xib │ └── UserCenter │ │ ├── Controller │ │ ├── UserCenterVC.h │ │ └── UserCenterVC.m │ │ └── View │ │ ├── UserCenterGiftCell.h │ │ ├── UserCenterGiftCell.m │ │ ├── UserCenterHeadCell.h │ │ ├── UserCenterHeadCell.m │ │ ├── UserCenterInfoCell.h │ │ ├── UserCenterInfoCell.m │ │ └── UserCenterInfoCell.xib ├── Other │ ├── AppDelegate.h │ └── AppDelegate.m ├── Resource │ └── Global(全局) │ │ └── PrefixHeader.pch └── main.m ├── MVCProjectTests ├── Info.plist └── MVCProjectTests.m ├── MVCProjectUITests ├── Info.plist └── MVCProjectUITests.m └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /Image/Structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/Image/Structure.png -------------------------------------------------------------------------------- /Image/a.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/Image/a.gif -------------------------------------------------------------------------------- /Image/shot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/Image/shot.png -------------------------------------------------------------------------------- /MVCProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-568h@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-667h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-667h@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-Portrait-736h@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-Portrait-736h@3x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/LaunchImage.launchimage/LaunchImage@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/cart.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "cart@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/cart.imageset/cart@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/cart.imageset/cart@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/cart_select.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "cart_select@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/cart_select.imageset/cart_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/cart_select.imageset/cart_select@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/category.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "category@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/category.imageset/category@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/category.imageset/category@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/category_select.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "category_select@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/category_select.imageset/category_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/category_select.imageset/category_select@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "center@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/center.imageset/center@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/center.imageset/center@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/home.imageset/home@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/home.imageset/home@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/home_select.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "home_select@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/home_select.imageset/home_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/home_select.imageset/home_select@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/main_badge.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "main_badge.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/main_badge.imageset/main_badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/main_badge.imageset/main_badge.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/mine.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mine@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/mine.imageset/mine@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/mine.imageset/mine@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/mine_select.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mine_select@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/mine_select.imageset/mine_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/mine_select.imageset/mine_select@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/个人.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "个人@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/个人.imageset/个人@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/个人.imageset/个人@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/个人_select.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "个人_select@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/个人_select.imageset/个人_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/个人_select.imageset/个人_select@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/主页.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "主页@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/主页.imageset/主页@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/主页.imageset/主页@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/主页_select.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "主页_select@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/主页_select.imageset/主页_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/主页_select.imageset/主页_select@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/信息.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "信息@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/信息.imageset/信息@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/信息.imageset/信息@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/信息_select.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "信息_select@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/信息_select.imageset/信息_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/信息_select.imageset/信息_select@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/搜索.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "搜索@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/搜索.imageset/搜索@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/搜索.imageset/搜索@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/搜索_select.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "搜索_select.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "搜索_select@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/TabBar/搜索_select.imageset/搜索_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/TabBar/搜索_select.imageset/搜索_select@2x.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/测试/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/测试/a.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "a.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/测试/a.imageset/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/测试/a.imageset/a.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/测试/b.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "b.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/测试/b.imageset/b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/测试/b.imageset/b.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/测试/分享.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "分享.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/测试/分享.imageset/分享.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/测试/分享.imageset/分享.png -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/测试/爱心.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "爱心.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /MVCProject/Assets.xcassets/测试/爱心.imageset/爱心.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JWXIAN/MVCProject/94061696cc7d3bbb47c7fb26d7ecc07cd1a9f90c/MVCProject/Assets.xcassets/测试/爱心.imageset/爱心.png -------------------------------------------------------------------------------- /MVCProject/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSData/NSData+APNSToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+APNSToken.h 3 | // IOS-Categories 4 | // 5 | // Created by Jakey on 15/8/7. 6 | // Copyright © 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSData (APNSToken) 12 | /** 13 | * @brief 将APNS NSData类型token 格式化成字符串 14 | * 15 | * @return 整理过后的字符串token 16 | */ 17 | - (NSString *)APNSToken; 18 | @end 19 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSData/NSData+APNSToken.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+APNSToken.m 3 | // IOS-Categories 4 | // 5 | // Created by Jakey on 15/8/7. 6 | // Copyright © 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "NSData+APNSToken.h" 10 | 11 | @implementation NSData (APNSToken) 12 | /** 13 | * @brief 将APNS NSData类型token 格式化成字符串 14 | * 15 | * @return 字符串token 16 | */ 17 | - (NSString *)APNSToken { 18 | return [[[[self description] 19 | stringByReplacingOccurrencesOfString: @"<" withString: @""] 20 | stringByReplacingOccurrencesOfString: @">" withString: @""] 21 | stringByReplacingOccurrencesOfString: @" " withString: @""]; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSData/NSData+Base64.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+Base64.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/26. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSData (Base64) 12 | /** 13 | * @brief 字符串base64后转data 14 | * 15 | * @param string 传入字符串 16 | * 17 | * @return 传入字符串 base64后的data 18 | */ 19 | + (NSData *)dataWithBase64EncodedString:(NSString *)string; 20 | /** 21 | * @brief NSData转string 22 | * 23 | * @param wrapWidth 换行长度 76 64 24 | * 25 | * @return base64后的字符串 26 | */ 27 | - (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth; 28 | /** 29 | * @brief NSData转string 换行长度默认64 30 | * 31 | * @return base64后的字符串 32 | */ 33 | - (NSString *)base64EncodedString; 34 | @end 35 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSData/NSData+Encrypt.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+Encrypt.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSData (Encrypt) 12 | 13 | /** 14 | * 利用AES加密数据 15 | * 16 | * @param key key 17 | * @param iv iv description 18 | * 19 | * @return data 20 | */ 21 | - (NSData *)encryptedWithAESUsingKey:(NSString*)key andIV:(NSData*)iv; 22 | /** 23 | * @brief 利用AES解密据 24 | * 25 | * @param key key 26 | * @param iv iv 27 | * 28 | * @return 解密后数据 29 | */ 30 | - (NSData *)decryptedWithAESUsingKey:(NSString*)key andIV:(NSData*)iv; 31 | 32 | /** 33 | * 利用3DES加密数据 34 | * 35 | * @param key key 36 | * @param iv iv description 37 | * 38 | * @return data 39 | */ 40 | - (NSData *)encryptedWith3DESUsingKey:(NSString*)key andIV:(NSData*)iv; 41 | /** 42 | * @brief 利用3DES解密数据 43 | * 44 | * @param key key 45 | * @param iv iv 46 | * 47 | * @return 解密后数据 48 | */ 49 | - (NSData *)decryptedWith3DESUsingKey:(NSString*)key andIV:(NSData*)iv; 50 | 51 | /** 52 | * @brief NSData 转成UTF8 字符串 53 | * 54 | * @return 转成UTF8 字符串 55 | */ 56 | - (NSString *)UTF8String; 57 | @end 58 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSData/NSData+Hash.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+Hash.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/6/1. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSData (Hash) 12 | /** 13 | * @brief md5 NSData 14 | */ 15 | @property (readonly) NSData *md5Data; 16 | /** 17 | * @brief sha1Data NSData 18 | */ 19 | @property (readonly) NSData *sha1Data; 20 | /** 21 | * @brief sha256Data NSData 22 | */ 23 | @property (readonly) NSData *sha256Data; 24 | /** 25 | * @brief sha512Data NSData 26 | */ 27 | @property (readonly) NSData *sha512Data; 28 | 29 | /** 30 | * @brief md5 NSData 31 | * 32 | * @param key 密钥 33 | * 34 | * @return 结果 35 | */ 36 | - (NSData *)hmacMD5DataWithKey:(NSData *)key; 37 | /** 38 | * @brief sha1Data NSData 39 | * 40 | * @param key 密钥 41 | * 42 | * @return 结果 43 | */ 44 | - (NSData *)hmacSHA1DataWithKey:(NSData *)key; 45 | /** 46 | * @brief sha256Data NSData 47 | * 48 | * @param key 密钥 49 | * 50 | * @return 结果 51 | */ 52 | - (NSData *)hmacSHA256DataWithKey:(NSData *)key; 53 | /** 54 | * @brief sha512Data NSData 55 | * 56 | * @param key 密钥 57 | * 58 | * @return 结果 59 | */ 60 | - (NSData *)hmacSHA512DataWithKey:(NSData *)key; 61 | @end 62 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSData/NSData+SDDataCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+SDDataCache.h 3 | // SDCycleScrollView 4 | // 5 | // Created by aier on 15-3-30. 6 | // Copyright (c) 2015年 GSD. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSData (SDDataCache) 13 | 14 | /** 15 | * 将URL作为key保存到磁盘里缓存起来 16 | * 17 | * @param identifier url.absoluteString 18 | */ 19 | - (void)saveDataCacheWithIdentifier:(NSString *)identifier; 20 | 21 | /** 22 | * 取出缓存data 23 | * 24 | * @param identifier url.absoluteString 25 | * 26 | * @return 缓存 27 | */ 28 | + (NSData *)getDataCacheWithIdentifier:(NSString *)identifier; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSDateFormatter/NSDateFormatter+Make.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDateFormatter+Make.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/4/25. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // mobile.dzone.com/news/ios-threadsafe-date-formatting 8 | 9 | #import 10 | 11 | @interface NSDateFormatter (Make) 12 | +(NSDateFormatter *)dateFormatterWithFormat:(NSString *)format; 13 | +(NSDateFormatter *)dateFormatterWithFormat:(NSString *)format timeZone:(NSTimeZone *)timeZone; 14 | +(NSDateFormatter *)dateFormatterWithFormat:(NSString *)format timeZone:(NSTimeZone *)timeZone locale:(NSLocale *)locale; 15 | +(NSDateFormatter *)dateFormatterWithDateStyle:(NSDateFormatterStyle)style; 16 | +(NSDateFormatter *)dateFormatterWithDateStyle:(NSDateFormatterStyle)style timeZone:(NSTimeZone *)timeZone; 17 | +(NSDateFormatter *)dateFormatterWithTimeStyle:(NSDateFormatterStyle)style; 18 | +(NSDateFormatter *)dateFormatterWithTimeStyle:(NSDateFormatterStyle)style timeZone:(NSTimeZone *)timeZone; 19 | @end 20 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+AddProperty.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AddProperty.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (AddProperty) 12 | /** 13 | * @brief catgory runtime实现get set方法增加一个字符串属性 14 | */ 15 | @property (nonatomic,strong) NSString *stringProperty; 16 | /** 17 | * @brief catgory runtime实现get set方法增加一个NSInteger属性 18 | */ 19 | @property (nonatomic,assign) NSInteger integerProperty; 20 | @end 21 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+AddProperty.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AddProperty.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "NSObject+AddProperty.h" 10 | #import 11 | 12 | //objc_getAssociatedObject和objc_setAssociatedObject都需要指定一个固定的地址,这个固定的地址值用来表示属性的key,起到一个常量的作用。 13 | static const void *StringProperty = &StringProperty; 14 | static const void *IntegerProperty = &IntegerProperty; 15 | //static char IntegerProperty; 16 | @implementation NSObject (AddProperty) 17 | 18 | @dynamic stringProperty; 19 | //set 20 | /** 21 | * @brief catgory runtime实现get set方法增加一个字符串属性 22 | */ 23 | -(void)setStringProperty:(NSString *)stringProperty{ 24 | //use that a static const as the key 25 | objc_setAssociatedObject(self, StringProperty, stringProperty, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 26 | //use that property's selector as the key: 27 | //objc_setAssociatedObject(self, @selector(stringProperty), stringProperty, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 28 | } 29 | //get 30 | -(NSString *)stringProperty{ 31 | return objc_getAssociatedObject(self, StringProperty); 32 | } 33 | 34 | //set 35 | /** 36 | * @brief catgory runtime实现get set方法增加一个NSInteger属性 37 | */ 38 | -(void)setIntegerProperty:(NSInteger)integerProperty{ 39 | NSNumber *number = [[NSNumber alloc]initWithInteger:integerProperty]; 40 | objc_setAssociatedObject(self, IntegerProperty, number, OBJC_ASSOCIATION_ASSIGN); 41 | } 42 | //get 43 | -(NSInteger)integerProperty{ 44 | return [objc_getAssociatedObject(self, IntegerProperty) integerValue]; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+AppInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AppInfo.h 3 | // IOS-Categories 4 | // 5 | // Created by nidom on 15/9/29. 6 | // Copyright © 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (AppInfo) 12 | -(NSString *)ai_version; 13 | -(NSInteger)ai_build; 14 | -(NSString *)ai_identifier; 15 | -(NSString *)ai_currentLanguage; 16 | -(NSString *)ai_deviceModel; 17 | @end 18 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+AppInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AppInfo.m 3 | // IOS-Categories 4 | // 5 | // Created by nidom on 15/9/29. 6 | // Copyright © 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "NSObject+AppInfo.h" 10 | #import 11 | @implementation NSObject (AppInfo) 12 | 13 | -(NSString *)ai_version{ 14 | NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 15 | NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; 16 | return app_Version; 17 | } 18 | -(NSInteger)ai_build{ 19 | NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 20 | NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion"]; 21 | return [app_build integerValue]; 22 | } 23 | -(NSString *)ai_identifier{ 24 | NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; 25 | NSString * bundleIdentifier = [infoDictionary objectForKey:@"CFBundleIdentifier"]; 26 | return bundleIdentifier; 27 | } 28 | -(NSString *)ai_currentLanguage{ 29 | NSArray *languages = [NSLocale preferredLanguages]; 30 | NSString *currentLanguage = [languages firstObject]; 31 | return [NSString stringWithString:currentLanguage]; 32 | } 33 | -(NSString *)ai_deviceModel{ 34 | struct utsname systemInfo; 35 | uname(&systemInfo); 36 | NSString *deviceString = [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; 37 | return [NSString stringWithString:deviceString]; 38 | } 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+AssociatedObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AssociatedObject.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/11. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (AssociatedObject) 12 | /** 13 | * @brief 附加一个stong对象 14 | * 15 | * @param value 被附加的对象 16 | * @param key 被附加对象的key 17 | */ 18 | - (void)associateValue:(id)value withKey:(void *)key; // Strong reference 19 | /** 20 | * @brief 附加一个weak对象 21 | * 22 | * @param value 被附加的对象 23 | * @param key 被附加对象的key 24 | */ 25 | - (void)weaklyAssociateValue:(id)value withKey:(void *)key; 26 | 27 | /** 28 | * @brief 根据附加对象的key取出附加对象 29 | * 30 | * @param key 附加对象的key 31 | * 32 | * @return 附加对象 33 | */ 34 | - (id)associatedValueForKey:(void *)key; 35 | @end 36 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+AssociatedObject.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+AssociatedObject.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/11. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "NSObject+AssociatedObject.h" 10 | #import 11 | @implementation NSObject (AssociatedObject) 12 | /** 13 | * @brief 附加一个stong对象 14 | * 15 | * @param value 被附加的对象 16 | * @param key 被附加对象的key 17 | */ 18 | - (void)associateValue:(id)value withKey:(void *)key 19 | { 20 | objc_setAssociatedObject(self, key, value, OBJC_ASSOCIATION_RETAIN); 21 | } 22 | /** 23 | * @brief 附加一个weak对象 24 | * 25 | * @param value 被附加的对象 26 | * @param key 被附加对象的key 27 | */ 28 | - (void)weaklyAssociateValue:(id)value withKey:(void *)key 29 | { 30 | objc_setAssociatedObject(self, key, value, OBJC_ASSOCIATION_ASSIGN); 31 | } 32 | /** 33 | * @brief 根据附加对象的key取出附加对象 34 | * 35 | * @param key 附加对象的key 36 | * 37 | * @return 附加对象 38 | */ 39 | - (id)associatedValueForKey:(void *)key 40 | { 41 | return objc_getAssociatedObject(self, key); 42 | } 43 | @end 44 | 45 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+AutoCoding.h: -------------------------------------------------------------------------------- 1 | // AutoCoding.h 2 | // 3 | // Version 2.2.1 4 | // 5 | // Created by Nick Lockwood on 19/11/2011. 6 | // Copyright (c) 2011 Charcoal Design 7 | // 8 | // Distributed under the permissive zlib License 9 | // Get the latest version from here: 10 | // 11 | // https://github.com/nicklockwood/AutoCoding 12 | // 13 | // This software is provided 'as-is', without any express or implied 14 | // warranty. In no event will the authors be held liable for any damages 15 | // arising from the use of this software. 16 | // 17 | // Permission is granted to anyone to use this software for any purpose, 18 | // including commercial applications, and to alter it and redistribute it 19 | // freely, subject to the following restrictions: 20 | // 21 | // 1. The origin of this software must not be misrepresented; you must not 22 | // claim that you wrote the original software. If you use this software 23 | // in a product, an acknowledgment in the product documentation would be 24 | // appreciated but is not required. 25 | // 26 | // 2. Altered source versions must be plainly marked as such, and must not be 27 | // misrepresented as being the original software. 28 | // 29 | // 3. This notice may not be removed or altered from any source distribution. 30 | // 31 | #import 32 | @interface NSObject (AutoCoding) 33 | //coding 34 | + (NSDictionary *)codableProperties; 35 | - (void)setWithCoder:(NSCoder *)aDecoder; 36 | //property access 37 | - (NSDictionary *)codableProperties; 38 | - (NSDictionary *)dictionaryRepresentation; 39 | //loading / saving 40 | + (instancetype)objectWithContentsOfFile:(NSString *)path; 41 | - (BOOL)writeToFile:(NSString *)filePath atomically:(BOOL)useAuxiliaryFile; 42 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+Blocks.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Blocks.h 3 | // PSFoundation 4 | // 5 | // Created by Peter Steinberger on 24.10.10. 6 | // Copyright 2010 Peter Steinberger. All rights reserved. 7 | // 8 | #import 9 | #import 10 | 11 | @interface NSObject (Blocks) 12 | + (id)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay; 13 | + (id)performBlock:(void (^)(id arg))block withObject:(id)anObject afterDelay:(NSTimeInterval)delay; 14 | - (id)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay; 15 | - (id)performBlock:(void (^)(id arg))block withObject:(id)anObject afterDelay:(NSTimeInterval)delay; 16 | + (void)cancelBlock:(id)block; 17 | + (void)cancelPreviousPerformBlock:(id)aWrappingBlockHandle __attribute__ ((deprecated)); 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+EasyCopy.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+EasyCopy.h 3 | // NSObject-EasyCopy 4 | // 5 | // Created by York on 15/12/1. 6 | // Copyright © 2015年 YK-Unit. All rights reserved. 7 | // 8 | 9 | #import 10 | // a copy category for NSObject 11 | @interface NSObject (EasyCopy) 12 | 13 | /** 14 | * 浅复制目标的所有属性 15 | * 16 | * @param instance 目标对象 17 | * 18 | * @return BOOL—YES:复制成功,NO:复制失败 19 | */ 20 | - (BOOL)easyShallowCopy:(NSObject *)instance; 21 | 22 | /** 23 | * 深复制目标的所有属性 24 | * 25 | * @param instance 目标对象 26 | * 27 | * @return BOOL—YES:复制成功,NO:复制失败 28 | */ 29 | - (BOOL)easyDeepCopy:(NSObject *)instance; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+GCD.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+GCD.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | @interface NSObject (GCD) 11 | /** 12 | * @brief 异步执行代码块 13 | * 14 | * @param block 代码块 15 | */ 16 | - (void)performAsynchronous:(void(^)(void))block; 17 | /** 18 | * @brief GCD主线程执行代码块 19 | * 20 | * @param block 代码块 21 | * @param wait 是否同步请求 22 | */ 23 | - (void)performOnMainThread:(void(^)(void))block wait:(BOOL)wait; 24 | 25 | /** 26 | * @brief 延迟执行代码块 27 | * 28 | * @param seconds 延迟时间 秒 29 | * @param block 代码块 30 | */ 31 | - (void)performAfter:(NSTimeInterval)seconds block:(void(^)(void))block; 32 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+GCD.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+GCD.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "NSObject+GCD.h" 10 | @implementation NSObject (GCD) 11 | /** 12 | * @brief 异步执行代码块 13 | * 14 | * @param block 代码块 15 | */ 16 | - (void)performAsynchronous:(void(^)(void))block { 17 | dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); 18 | dispatch_async(queue, block); 19 | } 20 | /** 21 | * @brief GCD主线程执行代码块 22 | * 23 | * @param block 代码块 24 | * @param wait 是否同步请求 25 | */ 26 | - (void)performOnMainThread:(void(^)(void))block wait:(BOOL)shouldWait { 27 | if (shouldWait) { 28 | // Synchronous 29 | dispatch_sync(dispatch_get_main_queue(), block); 30 | } 31 | else { 32 | // Asynchronous 33 | dispatch_async(dispatch_get_main_queue(), block); 34 | } 35 | } 36 | /** 37 | * @brief 延迟执行代码块 38 | * 39 | * @param seconds 延迟时间 秒 40 | * @param block 代码块 41 | */ 42 | - (void)performAfter:(NSTimeInterval)seconds block:(void(^)(void))block { 43 | dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, seconds * NSEC_PER_SEC); 44 | // dispatch_after(popTime, dispatch_get_current_queue(), block); 45 | dispatch_after(popTime, dispatch_get_main_queue(), block); 46 | 47 | } 48 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSObject/NSObject+Reflection.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+Reflection.h 3 | // NSObject-Reflection 4 | // 5 | // Created by Jakey on 15/12/22. 6 | // Copyright © 2015年 Jakey. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSObject (Reflection) 12 | //类名 13 | - (NSString *)className; 14 | + (NSString *)className; 15 | //父类名称 16 | - (NSString *)superClassName; 17 | + (NSString *)superClassName; 18 | 19 | //实例属性字典 20 | -(NSDictionary *)propertyDictionary; 21 | 22 | //属性名称列表 23 | - (NSArray*)propertyKeys; 24 | + (NSArray *)propertyKeys; 25 | 26 | //属性详细信息列表 27 | - (NSArray *)propertiesInfo; 28 | + (NSArray *)propertiesInfo; 29 | 30 | //格式化后的属性列表 31 | + (NSArray *)propertiesWithCodeFormat; 32 | 33 | //方法列表 34 | -(NSArray*)methodList; 35 | +(NSArray*)methodList; 36 | 37 | -(NSArray*)methodListInfo; 38 | 39 | //创建并返回一个指向所有已注册类的指针列表 40 | + (NSArray *)registedClassList; 41 | //实例变量 42 | + (NSArray *)instanceVariable; 43 | 44 | //协议列表 45 | -(NSDictionary *)protocolList; 46 | + (NSDictionary *)protocolList; 47 | 48 | 49 | - (BOOL)hasPropertyForKey:(NSString*)key; 50 | - (BOOL)hasIvarForKey:(NSString*)key; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSMutableString+Ruby.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSMutableString+Ruby.h 3 | // NSString+Ruby 4 | // 5 | // Created by @thingsdoer on 27/06/2013. 6 | // Copyright (c) 2013 ZD. All rights reserved. 7 | // 8 | //https://github.com/zdavison/NSString-Ruby 9 | #import 10 | #import "NSString+Ruby.h" 11 | 12 | @interface NSMutableString (Ruby) 13 | 14 | //Ruby Methods 15 | -(NSString*)capitalizeInPlace; 16 | -(NSString*)chompInPlace; 17 | -(NSString*)chompInPlace:(NSString*)string; 18 | -(NSString*)chopInPlace; 19 | -(NSString*)deleteInPlace:(NSString*)first, ...; 20 | -(NSString*)lowercaseInPlace; 21 | -(NSString*)substituteAllInPlace:(NSDictionary *)subDictionary; 22 | -(NSString*)substituteAllInPlace:(NSString *)pattern with:(NSString *)sub; 23 | -(NSString*)leftStripInPlace; 24 | -(NSString*)reverseInPlace; 25 | -(NSString*)rightStripInPlace; 26 | -(NSString*)squeezeInPlace; 27 | -(NSString*)squeezeInPlace:(NSString *)pattern; 28 | -(NSString*)stripInPlace; 29 | -(NSString*)substituteFirstInPlace:(NSString *)pattern with:(NSString *)sub; 30 | -(NSString*)substituteLastInPlace:(NSString *)pattern with:(NSString *)sub; 31 | -(NSString*)swapcaseInPlace; 32 | -(NSString*)uppercaseInPlace; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Base64.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Base64.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/2/8. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (Base64) 12 | + (NSString *)stringWithBase64EncodedString:(NSString *)string; 13 | - (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth; 14 | - (NSString *)base64EncodedString; 15 | - (NSString *)base64DecodedString; 16 | - (NSData *)base64DecodedData; 17 | @end 18 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Base64.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Base64.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/2/8. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "NSString+Base64.h" 10 | #import "NSData+Base64.h" 11 | 12 | @implementation NSString (Base64) 13 | + (NSString *)stringWithBase64EncodedString:(NSString *)string 14 | { 15 | NSData *data = [NSData dataWithBase64EncodedString:string]; 16 | if (data) 17 | { 18 | return [[self alloc] initWithData:data encoding:NSUTF8StringEncoding]; 19 | } 20 | return nil; 21 | } 22 | - (NSString *)base64EncodedStringWithWrapWidth:(NSUInteger)wrapWidth 23 | { 24 | NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]; 25 | return [data base64EncodedStringWithWrapWidth:wrapWidth]; 26 | } 27 | - (NSString *)base64EncodedString 28 | { 29 | NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES]; 30 | return [data base64EncodedString]; 31 | } 32 | - (NSString *)base64DecodedString 33 | { 34 | return [NSString stringWithBase64EncodedString:self]; 35 | } 36 | - (NSData *)base64DecodedData 37 | { 38 | return [NSData dataWithBase64EncodedString:self]; 39 | } 40 | @end 41 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Contains.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Contains.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by 符现超 on 15/5/9. 6 | // Copyright (c) 2015年 http://weibo.com/u/1655766025 All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (Contains) 12 | /** 13 | * @brief 判断URL中是否包含中文 14 | * 15 | * @return 是否包含中文 16 | */ 17 | - (BOOL)isContainChinese; 18 | /** 19 | * @brief 是否包含空格 20 | * 21 | * @return 是否包含空格 22 | */ 23 | - (BOOL)isContainBlank; 24 | 25 | /** 26 | * @brief Unicode编码的字符串转成NSString 27 | * 28 | * @return Unicode编码的字符串转成NSString 29 | */ 30 | - (NSString *)makeUnicodeToString; 31 | 32 | - (BOOL)containsCharacterSet:(NSCharacterSet *)set; 33 | /** 34 | * @brief 是否包含字符串 35 | * 36 | * @param string 字符串 37 | * 38 | * @return YES, 包含; 39 | */ 40 | - (BOOL)containsaString:(NSString *)string; 41 | /** 42 | * @brief 获取字符数量 43 | */ 44 | - (int)wordsCount; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+DictionaryValue.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Dictionary.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14-6-13. 6 | // Copyright (c) 2014年 jakey. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (DictionaryValue) 12 | /** 13 | * @brief JSON字符串转成NSDictionary 14 | * 15 | * @return NSDictionary 16 | */ 17 | -(NSDictionary *) dictionaryValue; 18 | @end 19 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+DictionaryValue.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Dictionary.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14-6-13. 6 | // Copyright (c) 2014年 jakey. All rights reserved. 7 | // 8 | 9 | #import "NSString+DictionaryValue.h" 10 | 11 | @implementation NSString (DictionaryValue) 12 | /** 13 | * @brief JSON字符串转成NSDictionary 14 | * 15 | * @return NSDictionary 16 | */ 17 | -(NSDictionary *) dictionaryValue{ 18 | NSError *errorJson; 19 | NSDictionary *jsonDict = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:&errorJson]; 20 | if (errorJson != nil) { 21 | #ifdef DEBUG 22 | NSLog(@"fail to get dictioanry from JSON: %@, error: %@", self, errorJson); 23 | #endif 24 | } 25 | return jsonDict; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Emoji.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Emoji.h 3 | // 4 | // 5 | // Created by Valerio Mazzeo on 24/04/13. 6 | // Copyright (c) 2013 Valerio Mazzeo. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | NSString (Emoji) extends the NSString class to provide custom functionality 12 | related to the Emoji emoticons. 13 | 14 | Through this category, it is possible to turn cheat codes from 15 | Emoji Cheat Sheet into unicode emoji characters 16 | and vice versa (useful if you need to POST a message typed by the user to a remote service). 17 | */ 18 | #import 19 | #import 20 | @interface NSString (Emoji) 21 | 22 | /** 23 | Returns a NSString in which any occurrences that match the cheat codes 24 | from Emoji Cheat Sheet are replaced by the 25 | corresponding unicode characters. 26 | 27 | Example: 28 | "This is a smiley face :smiley:" 29 | 30 | Will be replaced with: 31 | "This is a smiley face \U0001F604" 32 | */ 33 | - (NSString *)stringByReplacingEmojiCheatCodesWithUnicode; 34 | 35 | /** 36 | Returns a NSString in which any occurrences that match the unicode characters 37 | of the emoji emoticons are replaced by the corresponding cheat codes from 38 | Emoji Cheat Sheet . 39 | 40 | Example: 41 | "This is a smiley face \U0001F604" 42 | 43 | Will be replaced with: 44 | "This is a smiley face :smiley:" 45 | */ 46 | - (NSString *)stringByReplacingEmojiUnicodeWithCheatCodes; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Encrypt.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Encrypt.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/26. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (Encrypt) 12 | - (NSString*)encryptedWithAESUsingKey:(NSString*)key andIV:(NSData*)iv; 13 | - (NSString*)decryptedWithAESUsingKey:(NSString*)key andIV:(NSData*)iv; 14 | 15 | - (NSString*)encryptedWith3DESUsingKey:(NSString*)key andIV:(NSData*)iv; 16 | - (NSString*)decryptedWith3DESUsingKey:(NSString*)key andIV:(NSData*)iv; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Encrypt.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Encrypt.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/26. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "NSString+Encrypt.h" 10 | #import "NSData+Encrypt.h" 11 | #import "NSData+Base64.h" 12 | 13 | @implementation NSString (Encrypt) 14 | -(NSString*)encryptedWithAESUsingKey:(NSString*)key andIV:(NSData*)iv { 15 | NSData *encrypted = [[self dataUsingEncoding:NSUTF8StringEncoding] encryptedWithAESUsingKey:key andIV:iv]; 16 | NSString *encryptedString = [encrypted base64EncodedString]; 17 | 18 | return encryptedString; 19 | } 20 | 21 | - (NSString*)decryptedWithAESUsingKey:(NSString*)key andIV:(NSData*)iv { 22 | NSData *decrypted = [[NSData dataWithBase64EncodedString:self] decryptedWithAESUsingKey:key andIV:iv]; 23 | NSString *decryptedString = [[NSString alloc] initWithData:decrypted encoding:NSUTF8StringEncoding]; 24 | 25 | return decryptedString; 26 | } 27 | 28 | - (NSString*)encryptedWith3DESUsingKey:(NSString*)key andIV:(NSData*)iv { 29 | NSData *encrypted = [[self dataUsingEncoding:NSUTF8StringEncoding] encryptedWith3DESUsingKey:key andIV:iv]; 30 | NSString *encryptedString = [encrypted base64EncodedString]; 31 | 32 | return encryptedString; 33 | } 34 | 35 | - (NSString*)decryptedWith3DESUsingKey:(NSString*)key andIV:(NSData*)iv { 36 | NSData *decrypted = [[NSData dataWithBase64EncodedString:self] decryptedWith3DESUsingKey:key andIV:iv]; 37 | NSString *decryptedString = [[NSString alloc] initWithData:decrypted encoding:NSUTF8StringEncoding]; 38 | 39 | return decryptedString; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Hash.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Hash.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | @interface NSString (Hash) 11 | @property (readonly) NSString *md5String; 12 | @property (readonly) NSString *sha1String; 13 | @property (readonly) NSString *sha256String; 14 | @property (readonly) NSString *sha512String; 15 | 16 | - (NSString *)hmacMD5StringWithKey:(NSString *)key; 17 | - (NSString *)hmacSHA1StringWithKey:(NSString *)key; 18 | - (NSString *)hmacSHA256StringWithKey:(NSString *)key; 19 | - (NSString *)hmacSHA512StringWithKey:(NSString *)key; 20 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+MIME.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+MIME.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (MIME) 12 | /** 13 | * @brief 根据文件url 返回对应的MIMEType 14 | * 15 | * @return MIMEType 16 | */ 17 | - (NSString *)MIMEType; 18 | /** 19 | * @brief 根据文件url后缀 返回对应的MIMEType 20 | * 21 | * @return MIMEType 22 | */ 23 | + (NSString *)MIMETypeForExtension:(NSString *)extension; 24 | /** 25 | * @brief 常见MIME集合 26 | * 27 | * @return 常见MIME集合 28 | */ 29 | + (NSDictionary *)MIMEDict; 30 | @end 31 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Matcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Matcher.h 3 | // Whyd 4 | // 5 | // Created by Damien Romito on 29/01/15. 6 | // Copyright (c) 2015 Damien Romito. All rights reserved. 7 | // 8 | //https://github.com/damienromito/NSString-Matcher 9 | #import 10 | @interface NSString(Matcher) 11 | - (NSArray *)matchWithRegex:(NSString *)regex; 12 | - (NSString *)matchWithRegex:(NSString *)regex atIndex:(NSUInteger)index; 13 | - (NSString *)firstMatchedGroupWithRegex:(NSString *)regex; 14 | - (NSTextCheckingResult *)firstMatchedResultWithRegex:(NSString *)regex; 15 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Matcher.m: -------------------------------------------------------------------------------- 1 | // NSString+Matcher.m 2 | // Whyd 3 | // 4 | // Created by Damien Romito on 29/01/15. 5 | // Copyright (c) 2015 Damien Romito. All rights reserved. 6 | // 7 | 8 | #import "NSString+Matcher.h" 9 | 10 | @implementation NSString(Matcher) 11 | 12 | 13 | - (NSArray *)matchWithRegex:(NSString *)regex 14 | { 15 | NSTextCheckingResult *result = [self firstMatchedResultWithRegex:regex]; 16 | NSMutableArray *mArray = [[NSMutableArray alloc] initWithCapacity:[result numberOfRanges]]; 17 | for (int i = 0 ; i < [result numberOfRanges]; i ++ ) { 18 | [mArray addObject:[self substringWithRange:[result rangeAtIndex:i]]]; 19 | } 20 | return mArray; 21 | } 22 | 23 | 24 | - (NSString *)matchWithRegex:(NSString *)regex atIndex:(NSUInteger)index 25 | { 26 | NSTextCheckingResult *result = [self firstMatchedResultWithRegex:regex]; 27 | return [self substringWithRange:[result rangeAtIndex:index]]; 28 | } 29 | 30 | 31 | - (NSString *)firstMatchedGroupWithRegex:(NSString *)regex 32 | { 33 | NSTextCheckingResult *result = [self firstMatchedResultWithRegex:regex]; 34 | return [self substringWithRange:[result rangeAtIndex:1]]; 35 | } 36 | 37 | 38 | - (NSTextCheckingResult *)firstMatchedResultWithRegex:(NSString *)regex 39 | { 40 | NSRegularExpression *regexExpression = [NSRegularExpression regularExpressionWithPattern:regex options:(NSRegularExpressionOptions)0 error:NULL]; 41 | NSRange range = {0, self.length}; 42 | return [regexExpression firstMatchInString:self options:(NSMatchingOptions)0 range:range]; 43 | } 44 | 45 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Pinyin.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Pinyin.h 3 | // Snowball 4 | // 5 | // Created by croath on 11/11/13. 6 | // Copyright (c) 2013 Snowball. All rights reserved. 7 | // 8 | // https://github.com/croath/NSString-Pinyin 9 | // the Chinese Pinyin string of the nsstring 10 | 11 | #import 12 | 13 | @interface NSString (Pinyin) 14 | 15 | - (NSString*)pinyinWithPhoneticSymbol; 16 | - (NSString*)pinyin; 17 | - (NSArray*)pinyinArray; 18 | - (NSString*)pinyinWithoutBlank; 19 | - (NSArray*)pinyinInitialsArray; 20 | - (NSString*)pinyinInitialsString; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+RemoveEmoji.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+RemoveEmoji.h 3 | // NSString+RemoveEmoji 4 | // 5 | // Created by Jakey on 15/5/13. 6 | // Copyright (c) 2015年 Jakey. All rights reserved. 7 | // 8 | #import 9 | 10 | @interface NSString (RemoveEmoji) 11 | /** 12 | * @brief 是否包含emoji 13 | * 14 | * @return 是否包含emoji 15 | */ 16 | - (BOOL)isIncludingEmoji; 17 | 18 | /** 19 | * @brief 删除掉包含的emoji 20 | * 21 | * @return 清除后的string 22 | */ 23 | - (instancetype)removedEmojiString; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Score.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Score.h 3 | // 4 | // Created by Nicholas Bruning on 5/12/11. 5 | // Copyright (c) 2011 Involved Pty Ltd. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | enum{ 11 | NSStringScoreOptionNone = 1 << 0, 12 | NSStringScoreOptionFavorSmallerWords = 1 << 1, 13 | NSStringScoreOptionReducedLongStringPenalty = 1 << 2 14 | }; 15 | 16 | typedef NSUInteger NSStringScoreOption; 17 | 18 | //模糊匹配字符串 查找某两个字符串的相似程度 19 | @interface NSString (Score) 20 | 21 | - (CGFloat) scoreAgainst:(NSString *)otherString; 22 | - (CGFloat) scoreAgainst:(NSString *)otherString fuzziness:(NSNumber *)fuzziness; 23 | - (CGFloat) scoreAgainst:(NSString *)otherString fuzziness:(NSNumber *)fuzziness options:(NSStringScoreOption)options; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Size.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Size.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | @interface NSString (Size) 12 | /** 13 | * @brief 计算文字的高度 14 | * 15 | * @param font 字体(默认为系统字体) 16 | * @param width 约束宽度 17 | */ 18 | - (CGFloat)heightWithFont:(UIFont *)font constrainedToWidth:(CGFloat)width; 19 | /** 20 | * @brief 计算文字的宽度 21 | * 22 | * @param font 字体(默认为系统字体) 23 | * @param height 约束高度 24 | */ 25 | - (CGFloat)widthWithFont:(UIFont *)font constrainedToHeight:(CGFloat)height; 26 | 27 | /** 28 | * @brief 计算文字的大小 29 | * 30 | * @param font 字体(默认为系统字体) 31 | * @param width 约束宽度 32 | */ 33 | - (CGSize)sizeWithFont:(UIFont *)font constrainedToWidth:(CGFloat)width; 34 | /** 35 | * @brief 计算文字的大小 36 | * 37 | * @param font 字体(默认为系统字体) 38 | * @param height 约束高度 39 | */ 40 | - (CGSize)sizeWithFont:(UIFont *)font constrainedToHeight:(CGFloat)height; 41 | 42 | /** 43 | * @brief 反转字符串 44 | * 45 | * @param strSrc 被反转字符串 46 | * 47 | * @return 反转后字符串 48 | */ 49 | + (NSString *)reverseString:(NSString *)strSrc; 50 | @end 51 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+Trims.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Trims.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/3/29. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (Trims) 12 | /** 13 | * @brief 清除html标签 14 | * 15 | * @return 清除后的结果 16 | */ 17 | - (NSString *)stringByStrippingHTML; 18 | /** 19 | * @brief 清除js脚本 20 | * 21 | * @return 清楚js后的结果 22 | */ 23 | - (NSString *)stringByRemovingScriptsAndStrippingHTML; 24 | /** 25 | * @brief 去除空格 26 | * 27 | * @return 去除空格后的字符串 28 | */ 29 | - (NSString *)trimmingWhitespace; 30 | /** 31 | * @brief 去除字符串与空行 32 | * 33 | * @return 去除字符串与空行的字符串 34 | */ 35 | - (NSString *)trimmingWhitespaceAndNewlines; 36 | @end 37 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+UUID.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+UUID.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (UUID) 12 | /** 13 | * @brief 获取随机 UUID 例如 E621E1F8-C36C-495A-93FC-0C247A3E6E5F 14 | * 15 | * @return 随机 UUID 16 | */ 17 | + (NSString *)UUID; 18 | /** 19 | * 20 | * @brief 毫秒时间戳 例如 1443066826371 21 | * 22 | * @return 毫秒时间戳 23 | */ 24 | + (NSString *)UUIDTimestamp; 25 | @end 26 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+UUID.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+UUID.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "NSString+UUID.h" 10 | #import 11 | @implementation NSString (UUID) 12 | /** 13 | * @brief 获取随机 UUID 例如 E621E1F8-C36C-495A-93FC-0C247A3E6E5F 14 | * 15 | * @return 随机 UUID 16 | */ 17 | + (NSString *)UUID 18 | { 19 | if([[[UIDevice currentDevice] systemVersion] floatValue] > 6.0) 20 | { 21 | return [[NSUUID UUID] UUIDString]; 22 | } 23 | else 24 | { 25 | CFUUIDRef uuidRef = CFUUIDCreate(NULL); 26 | CFStringRef uuid = CFUUIDCreateString(NULL, uuidRef); 27 | CFRelease(uuidRef); 28 | return (__bridge_transfer NSString *)uuid; 29 | } 30 | } 31 | /** 32 | * 33 | * @brief 毫秒时间戳 例如 1443066826371 34 | * 35 | * @return 毫秒时间戳 36 | */ 37 | + (NSString *)UUIDTimestamp 38 | { 39 | return [[NSNumber numberWithLongLong:[[NSDate date] timeIntervalSince1970]*1000] stringValue]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+UrlEncode.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+UrlEncode.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @interface NSString (UrlEncode) 13 | /** 14 | * @brief urlEncode 15 | * 16 | * @return urlEncode 后的字符串 17 | */ 18 | - (NSString *)urlEncode; 19 | /** 20 | * @brief urlEncode 21 | * 22 | * @param encoding encoding模式 23 | * 24 | * @return urlEncode 后的字符串 25 | */ 26 | - (NSString *)urlEncodeUsingEncoding:(NSStringEncoding)encoding; 27 | /** 28 | * @brief urlDecode 29 | * 30 | * @return urlDecode 后的字符串 31 | */ 32 | - (NSString *)urlDecode; 33 | /** 34 | * @brief urlDecode 35 | * 36 | * @param encoding encoding模式 37 | * 38 | * @return urlDecode 后的字符串 39 | */ 40 | - (NSString *)urlDecodeUsingEncoding:(NSStringEncoding)encoding; 41 | 42 | /** 43 | * @brief url query转成NSDictionary 44 | * 45 | * @return NSDictionary 46 | */ 47 | - (NSDictionary *)dictionaryFromURLParameters; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSString/NSString+XML.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+XML.h 3 | // Created by Hyde, Andrew on 3/20/13. 4 | // A simple converter from a string containing XML to an NSDictionary, backed by NSXMLParser. 5 | // Will return nil if there has been an error. 6 | 7 | /* 8 | 9 | #import "NSString+XML.h" 10 | 11 | ... 12 | 13 | NSString *XMLString = @"data"; 14 | NSDictionary *XMLAsDictionary = [XMLString dictionaryFromXML]; 15 | 16 | */ 17 | 18 | //https://github.com/AndrewHydeJr/NSString-XML 19 | #import 20 | 21 | @interface NSString (XML) 22 | /** 23 | * @brief xml字符串转换成NSDictionary 24 | * 25 | * @return NSDictionary 26 | */ 27 | -(NSDictionary *)dictionaryFromXML; 28 | 29 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSTimer/NSTimer+Addition.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSTimer+Addition.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSTimer (Addition) 12 | /** 13 | * @brief 暂停NSTimer 14 | */ 15 | - (void)pauseTimer; 16 | /** 17 | * @brief 开始NSTimer 18 | */ 19 | - (void)resumeTimer; 20 | /** 21 | * @brief 延迟开始NSTimer 22 | */ 23 | - (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval; 24 | @end 25 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSTimer/NSTimer+Addition.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSTimer+Addition.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "NSTimer+Addition.h" 10 | 11 | @implementation NSTimer (Addition) 12 | /** 13 | * @brief 暂停NSTimer 14 | */ 15 | -(void)pauseTimer 16 | { 17 | if (![self isValid]) { 18 | return ; 19 | } 20 | [self setFireDate:[NSDate distantFuture]]; 21 | } 22 | /** 23 | * @brief 开始NSTimer 24 | */ 25 | -(void)resumeTimer 26 | { 27 | if (![self isValid]) { 28 | return ; 29 | } 30 | [self setFireDate:[NSDate date]]; 31 | } 32 | /** 33 | * @brief 延迟开始NSTimer 34 | */ 35 | - (void)resumeTimerAfterTimeInterval:(NSTimeInterval)interval 36 | { 37 | if (![self isValid]) { 38 | return ; 39 | } 40 | [self setFireDate:[NSDate dateWithTimeIntervalSinceNow:interval]]; 41 | } 42 | @end 43 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSTimer/NSTimer+Blocks.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSTimer+Blocks.h 3 | // 4 | // Created by Jiva DeVoe on 1/14/11. 5 | // Copyright 2011 Random Ideas, LLC. All rights reserved. 6 | // 7 | // Copyright (C) 2011 by Random Ideas, LLC 8 | // 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software andassociated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 11 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 12 | 13 | // https://github.com/jivadevoe/NSTimer-Blocks 14 | 15 | #import 16 | 17 | @interface NSTimer (Blocks) 18 | +(id)scheduledTimerWithTimeInterval:(NSTimeInterval)inTimeInterval block:(void (^)())inBlock repeats:(BOOL)inRepeats; 19 | +(id)timerWithTimeInterval:(NSTimeInterval)inTimeInterval block:(void (^)())inBlock repeats:(BOOL)inRepeats; 20 | @end 21 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSTimer/NSTimer+Blocks.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSTimer+Blocks.m 3 | // 4 | // Created by Jiva DeVoe on 1/14/11. 5 | // Copyright 2011 Random Ideas, LLC. All rights reserved. 6 | // 7 | 8 | #import "NSTimer+Blocks.h" 9 | 10 | @implementation NSTimer (Blocks) 11 | 12 | +(id)scheduledTimerWithTimeInterval:(NSTimeInterval)inTimeInterval block:(void (^)())inBlock repeats:(BOOL)inRepeats 13 | { 14 | void (^block)() = [inBlock copy]; 15 | id ret = [self scheduledTimerWithTimeInterval:inTimeInterval target:self selector:@selector(jdExecuteSimpleBlock:) userInfo:block repeats:inRepeats]; 16 | return ret; 17 | } 18 | 19 | +(id)timerWithTimeInterval:(NSTimeInterval)inTimeInterval block:(void (^)())inBlock repeats:(BOOL)inRepeats 20 | { 21 | void (^block)() = [inBlock copy]; 22 | id ret = [self timerWithTimeInterval:inTimeInterval target:self selector:@selector(jdExecuteSimpleBlock:) userInfo:block repeats:inRepeats]; 23 | return ret; 24 | } 25 | 26 | +(void)jdExecuteSimpleBlock:(NSTimer *)inTimer; 27 | { 28 | if([inTimer userInfo]) 29 | { 30 | void (^block)() = (void (^)())[inTimer userInfo]; 31 | block(); 32 | } 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSURL/NSURL+Param.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+Param.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSURL (Param) 12 | /** 13 | * @brief url参数转字典 14 | * 15 | * @return 参数转字典结果 16 | */ 17 | - (NSDictionary *)parameters; 18 | /** 19 | * @brief 根据参数名 取参数值 20 | * 21 | * @param parameterKey 参数名的key 22 | * 23 | * @return 参数值 24 | */ 25 | - (NSString *)valueForParameter:(NSString *)parameterKey; 26 | @end 27 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/Foundation/NSURL/NSURL+Param.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSURL+Param.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "NSURL+Param.h" 10 | 11 | @implementation NSURL (Param) 12 | /** 13 | * @brief url参数转字典 14 | * 15 | * @return 参数转字典结果 16 | */ 17 | - (NSDictionary *)parameters 18 | { 19 | NSMutableDictionary * parametersDictionary = [NSMutableDictionary dictionary]; 20 | NSArray * queryComponents = [self.query componentsSeparatedByString:@"&"]; 21 | for (NSString * queryComponent in queryComponents) { 22 | NSString * key = [queryComponent componentsSeparatedByString:@"="].firstObject; 23 | NSString * value = [queryComponent substringFromIndex:(key.length + 1)]; 24 | [parametersDictionary setObject:value forKey:key]; 25 | } 26 | return parametersDictionary; 27 | } 28 | /** 29 | * @brief 根据参数名 取参数值 30 | * 31 | * @param parameterKey 参数名的key 32 | * 33 | * @return 参数值 34 | */ 35 | - (NSString *)valueForParameter:(NSString *)parameterKey 36 | { 37 | return [[self parameters] objectForKey:parameterKey]; 38 | } 39 | @end 40 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIAlertView/UIAlertView+Block.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIAlertView+Block.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by 符现超 on 15/5/9. 6 | // Copyright (c) 2015年 http://weibo.com/u/1655766025 All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^UIAlertViewCallBackBlock)(NSInteger buttonIndex); 12 | 13 | @interface UIAlertView (Block) 14 | 15 | @property (nonatomic, copy) UIAlertViewCallBackBlock alertViewCallBackBlock; 16 | 17 | + (void)alertWithCallBackBlock:(UIAlertViewCallBackBlock)alertViewCallBackBlock title:(NSString *)title message:(NSString *)message cancelButtonName:(NSString *)cancelButtonName otherButtonTitles:(NSString *)otherButtonTitles, ...NS_REQUIRES_NIL_TERMINATION; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIApplication/UIApplication+ApplicationSize.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+ApplicationSize.h 3 | // testSize 4 | // 5 | // Created by Ignazio Calo on 23/01/15. 6 | // Copyright (c) 2015 IgnazioC. All rights reserved. 7 | // https://github.com/ignazioc/iOSApplicationSize 8 | // A small category on UIApplication used to calculate the size of the running iOS applicaiton. 9 | 10 | 11 | #import 12 | 13 | @interface UIApplication (ApplicationSize) 14 | - (NSString *)applicationSize; 15 | @end 16 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIApplication/UIApplication+KeyboardFrame.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+KeyboardFrame.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/23. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIApplication (KeyboardFrame) 12 | - (CGRect)keyboardFrame; 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIApplication/UIApplication+KeyboardFrame.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+KeyboardFrame.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/23. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIApplication+KeyboardFrame.h" 10 | 11 | @implementation UIApplication (KeyboardFrame) 12 | static CGRect _keyboardFrame = (CGRect){ (CGPoint){ 0.0f, 0.0f }, (CGSize){ 0.0f, 0.0f } }; 13 | 14 | - (CGRect)keyboardFrame { 15 | return _keyboardFrame; 16 | } 17 | 18 | + (void)load 19 | { 20 | [NSNotificationCenter.defaultCenter addObserverForName:UIKeyboardDidShowNotification object:nil queue:nil usingBlock:^(NSNotification *note) 21 | { 22 | _keyboardFrame = [note.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 23 | }]; 24 | [NSNotificationCenter.defaultCenter addObserverForName:UIKeyboardDidChangeFrameNotification object:nil queue:nil usingBlock:^(NSNotification *note) 25 | { 26 | _keyboardFrame = [note.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 27 | }]; 28 | [NSNotificationCenter.defaultCenter addObserverForName:UIKeyboardDidHideNotification object:nil queue:nil usingBlock:^(NSNotification *note) 29 | { 30 | _keyboardFrame = CGRectZero; 31 | }]; 32 | } 33 | @end 34 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIApplication/UIApplication+NetworkActivityIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+NetworkActivityIndicator.h 3 | // NetworkActivityIndicator 4 | // 5 | // Created by Matt Zanchelli on 1/10/14. 6 | // Copyright (c) 2014 Matt Zanchelli. All rights reserved. 7 | // https://github.com/mdznr/NetworkActivityIndicator 8 | 9 | #import 10 | 11 | @interface UIApplication (NetworkActivityIndicator) 12 | 13 | /* 14 | This category will automatically keep track of concurrent network activity and display the network activity indicator accordingly. 15 | */ 16 | 17 | /// Tell the application that network activity has begun. The network activity indicator will then be shown. 18 | /// Display the network activity indicator to provide feedback when your application accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator would be likely to disappear before users notice its presence. 19 | - (void)beganNetworkActivity; 20 | 21 | /// Tell the application that a session of network activity has begun. The network activity indicator will remain showing or hide automatically depending the presence of other ongoing network activity in the app. 22 | - (void)endedNetworkActivity; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIApplication/UIApplication+NetworkActivityIndicator.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+NetworkActivityIndicator.m 3 | // NetworkActivityIndicator 4 | // 5 | // Created by Matt Zanchelli on 1/10/14. 6 | // Copyright (c) 2014 Matt Zanchelli. All rights reserved. 7 | // 8 | 9 | #import "UIApplication+NetworkActivityIndicator.h" 10 | 11 | #import 12 | 13 | @implementation UIApplication (NetworkActivityIndicator) 14 | 15 | static volatile int32_t numberOfActiveNetworkConnections; 16 | 17 | #pragma mark Public API 18 | 19 | - (void)beganNetworkActivity 20 | { 21 | self.networkActivityIndicatorVisible = OSAtomicAdd32(1, &numberOfActiveNetworkConnections) > 0; 22 | } 23 | 24 | - (void)endedNetworkActivity 25 | { 26 | self.networkActivityIndicatorVisible = OSAtomicAdd32(-1, &numberOfActiveNetworkConnections) > 0; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIBarButtonItem/UIBarButtonItem+Action.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIBarButtonItem+Action.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef void (^BarButtonActionBlock)(); 11 | 12 | @interface UIBarButtonItem (Action) 13 | 14 | /// A block that is run when the UIBarButtonItem is tapped. 15 | //@property (nonatomic, copy) dispatch_block_t actionBlock; 16 | - (void)setActionBlock:(BarButtonActionBlock)actionBlock; 17 | @end 18 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIBarButtonItem/UIBarButtonItem+Action.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIBarButtonItem+Action.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | char * const UIBarButtonItemActionBlock = "UIBarButtonItemActionBlock"; 10 | #import "UIBarButtonItem+Action.h" 11 | #import 12 | 13 | @implementation UIBarButtonItem (Action) 14 | 15 | - (void)performActionBlock { 16 | 17 | dispatch_block_t block = self.actionBlock; 18 | 19 | if (block) 20 | block(); 21 | 22 | } 23 | 24 | - (BarButtonActionBlock)actionBlock { 25 | return objc_getAssociatedObject(self, UIBarButtonItemActionBlock); 26 | } 27 | 28 | - (void)setActionBlock:(BarButtonActionBlock)actionBlock 29 | { 30 | 31 | if (actionBlock != self.actionBlock) { 32 | [self willChangeValueForKey:@"actionBlock"]; 33 | 34 | objc_setAssociatedObject(self, 35 | UIBarButtonItemActionBlock, 36 | actionBlock, 37 | OBJC_ASSOCIATION_COPY); 38 | 39 | // Sets up the action. 40 | [self setTarget:self]; 41 | [self setAction:@selector(performActionBlock)]; 42 | 43 | [self didChangeValueForKey:@"actionBlock"]; 44 | } 45 | } 46 | @end 47 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIBezierPath/UIBezierPath+BasicShapes.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIBezierPath+BasicShapes.h 3 | // Example 4 | // 5 | // Created by Pierre Dulac on 26/02/13. 6 | // Copyright (c) 2013 Pierre Dulac. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIBezierPath (BasicShapes) 12 | 13 | + (UIBezierPath *)heartShape:(CGRect)originalFrame; 14 | + (UIBezierPath *)userShape:(CGRect)originalFrame; 15 | + (UIBezierPath *)martiniShape:(CGRect)originalFrame; 16 | + (UIBezierPath *)beakerShape:(CGRect)originalFrame; 17 | + (UIBezierPath *)starShape:(CGRect)originalFrame; 18 | + (UIBezierPath *)stars:(NSUInteger)numberOfStars shapeInFrame:(CGRect)originalFrame; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIBezierPath/UIBezierPath+Length.h: -------------------------------------------------------------------------------- 1 | // A category on UIBezierPath that calculates the length and a point at a given length of the path. 2 | //https://github.com/ImJCabus/UIBezierPath-Length 3 | @import UIKit; 4 | 5 | @interface UIBezierPath (Length) 6 | 7 | - (CGFloat)length; 8 | 9 | - (CGPoint)pointAtPercentOfLength:(CGFloat)percent; 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIBezierPath/UIBezierPath+LxThroughPointsBezier.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIBezierPath+LxThroughPointsBezier.h 3 | // LxThroughPointsBezierDemo 4 | // 5 | // A funny iOS library. Draw a smooth bezier through several points you designated. The curve‘s bend level is adjustable. 6 | 7 | //https://github.com/DeveloperLx/LxThroughPointsBezier 8 | 9 | #import 10 | 11 | @interface UIBezierPath (LxThroughPointsBezier) 12 | 13 | /** 14 | * The curve‘s bend level. The good value is about 0.6 ~ 0.8. The default and recommended value is 0.7. 15 | */ 16 | @property (nonatomic) CGFloat contractionFactor; 17 | 18 | /** 19 | * You must wrap CGPoint struct to NSValue object. 20 | * 21 | * @param pointArray Points you want to through. You must give at least 1 point for drawing curve. 22 | */ 23 | - (void)addBezierThroughPoints:(NSArray *)pointArray; 24 | 25 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIBezierPath/UIBezierPath+SVG.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIBezierPath+SVG.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIBezierPath (SVG) 12 | /** 13 | * @brief UIBezierPath转成SVG 14 | * 15 | * @return SVG 16 | */ 17 | - (NSString*)toSVGString; 18 | @end 19 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIButton/UIButton+BackgroundColor.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+BackgroundColor.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by 符现超 on 15/5/9. 6 | // Copyright (c) 2015年 http://weibo.com/u/1655766025 All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIButton (BackgroundColor) 12 | /** 13 | * @brief 使用颜色设置按钮背景 14 | * 15 | * @param backgroundColor 背景颜色 16 | * @param state 按钮状态 17 | */ 18 | - (void)setBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state; 19 | @end 20 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIButton/UIButton+BackgroundColor.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+BackgroundColor.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by 符现超 on 15/5/9. 6 | // Copyright (c) 2015年 http://weibo.com/u/1655766025 All rights reserved. 7 | // 8 | 9 | #import "UIButton+BackgroundColor.h" 10 | 11 | @implementation UIButton (BackgroundColor) 12 | /** 13 | * @brief 使用颜色设置按钮背景 14 | * 15 | * @param backgroundColor 背景颜色 16 | * @param state 按钮状态 17 | */ 18 | - (void)setBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state 19 | { 20 | [self setBackgroundImage:[UIButton imageWithColor:backgroundColor] forState:state]; 21 | } 22 | 23 | + (UIImage *)imageWithColor:(UIColor *)color 24 | { 25 | CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); 26 | UIGraphicsBeginImageContext(rect.size); 27 | CGContextRef context = UIGraphicsGetCurrentContext(); 28 | 29 | CGContextSetFillColorWithColor(context, [color CGColor]); 30 | CGContextFillRect(context, rect); 31 | 32 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 33 | UIGraphicsEndImageContext(); 34 | 35 | return image; 36 | } 37 | 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIButton/UIButton+Block.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Block.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef void (^TouchedBlock)(NSInteger tag); 11 | 12 | @interface UIButton (Block) 13 | -(void)addActionHandler:(TouchedBlock)touchHandler; 14 | @end 15 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIButton/UIButton+Block.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Block.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIButton+Block.h" 10 | #import 11 | static const void *UIButtonBlockKey = &UIButtonBlockKey; 12 | 13 | @implementation UIButton (Block) 14 | -(void)addActionHandler:(TouchedBlock)touchHandler{ 15 | objc_setAssociatedObject(self, UIButtonBlockKey, touchHandler, OBJC_ASSOCIATION_COPY_NONATOMIC); 16 | [self addTarget:self action:@selector(actionTouched:) forControlEvents:UIControlEventTouchUpInside]; 17 | } 18 | -(void)actionTouched:(UIButton *)btn{ 19 | TouchedBlock block = objc_getAssociatedObject(self, UIButtonBlockKey); 20 | if (block) { 21 | block(btn.tag); 22 | } 23 | } 24 | @end 25 | 26 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIButton/UIButton+CountDown.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+countDown.h 3 | // NetworkEgOc 4 | // 5 | // Created by iosdev on 15/3/17. 6 | // Copyright (c) 2015年 iosdev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIButton (CountDown) 12 | -(void)startTime:(NSInteger )timeout title:(NSString *)tittle waitTittle:(NSString *)waitTittle; 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIButton/UIButton+Indicator.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Indicator.m 3 | // UIButton Indicator 4 | // 5 | // Copyright (c) 2015 Jeremiah Poisson 6 | // 7 | 8 | #import "UIButton+Indicator.h" 9 | #import 10 | 11 | // Associative reference keys. 12 | static NSString *const kIndicatorViewKey = @"indicatorView"; 13 | static NSString *const kButtonTextObjectKey = @"buttonTextObject"; 14 | 15 | @implementation UIButton (Indicator) 16 | 17 | - (void) showIndicator { 18 | 19 | UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; 20 | indicator.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2); 21 | [indicator startAnimating]; 22 | 23 | NSString *currentButtonText = self.titleLabel.text; 24 | 25 | objc_setAssociatedObject(self, &kButtonTextObjectKey, currentButtonText, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 26 | objc_setAssociatedObject(self, &kIndicatorViewKey, indicator, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 27 | 28 | [self setTitle:@"" forState:UIControlStateNormal]; 29 | self.enabled = NO; 30 | [self addSubview:indicator]; 31 | 32 | 33 | } 34 | 35 | - (void) hideIndicator { 36 | 37 | NSString *currentButtonText = (NSString *)objc_getAssociatedObject(self, &kButtonTextObjectKey); 38 | UIActivityIndicatorView *indicator = (UIActivityIndicatorView *)objc_getAssociatedObject(self, &kIndicatorViewKey); 39 | 40 | [indicator removeFromSuperview]; 41 | [self setTitle:currentButtonText forState:UIControlStateNormal]; 42 | self.enabled = YES; 43 | 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIButton/UIButton+MiddleAligning.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+MiddleAligning.h 3 | // UIButton+MiddleAligning 4 | // 5 | // Created by Barry on 12/11/15. 6 | // Copyright © 2015 BarryLee. All rights reserved. 7 | // 8 | // An UIButton category for middle aligning imageView and titleLabel 9 | //https://github.com/hcbarry/MiddleAlignedButton 10 | 11 | #import 12 | 13 | /** 14 | A category on UIButton that provides a simple yet powerful interface to middle aligning imageView and titleLabel 15 | */ 16 | @interface UIButton (MiddleAligning) 17 | 18 | /** 19 | @param spacing The middle spacing between imageView and titleLabel. 20 | @discussion The middle aligning method for imageView and titleLabel. 21 | */ 22 | - (void)middleAlignButtonWithSpacing:(CGFloat)spacing; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIButton/UIButton+Submitting.h: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // UIButton+Submitting.h 4 | // FXCategories 5 | // 6 | // Created by foxsofter on 15/4/2. 7 | // Copyright (c) 2015年 foxsofter. All rights reserved. 8 | // https://github.com/foxsofter/FXCategories 9 | 10 | #import 11 | 12 | @interface UIButton (Submitting) 13 | 14 | /** 15 | * @author foxsofter, 15-04-02 15:04:59 16 | * 17 | * @brief 按钮点击后,禁用按钮并在按钮上显示ActivityIndicator,以及title 18 | * 19 | * @param title 按钮上显示的文字 20 | */ 21 | - (void)beginSubmitting:(NSString *)title; 22 | 23 | /** 24 | * @author foxsofter, 15-04-02 15:04:13 25 | * 26 | * @brief 按钮点击后,恢复按钮点击前的状态 27 | */ 28 | - (void)endSubmitting; 29 | 30 | /** 31 | * @author foxsofter, 15-04-02 15:04:17 32 | * 33 | * @brief 按钮是否正在提交中 34 | */ 35 | @property(nonatomic, readonly, getter=isSubmitting) NSNumber *submitting; 36 | 37 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIButton/UIButton+TouchAreaInsets.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2014 Suyeol Jeon (xoul.kr) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // 24 | //https://github.com/devxoul/UIButton-TouchAreaInsets 25 | 26 | #import 27 | 28 | @interface UIButton (JLUtils) 29 | /** 30 | * @brief 设置按钮额外热区 31 | */ 32 | @property (nonatomic, assign) UIEdgeInsets touchAreaInsets; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIColor/UIColor+Gradient.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Gradient.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (Gradient) 12 | /** 13 | * @brief 渐变颜色 14 | * 15 | * @param c1 开始颜色 16 | * @param c2 结束颜色 17 | * @param height 渐变高度 18 | * 19 | * @return 渐变颜色 20 | */ 21 | + (UIColor*)gradientFromColor:(UIColor*)c1 toColor:(UIColor*)c2 withHeight:(int)height; 22 | @end 23 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIColor/UIColor+Gradient.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Gradient.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIColor+Gradient.h" 10 | 11 | @implementation UIColor (Gradient) 12 | 13 | #pragma mark - Gradient Color 14 | /** 15 | * @brief 渐变颜色 16 | * 17 | * @param c1 开始颜色 18 | * @param c2 结束颜色 19 | * @param height 渐变高度 20 | * 21 | * @return 渐变颜色 22 | */ 23 | + (UIColor*)gradientFromColor:(UIColor*)c1 toColor:(UIColor*)c2 withHeight:(int)height 24 | { 25 | CGSize size = CGSizeMake(1, height); 26 | UIGraphicsBeginImageContextWithOptions(size, NO, 0); 27 | CGContextRef context = UIGraphicsGetCurrentContext(); 28 | CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); 29 | 30 | NSArray* colors = [NSArray arrayWithObjects:(id)c1.CGColor, (id)c2.CGColor, nil]; 31 | CGGradientRef gradient = CGGradientCreateWithColors(colorspace, (__bridge CFArrayRef)colors, NULL); 32 | CGContextDrawLinearGradient(context, gradient, CGPointMake(0, 0), CGPointMake(0, size.height), 0); 33 | 34 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 35 | 36 | CGGradientRelease(gradient); 37 | CGColorSpaceRelease(colorspace); 38 | UIGraphicsEndImageContext(); 39 | 40 | return [UIColor colorWithPatternImage:image]; 41 | } 42 | @end 43 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIColor/UIColor+HEX.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+HEX.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (HEX) 12 | + (UIColor *)colorWithHex:(UInt32)hex; 13 | + (UIColor *)colorWithHex:(UInt32)hex andAlpha:(CGFloat)alpha; 14 | + (UIColor *)colorWithHexString:(NSString *)hexString; 15 | - (NSString *)HEXString; 16 | 17 | + (UIColor *)colorWithWholeRed:(CGFloat)red 18 | green:(CGFloat)green 19 | blue:(CGFloat)blue 20 | alpha:(CGFloat)alpha; 21 | 22 | + (UIColor *)colorWithWholeRed:(CGFloat)red 23 | green:(CGFloat)green 24 | blue:(CGFloat)blue; 25 | @end 26 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIColor/UIColor+Modify.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Modify.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/2. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (Modify) 12 | - (UIColor *)invertedColor; 13 | - (UIColor *)colorForTranslucency; 14 | - (UIColor *)lightenColor:(CGFloat)lighten; 15 | - (UIColor *)darkenColor:(CGFloat)darken; 16 | @end 17 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIColor/UIColor+Random.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Random.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (Random) 12 | /** 13 | * @brief 随机颜色 14 | * 15 | * @return UIColor 16 | */ 17 | + (UIColor *)RandomColor; 18 | @end 19 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIColor/UIColor+Random.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Random.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIColor+Random.h" 10 | 11 | @implementation UIColor (Random) 12 | + (UIColor *)RandomColor { 13 | NSInteger aRedValue = arc4random() % 255; 14 | NSInteger aGreenValue = arc4random() % 255; 15 | NSInteger aBlueValue = arc4random() % 255; 16 | UIColor *randColor = [UIColor colorWithRed:aRedValue / 255.0f green:aGreenValue / 255.0f blue:aBlueValue / 255.0f alpha:1.0f]; 17 | return randColor; 18 | } 19 | @end 20 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIColor/UIColor+Web.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Web.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/22. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (Web) 12 | /** 13 | * @brief 获取canvas用的颜色字符串 14 | * 15 | * @return canvas颜色 16 | */ 17 | - (NSString *)canvasColorString; 18 | /** 19 | * @brief 获取网页颜色字串 20 | * 21 | * @return 网页颜色 22 | */ 23 | - (NSString *)webColorString; 24 | @end 25 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIControl/UIControl+ActionBlocks.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIControl+ActionBlocks.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/23. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // https://github.com/lavoy/ALActionBlocks 8 | 9 | #import 10 | typedef void (^UIControlActionBlock)(id weakSender); 11 | 12 | 13 | @interface UIControlActionBlockWrapper : NSObject 14 | @property (nonatomic, copy) UIControlActionBlock actionBlock; 15 | @property (nonatomic, assign) UIControlEvents controlEvents; 16 | - (void)invokeBlock:(id)sender; 17 | @end 18 | 19 | 20 | 21 | @interface UIControl (ActionBlocks) 22 | - (void)handleControlEvents:(UIControlEvents)controlEvents withBlock:(UIControlActionBlock)actionBlock; 23 | - (void)removeActionBlocksForControlEvents:(UIControlEvents)controlEvents; 24 | @end 25 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIControl/UIControl+Block.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIControl+Block.h 3 | // FXCategories 4 | // 5 | // Created by fox softer on 15/2/23. 6 | // Copyright (c) 2015年 foxsofter. All rights reserved. 7 | // https://github.com/foxsofter/FXCategories 8 | // http://stackoverflow.com/questions/2437875/target-action-uicontrolevents 9 | #import 10 | 11 | @interface UIControl (Block) 12 | 13 | - (void)touchDown:(void (^)(void))eventBlock; 14 | - (void)touchDownRepeat:(void (^)(void))eventBlock; 15 | - (void)touchDragInside:(void (^)(void))eventBlock; 16 | - (void)touchDragOutside:(void (^)(void))eventBlock; 17 | - (void)touchDragEnter:(void (^)(void))eventBlock; 18 | - (void)touchDragExit:(void (^)(void))eventBlock; 19 | - (void)touchUpInside:(void (^)(void))eventBlock; 20 | - (void)touchUpOutside:(void (^)(void))eventBlock; 21 | - (void)touchCancel:(void (^)(void))eventBlock; 22 | - (void)valueChanged:(void (^)(void))eventBlock; 23 | - (void)editingDidBegin:(void (^)(void))eventBlock; 24 | - (void)editingChanged:(void (^)(void))eventBlock; 25 | - (void)editingDidEnd:(void (^)(void))eventBlock; 26 | - (void)editingDidEndOnExit:(void (^)(void))eventBlock; 27 | 28 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIDevice/UIDevice+PasscodeStatus.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIDevice+PasscodeStatus.h 3 | // PasscodeStatus 4 | // 5 | // Created by Liam Nichols on 02/09/2014. 6 | // Copyright (c) 2014 Liam Nichols. All rights reserved. 7 | // 8 | 9 | /** 10 | * @Author(作者) Liam Nichols 11 | * 12 | * @URL(地址) https://github.com/liamnichols/UIDevice-PasscodeStatus 13 | * 14 | * @Version(版本) 20150620 15 | * 16 | * @Requirements(运行要求) iOS 8 && A Physical Device 17 | * 18 | * @Description(描述) A UIDevice category to determine if the passcode is currently set on the device or not. 19 | * @Usage(使用) .. 20 | */ 21 | #import 22 | 23 | typedef NS_ENUM(NSUInteger, LNPasscodeStatus){ 24 | /* The passcode status was unknown */ 25 | LNPasscodeStatusUnknown = 0, 26 | /* The passcode is enabled */ 27 | LNPasscodeStatusEnabled = 1, 28 | /* The passcode is disabled */ 29 | LNPasscodeStatusDisabled = 2 30 | }; 31 | 32 | @interface UIDevice (PasscodeStatus) 33 | 34 | /** 35 | * Determines if the device supports the `passcodeStatus` check. Passcode check is only supported on iOS 8. 36 | */ 37 | @property (readonly) BOOL passcodeStatusSupported; 38 | 39 | /** 40 | * Checks and returns the devices current passcode status. 41 | * If `passcodeStatusSupported` returns NO then `LNPasscodeStatusUnknown` will be returned. 42 | */ 43 | @property (readonly) LNPasscodeStatus passcodeStatus; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIFont/UIFont+DynamicFontControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIFont+DynamicFontControl.h 3 | // 4 | // Created by Michael Kral on 10/28/13. 5 | // Copyright (c) 2013 Michael Kral. All rights reserved. 6 | // 7 | 8 | /** 9 | * @Author(作者) Michael Kral 10 | * 11 | * @URL(地址) https://github.com/mkral/UIFont-DynamicFontControlDemo 12 | * 13 | * @Version(版本) 20150622 14 | * 15 | * @Requirements(运行要求) 16 | * 17 | * @Description(描述) Simple Category for using UIFontTextStyle with other Fonts. 18 | 19 | * 20 | * @Usage(使用) .. 21 | */ 22 | 23 | #import 24 | 25 | @interface UIFont (DynamicFontControl) 26 | 27 | 28 | +(UIFont *)preferredFontForTextStyle:(NSString *)style withFontName:(NSString *)fontName scale:(CGFloat)scale; 29 | 30 | +(UIFont *)preferredFontForTextStyle:(NSString *)style withFontName:(NSString *)fontName; 31 | 32 | 33 | 34 | -(UIFont *)adjustFontForTextStyle:(NSString *)style; 35 | 36 | -(UIFont *)adjustFontForTextStyle:(NSString *)style scale:(CGFloat)scale; 37 | 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIFont/UIFont+DynamicFontControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIFont+DynamicFontControl.m 3 | // 4 | // Created by Michael Kral on 10/28/13. 5 | // Copyright (c) 2013 Michael Kral. All rights reserved. 6 | // 7 | 8 | #import "UIFont+DynamicFontControl.h" 9 | 10 | @implementation UIFont (DynamicFontControl) 11 | 12 | +(UIFont *)preferredFontForTextStyle:(NSString *)style withFontName:(NSString *)fontName{ 13 | return [UIFont preferredFontForTextStyle:style withFontName:fontName scale:1.0f]; 14 | } 15 | 16 | +(UIFont *)preferredFontForTextStyle:(NSString *)style withFontName:(NSString *)fontName scale:(CGFloat)scale{ 17 | 18 | 19 | UIFont * font = nil; 20 | if([[UIFont class] resolveClassMethod:@selector(preferredFontForTextStyle:)]){ 21 | font = [UIFont preferredFontForTextStyle:fontName]; 22 | }else{ 23 | font = [UIFont fontWithName:fontName size:14 * scale]; 24 | } 25 | 26 | 27 | return [font adjustFontForTextStyle:style]; 28 | 29 | } 30 | 31 | -(UIFont *)adjustFontForTextStyle:(NSString *)style{ 32 | return [self adjustFontForTextStyle:style scale:1.0f]; 33 | } 34 | 35 | -(UIFont *)adjustFontForTextStyle:(NSString *)style scale:(CGFloat)scale{ 36 | 37 | UIFontDescriptor * fontDescriptor = nil; 38 | 39 | if([[UIFont class] resolveClassMethod:@selector(preferredFontForTextStyle:)]){ 40 | 41 | fontDescriptor = [UIFontDescriptor preferredFontDescriptorWithTextStyle:style]; 42 | 43 | }else{ 44 | 45 | fontDescriptor = self.fontDescriptor; 46 | 47 | } 48 | 49 | float dynamicSize = [fontDescriptor pointSize] * scale + 3; 50 | 51 | return [UIFont fontWithName:self.fontName size:dynamicSize]; 52 | 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+Alpha.h: -------------------------------------------------------------------------------- 1 | // UIImage+Alpha.h 2 | // Created by Trevor Harmon on 9/20/09. 3 | // Free for personal or commercial use, with or without modification. 4 | // No warranty is expressed or implied. 5 | 6 | // Helper methods for adding an alpha layer to an image 7 | #import 8 | 9 | @interface UIImage (Alpha) 10 | /** 11 | * @brief 是否有alpha通道 12 | * 13 | * @return 是否有alpha通道 14 | */ 15 | - (BOOL)hasAlpha; 16 | /** 17 | * @brief 如果没有alpha通道 增加alpha通道 18 | * 19 | * @return 如果没有alpha通道 增加alpha通道 20 | */ 21 | - (UIImage *)imageWithAlpha; 22 | /** 23 | * @brief 增加透明边框 24 | * 25 | * @param borderSize 边框尺寸 26 | * 27 | * @return 增加透明边框后的图片 28 | */ 29 | - (UIImage *)transparentBorderImage:(NSUInteger)borderSize; 30 | 31 | 32 | //http://stackoverflow.com/questions/6521987/crop-uiimage-to-alpha?answertab=oldest#tab-top 33 | /** 34 | * @brief 裁切含透明图片为最小大小 35 | * 36 | * @return 裁切后的图片 37 | */ 38 | - (UIImage *)trimmedBetterSize; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+BetterFace.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+BetterFace.h 3 | // bf 4 | // 5 | // Created by liuyan on 13-11-25. 6 | // Copyright (c) 2013年 Croath. All rights reserved. 7 | // 8 | // https://github.com/croath/UIImageView-BetterFace 9 | // a UIImageView category to let the picture-cutting with faces showing better 10 | 11 | #import 12 | 13 | typedef NS_ENUM(NSUInteger, BFAccuracy) { 14 | kBFAccuracyLow = 0, 15 | kBFAccuracyHigh, 16 | }; 17 | 18 | @interface UIImage (BetterFace) 19 | 20 | - (UIImage *)betterFaceImageForSize:(CGSize)size 21 | accuracy:(BFAccuracy)accurary; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+Blur.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Blur.h 3 | // IOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/6/5. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | FOUNDATION_EXPORT double ImageEffectsVersionNumber; 11 | FOUNDATION_EXPORT const unsigned char ImageEffectsVersionString[]; 12 | @interface UIImage (Blur) 13 | - (UIImage *)lightImage; 14 | - (UIImage *)extraLightImage; 15 | - (UIImage *)darkImage; 16 | - (UIImage *)tintedImageWithColor:(UIColor *)tintColor; 17 | 18 | - (UIImage *)blurredImageWithRadius:(CGFloat)blurRadius; 19 | - (UIImage *)blurredImageWithSize:(CGSize)blurSize; 20 | - (UIImage *)blurredImageWithSize:(CGSize)blurSize 21 | tintColor:(UIColor *)tintColor 22 | saturationDeltaFactor:(CGFloat)saturationDeltaFactor 23 | maskImage:(UIImage *)maskImage; 24 | @end 25 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+Capture.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Capture.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/10. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (Capture) 12 | /** 13 | * @brief 截图指定view成图片 14 | * 15 | * @param view 一个view 16 | * 17 | * @return 图片 18 | */ 19 | + (UIImage *)captureWithView:(UIView *)view; 20 | 21 | ///截图(未测试是否可行) 22 | + (UIImage *)getImageWithSize:(CGRect)myImageRect FromImage:(UIImage *)bigImage; 23 | 24 | /** 25 | * @author Jakey 26 | * 27 | * @brief 截图一个view中所有视图 包括旋转缩放效果 28 | * 29 | * @param aView 指定的view 30 | * @param maxWidth 宽的大小 0为view默认大小 31 | * 32 | * @return 截图 33 | */ 34 | + (UIImage *)screenshotWithView:(UIView *)aView limitWidth:(CGFloat)maxWidth; 35 | @end 36 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+Color.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Color.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (Color) 12 | /** 13 | * @brief 根据颜色生成纯色图片 14 | * 15 | * @param color 颜色 16 | * 17 | * @return 纯色图片 18 | */ 19 | + (UIImage *)imageWithColor:(UIColor *)color; 20 | /** 21 | * @brief 取图片某一点的颜色 22 | * 23 | * @param point 某一点 24 | * 25 | * @return 颜色 26 | */ 27 | - (UIColor *)colorAtPoint:(CGPoint )point; 28 | //more accurate method ,colorAtPixel 1x1 pixel 29 | /** 30 | * @brief 取某一像素的颜色 31 | * 32 | * @param point 一像素 33 | * 34 | * @return 颜色 35 | */ 36 | - (UIColor *)colorAtPixel:(CGPoint)point; 37 | /** 38 | * @brief 返回该图片是否有透明度通道 39 | * 40 | * @return 是否有透明度通道 41 | */ 42 | - (BOOL)hasAlphaChannel; 43 | 44 | /** 45 | * @brief 获得灰度图 46 | * 47 | * @param sourceImage 图片 48 | * 49 | * @return 获得灰度图片 50 | */ 51 | + (UIImage*)covertToGrayImageFromImage:(UIImage*)sourceImage; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+FileName.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+FileName.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (FileName) 12 | /** 13 | * @brief 根据bundle中的文件名读取图片 14 | * 15 | * @param name 图片名 16 | * 17 | * @return 无缓存的图片 18 | */ 19 | + (UIImage *)imageWithFileName:(NSString *)name; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+GIF.h 3 | // LBGIFImage 4 | // 5 | // Created by Laurin Brandner on 06.01.12. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (GIF) 12 | 13 | + (UIImage *)sd_animatedGIFNamed:(NSString *)name; 14 | 15 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 16 | 17 | - (UIImage *)sd_animatedImageByScalingAndCroppingToSize:(CGSize)size; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+Merge.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Merge.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (Merge) 12 | /** 13 | * @brief 合并两个图片 14 | * 15 | * @param firstImage 一个图片 16 | * @param secondImage 二个图片 17 | * 18 | * @return 合并后图片 19 | */ 20 | + (UIImage*)mergeImage:(UIImage*)firstImage withImage:(UIImage*)secondImage; 21 | @end 22 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+Merge.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Merge.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIImage+Merge.h" 10 | 11 | @implementation UIImage (Merge) 12 | /** 13 | * @brief 合并两个图片 14 | * 15 | * @param firstImage 一个图片 16 | * @param secondImage 二个图片 17 | * 18 | * @return 合并后图片 19 | */ 20 | + (UIImage*)mergeImage:(UIImage*)firstImage withImage:(UIImage*)secondImage { 21 | CGImageRef firstImageRef = firstImage.CGImage; 22 | CGFloat firstWidth = CGImageGetWidth(firstImageRef); 23 | CGFloat firstHeight = CGImageGetHeight(firstImageRef); 24 | CGImageRef secondImageRef = secondImage.CGImage; 25 | CGFloat secondWidth = CGImageGetWidth(secondImageRef); 26 | CGFloat secondHeight = CGImageGetHeight(secondImageRef); 27 | CGSize mergedSize = CGSizeMake(MAX(firstWidth, secondWidth), MAX(firstHeight, secondHeight)); 28 | UIGraphicsBeginImageContext(mergedSize); 29 | [firstImage drawInRect:CGRectMake(0, 0, firstWidth, firstHeight)]; 30 | [secondImage drawInRect:CGRectMake(0, 0, secondWidth, secondHeight)]; 31 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 32 | UIGraphicsEndImageContext(); 33 | return image; 34 | } 35 | @end 36 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+Orientation.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Orientation.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/4. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | //CGFloat DegreesToRadiansForOrientation(CGFloat degrees) {return degrees * M_PI / 180;}; 11 | //CGFloat RadiansToDegreesForOrientation(CGFloat radians) {return radians * 180/M_PI;}; 12 | @interface UIImage (Orientation) 13 | /** 14 | * @brief 修正图片的方向 15 | * 16 | * @param srcImg 图片 17 | * 18 | * @return 修正方向后的图片 19 | */ 20 | + (UIImage *)fixOrientation:(UIImage *)srcImg; 21 | /** 22 | * @brief 旋转图片 23 | * 24 | * @param degrees 角度 25 | * 26 | * @return 旋转后图片 27 | */ 28 | - (UIImage *)imageRotatedByDegrees:(CGFloat)degrees; 29 | 30 | /** 31 | * @brief 旋转图片 32 | * 33 | * @param degrees 弧度 34 | * 35 | * @return 旋转后图片 36 | */ 37 | - (UIImage *)imageRotatedByRadians:(CGFloat)radians; 38 | 39 | /** 40 | * @brief 垂直翻转 41 | * 42 | * @return 翻转后的图片 43 | */ 44 | - (UIImage *)flipVertical; 45 | /** 46 | * @brief 水平翻转 47 | * 48 | * @return 翻转后的图片 49 | */ 50 | - (UIImage *)flipHorizontal; 51 | 52 | /** 53 | * @brief 角度转弧度 54 | * 55 | * @param degrees 角度 56 | * 57 | * @return 弧度 58 | */ 59 | +(CGFloat)degreesToRadians:(CGFloat)degrees; 60 | /** 61 | * @brief 弧度转角度 62 | * 63 | * @param radians 弧度 64 | * 65 | * @return 角度 66 | */ 67 | +(CGFloat)radiansToDegrees:(CGFloat)radians; 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+PDF.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+PDF.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (PDF) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+PDF.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+PDF.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIImage+PDF.h" 10 | 11 | @implementation UIImage (PDF) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+RemoteSize.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+RemoteSize.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/27. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void (^UIImageSizeRequestCompleted) (NSURL* imgURL, CGSize size); 12 | 13 | @interface UIImage (RemoteSize) 14 | /** 15 | * @brief 获取远程图片的大小 16 | * 17 | * @param imgURL 图片url 18 | * @param completion 完成回调 19 | */ 20 | + (void)requestSizeNoHeader:(NSURL*)imgURL completion:(UIImageSizeRequestCompleted)completion; 21 | /** 22 | * @brief 从header中获取远程图片的大小 (服务器必须支持) 23 | * 24 | * @param imgURL 图片url 25 | * @param completion 完成回调 26 | */ 27 | //+ (void)requestSizeWithHeader:(NSURL*)imgURL completion:(UIImageSizeRequestCompleted)completion; 28 | 29 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+Resize.h: -------------------------------------------------------------------------------- 1 | // UIImage+Resize.h 2 | // Created by Trevor Harmon on 8/5/09. 3 | // Free for personal or commercial use, with or without modification. 4 | // No warranty is expressed or implied. 5 | 6 | // Extends the UIImage class to support resizing/cropping 7 | #import 8 | 9 | @interface UIImage (Resize) 10 | 11 | - (UIImage *)croppedImage:(CGRect)bounds; 12 | - (UIImage *)thumbnailImage:(NSInteger)thumbnailSize 13 | transparentBorder:(NSUInteger)borderSize 14 | cornerRadius:(NSUInteger)cornerRadius 15 | interpolationQuality:(CGInterpolationQuality)quality; 16 | - (UIImage *)resizedImage:(CGSize)newSize 17 | interpolationQuality:(CGInterpolationQuality)quality; 18 | - (UIImage *)resizedImageWithContentMode:(UIViewContentMode)contentMode 19 | bounds:(CGSize)bounds 20 | interpolationQuality:(CGInterpolationQuality)quality; 21 | @end 22 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImage/UIImage+RoundedCorner.h: -------------------------------------------------------------------------------- 1 | // UIImage+RoundedCorner.h 2 | // Created by Trevor Harmon on 9/20/09. 3 | // Free for personal or commercial use, with or without modification. 4 | // No warranty is expressed or implied. 5 | 6 | // Extends the UIImage class to support making rounded corners 7 | #import 8 | @interface UIImage (RoundedCorner) 9 | - (UIImage *)roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize; 10 | @end 11 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImageView/UIImageView+Addition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+Addition.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImageView (Addition) 12 | /** 13 | * @brief 根据bundle中的图片名创建imageview 14 | * 15 | * @param imageName bundle中的图片名 16 | * 17 | * @return imageview 18 | */ 19 | + (id) imageViewWithImageNamed:(NSString*)imageName; 20 | /** 21 | * @brief 根据frame创建imageview 22 | * 23 | * @param frame imageview frame 24 | * 25 | * @return imageview 26 | */ 27 | + (id) imageViewWithFrame:(CGRect)frame; 28 | 29 | + (id) imageViewWithStretchableImage:(NSString*)imageName Frame:(CGRect)frame; 30 | /** 31 | * @brief 创建imageview动画 32 | * 33 | * @param imageArray 图片名称数组 34 | * @param duration 动画时间 35 | * 36 | * @return imageview 37 | */ 38 | + (id) imageViewWithImageArray:(NSArray*)imageArray duration:(NSTimeInterval)duration; 39 | - (void) setImageWithStretchableImage:(NSString*)imageName; 40 | 41 | 42 | // 画水印 43 | // 图片水印 44 | - (void) setImage:(UIImage *)image withWaterMark:(UIImage *)mark inRect:(CGRect)rect; 45 | // 文字水印 46 | - (void) setImage:(UIImage *)image withStringWaterMark:(NSString *)markString inRect:(CGRect)rect color:(UIColor *)color font:(UIFont *)font; 47 | - (void) setImage:(UIImage *)image withStringWaterMark:(NSString *)markString atPoint:(CGPoint)point color:(UIColor *)color font:(UIFont *)font; 48 | @end 49 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImageView/UIImageView+BetterFace.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+BetterFace.h 3 | // bf 4 | // 5 | // Created by croath on 13-10-22. 6 | // Copyright (c) 2013年 Croath. All rights reserved. 7 | // 8 | // https://github.com/croath/UIImageView-BetterFace 9 | // a UIImageView category to let the picture-cutting with faces showing better 10 | 11 | #import 12 | 13 | @interface UIImageView (BetterFace) 14 | 15 | @property (nonatomic) BOOL needsBetterFace; 16 | @property (nonatomic) BOOL fast; 17 | 18 | void hack_uiimageview_bf(); 19 | - (void)setBetterFaceImage:(UIImage *)image; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImageView/UIImageView+FaceAwareFill.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+UIImageView_FaceAwareFill.h 3 | // faceAwarenessClipping 4 | // 5 | // Created by Julio Andrés Carrettoni on 03/02/13. 6 | // Copyright (c) 2013 Julio Andrés Carrettoni. All rights reserved. 7 | // 8 | // https://github.com/Julioacarrettoni/UIImageView_FaceAwareFill 9 | // This category applies Aspect Fill content mode to an image and if faces are detected it centers them instead of centering the image just by its geometrical center. 10 | 11 | #import 12 | 13 | @interface UIImageView (FaceAwareFill) 14 | 15 | //Ask the image to perform an "Aspect Fill" but centering the image to the detected faces 16 | //Not the simple center of the image 17 | - (void) faceAwareFill; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImageView/UIImageView+GeometryConversion.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+GeometryConversion.h 3 | // 4 | // Created by Dominique d'Argent on 18.04.12. 5 | // Copyright (c) 2012. All rights reserved. 6 | // 7 | // Thomas Sarlandie - 2012: 8 | // - Added convertPointFromView:viewPoint 9 | // - Added convertRectFromView:viewPoint 10 | // 11 | // Contribution released in the public domain. 12 | 13 | // https://github.com/nubbel/UIImageView-GeometryConversion 14 | // A category on UIImageView that provides methods for converting points and rects from the image to view coordinates. 15 | 16 | 17 | #import 18 | #import 19 | 20 | 21 | @interface UIImageView (GeometryConversion) 22 | 23 | - (CGPoint)convertPointFromImage:(CGPoint)imagePoint; 24 | - (CGRect)convertRectFromImage:(CGRect)imageRect; 25 | 26 | - (CGPoint)convertPointFromView:(CGPoint)viewPoint; 27 | - (CGRect)convertRectFromView:(CGRect)viewRect; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImageView/UIImageView+Reflect.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+Reflect.h 3 | // UIImageView-Reflect 4 | // 5 | // Created by Snowmanzzz on 3/19/14. 6 | // Copyright (c) 2014 zzz. All rights reserved. 7 | // 8 | // https://github.com/zzz6519003/UIImageView-Reflect 9 | // A simple category that creates a relection view for your UIImageView. 10 | 11 | #import 12 | 13 | @interface UIImageView (Reflect) 14 | /** 15 | * @brief 倒影 16 | */ 17 | - (void)reflect; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIImageView/UIImageView+Reflect.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+Reflect.m 3 | // UIImageView-Reflect 4 | // 5 | // Created by Snowmanzzz on 3/19/14. 6 | // Copyright (c) 2014 zzz. All rights reserved. 7 | // 8 | 9 | #import "UIImageView+Reflect.h" 10 | 11 | @implementation UIImageView (Reflect) 12 | /** 13 | * @brief 倒影 14 | */ 15 | - (void)reflect { 16 | CGRect frame = self.frame; 17 | frame.origin.y += (frame.size.height + 1); 18 | 19 | UIImageView *reflectionImageView = [[UIImageView alloc] initWithFrame:frame]; 20 | self.clipsToBounds = TRUE; 21 | reflectionImageView.contentMode = self.contentMode; 22 | [reflectionImageView setImage:self.image]; 23 | reflectionImageView.transform = CGAffineTransformMakeScale(1.0, -1.0); 24 | 25 | CALayer *reflectionLayer = [reflectionImageView layer]; 26 | 27 | CAGradientLayer *gradientLayer = [CAGradientLayer layer]; 28 | gradientLayer.bounds = reflectionLayer.bounds; 29 | gradientLayer.position = CGPointMake(reflectionLayer.bounds.size.width / 2, reflectionLayer.bounds.size.height * 0.5); 30 | gradientLayer.colors = [NSArray arrayWithObjects: 31 | (id)[[UIColor clearColor] CGColor], 32 | (id)[[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.3] CGColor], nil]; 33 | 34 | gradientLayer.startPoint = CGPointMake(0.5,0.5); 35 | gradientLayer.endPoint = CGPointMake(0.5,1.0); 36 | reflectionLayer.mask = gradientLayer; 37 | 38 | [self.superview addSubview:reflectionImageView]; 39 | 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UILable/UILabel+AutoSize.h: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+AutoSize.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UILabel (AutoSize) 12 | /** 13 | * 垂直方向固定获取动态宽度的UILabel的方法 14 | * 15 | * @return 原始UILabel修改过的Rect的UILabel(起始位置相同) 16 | */ 17 | - (UILabel *)resizeLabelHorizontal; 18 | 19 | /** 20 | * 水平方向固定获取动态宽度的UILabel的方法 21 | * 22 | * @return 原始UILabel修改过的Rect的UILabel(起始位置相同) 23 | */ 24 | - (UILabel *)resizeLabelVertical; 25 | 26 | /** 27 | * 垂直方向固定获取动态宽度的UILabel的方法 28 | * 29 | * @param minimumWidth minimum width 30 | * 31 | * @return 原始UILabel修改过的Rect的UILabel(起始位置相同) 32 | */ 33 | - (UILabel *)resizeLabelHorizontal:(CGFloat)minimumWidth; 34 | 35 | /** 36 | * 水平方向固定获取动态宽度的UILabel的方法 37 | * 38 | * @param minimumHeigh minimum height 39 | * 40 | * @return 原始UILabel修改过的Rect的UILabel(起始位置相同) 41 | */ 42 | - (UILabel *)resizeLabelVertical:(CGFloat)minimumHeigh; 43 | @end 44 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UILable/UILabel+SuggestSize.h: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+SuggestSize.h 3 | // WordPress 4 | // 5 | // Created by Eric J on 6/18/13. 6 | // Copyright (c) 2013 WordPress. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UILabel (SuggestSize) 12 | 13 | - (CGSize)suggestedSizeForWidth:(CGFloat)width; 14 | - (CGSize)suggestSizeForAttributedString:(NSAttributedString *)string width:(CGFloat)width; 15 | - (CGSize)suggestSizeForString:(NSString *)string width:(CGFloat)width; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UILable/UILabel+SuggestSize.m: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+SuggestSize.m 3 | // WordPress 4 | // 5 | // Created by Eric J on 6/18/13. 6 | // Copyright (c) 2013 WordPress. All rights reserved. 7 | // 8 | 9 | #import "UILabel+SuggestSize.h" 10 | 11 | @implementation UILabel (SuggestSize) 12 | 13 | - (CGSize)suggestedSizeForWidth:(CGFloat)width { 14 | if (self.attributedText) 15 | return [self suggestSizeForAttributedString:self.attributedText width:width]; 16 | 17 | return [self suggestSizeForString:self.text width:width]; 18 | } 19 | 20 | - (CGSize)suggestSizeForAttributedString:(NSAttributedString *)string width:(CGFloat)width { 21 | if (!string) { 22 | return CGSizeZero; 23 | } 24 | return [string boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading context:nil].size; 25 | } 26 | 27 | - (CGSize)suggestSizeForString:(NSString *)string width:(CGFloat)width { 28 | if (!string) { 29 | return CGSizeZero; 30 | } 31 | return [self suggestSizeForAttributedString:[[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName: self.font}] width:width]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UINavigationBar/UINavigationBar+Awesome.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+Awesome.h 3 | // LTNavigationBar 4 | // 5 | // Created by ltebean on 15-2-15. 6 | // Copyright (c) 2015 ltebean. All rights reserved. 7 | // https://github.com/ltebean/LTNavigationBar 8 | 9 | #import 10 | 11 | @interface UINavigationBar (Awesome) 12 | - (void)lt_setBackgroundColor:(UIColor *)backgroundColor; 13 | - (void)lt_setElementsAlpha:(CGFloat)alpha; 14 | - (void)lt_setTranslationY:(CGFloat)translationY; 15 | - (void)lt_reset; 16 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UINavigationController/UINavigationController+KeyboardFix.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+KeyboardFix.h 3 | // WordPress 4 | // 5 | // Created by Eric Johnson on 8/2/12. 6 | // Copyright (c) 2012 WordPress. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UINavigationController (KeyboardFix) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UINavigationController/UINavigationController+KeyboardFix.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+KeyboardFix.m 3 | // WordPress 4 | // 5 | // Created by Eric Johnson on 8/2/12. 6 | // Copyright (c) 2012 WordPress. All rights reserved. 7 | // 8 | 9 | #import "UINavigationController+KeyboardFix.h" 10 | 11 | @implementation UINavigationController (KeyboardFix) 12 | 13 | // This fixes an issue with the keyboard not dismissing on the iPad's login screen. 14 | // http://stackoverflow.com/questions/3372333/ipad-keyboard-will-not-dismiss-if-modal-view-controller-presentation-style-is-ui/3386768#3386768 15 | // http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html 16 | 17 | - (BOOL)disablesAutomaticKeyboardDismissal { 18 | return NO; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UINavigationController/UINavigationController+StackManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+StackManager.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/4/25. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UINavigationController (StackManager) 12 | /** 13 | * @brief 寻找Navigation中的某个viewcontroler对象 14 | * 15 | * @param className viewcontroler名称 16 | * 17 | * @return viewcontroler对象 18 | */ 19 | - (id)findViewController:(NSString*)className; 20 | /** 21 | * @brief 判断是否只有一个RootViewController 22 | * 23 | * @return 是否只有一个RootViewController 24 | */ 25 | - (BOOL)isOnlyContainRootViewController; 26 | /** 27 | * @brief RootViewController 28 | * 29 | * @return RootViewController 30 | */ 31 | - (UIViewController *)rootViewController; 32 | /** 33 | * @brief 返回指定的viewcontroler 34 | * 35 | * @param className 指定viewcontroler类名 36 | * @param animated 是否动画 37 | * 38 | * @return pop之后的viewcontrolers 39 | */ 40 | - (NSArray *)popToViewControllerWithClassName:(NSString*)className animated:(BOOL)animated; 41 | /** 42 | * @brief pop n层 43 | * 44 | * @param level n层 45 | * @param animated 是否动画 46 | * 47 | * @return pop之后的viewcontrolers 48 | */ 49 | - (NSArray *)popToViewControllerWithLevel:(NSInteger)level animated:(BOOL)animated; 50 | @end 51 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UINavigationItem/UINavigationItem+Lock.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationItem+Lock.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UINavigationItem (Lock) 12 | /** 13 | * @brief 锁定RightItem 14 | * 15 | * @param lock 是否锁定 16 | */ 17 | - (void)lockRightItem:(BOOL)lock; 18 | /** 19 | * @brief 锁定LeftItem 20 | * 21 | * @param lock 是否锁定 22 | */ 23 | - (void)lockLeftItem:(BOOL)lock; 24 | @end 25 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UINavigationItem/UINavigationItem+Lock.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationItem+Lock.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UINavigationItem+Lock.h" 10 | 11 | @implementation UINavigationItem (Lock) 12 | - (void)lockRightItem:(BOOL)lock 13 | { 14 | NSArray *rightBarItems = self.rightBarButtonItems; 15 | if (rightBarItems && [rightBarItems count]>0) { 16 | [rightBarItems enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 17 | if ([obj isKindOfClass:[UIBarButtonItem class]] || 18 | [obj isMemberOfClass:[UIBarButtonItem class]]) 19 | { 20 | UIBarButtonItem *barButtonItem = (UIBarButtonItem *)obj; 21 | barButtonItem.enabled = !lock; 22 | } 23 | }]; 24 | } 25 | } 26 | 27 | - (void)lockLeftItem:(BOOL)lock 28 | { 29 | NSArray *leftBarItems = self.leftBarButtonItems; 30 | if (leftBarItems && [leftBarItems count]>0) { 31 | [leftBarItems enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { 32 | if ([obj isKindOfClass:[UIBarButtonItem class]] || 33 | [obj isMemberOfClass:[UIBarButtonItem class]]) 34 | { 35 | UIBarButtonItem *barButtonItem = (UIBarButtonItem *)obj; 36 | barButtonItem.enabled = !lock; 37 | } 38 | }]; 39 | } 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UINavigationItem/UINavigationItem+Margin.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License (MIT) 3 | // 4 | // Copyright (c) 2015 Suyeol Jeon (xoul.kr) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // 24 | // https://github.com/devxoul/UINavigationItem-Margin 25 | #import 26 | 27 | FOUNDATION_EXPORT double UINavigationItem_MarginVersionNumber; 28 | FOUNDATION_EXPORT const unsigned char UINavigationItem_MarginVersionString[]; 29 | 30 | @interface UINavigationItem (Margin) 31 | 32 | @property (nonatomic, assign) CGFloat leftMargin; 33 | @property (nonatomic, assign) CGFloat rightMargin; 34 | 35 | + (CGFloat)systemMargin; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIPopoverController/UIPopoverController+iPhone.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIPopoverController+iPhone.h 3 | // IOS-Categories 4 | // 5 | // Created by Jakey on 15/7/12. 6 | // Copyright © 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | // Runtime implementation to allow UIPopoverController on iPhone apps. 9 | 10 | #import 11 | 12 | @interface UIPopoverController (iPhone) 13 | /** 14 | * @brief 开启UIPopoverController支持iPhone 15 | * 16 | * @return 开启状态 17 | */ 18 | + (BOOL)_popoversDisabled; 19 | @end 20 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIPopoverController/UIPopoverController+iPhone.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIPopoverController+iPhone.m 3 | // IOS-Categories 4 | // 5 | // Created by Jakey on 15/7/12. 6 | // Copyright © 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIPopoverController+iPhone.h" 10 | 11 | @implementation UIPopoverController (iPhone) 12 | /** 13 | * @brief 开启UIPopoverController支持iPhone 14 | * 15 | * @return 开启状态 16 | */ 17 | + (BOOL)_popoversDisabled { 18 | return NO; 19 | } 20 | @end 21 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIResponder/UIResponder+Chain.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIResponder+Chain.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIResponder (Chain) 12 | /** 13 | * @brief 响应者链 14 | * 15 | * @return 响应者链 16 | */ 17 | - (NSString *)responderChainDescription; 18 | @end 19 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIResponder/UIResponder+FirstResponder.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIResponder+FirstResponder.h 3 | // 4 | // Created by Thad McDowell 5 | // Copyright (c) 2015 Roaming Logic LLC 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // https://github.com/thad/ExampleFindFirstResponder 25 | // This is an example project using a UIResponder category to find the current first responder. 26 | 27 | 28 | #import 29 | 30 | @interface UIResponder (FirstResponder) 31 | /** 32 | * @brief 当前第一响应者 33 | * 34 | * @return 当前第一响应者 35 | */ 36 | + (id)currentFirstResponder; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIResponder/UIResponder+UIAdapt.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIResponder+UIAdapt.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/28. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIResponder (UIAdapt) 12 | CGRect CGAdaptRectMake(CGFloat x, CGFloat y, CGFloat width, CGFloat height); 13 | CGPoint CGAdaptPointMake(CGFloat x, CGFloat y); 14 | -(CGFloat)factorAdapt; 15 | @end 16 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIResponder/UIResponder+UIAdapt.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIResponder+UIAdapt.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/28. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIResponder+UIAdapt.h" 10 | #define XIB_WIDTH 320 11 | 12 | @implementation UIResponder (UIAdapt) 13 | CGRect CGAdaptRectMake(CGFloat x, CGFloat y, CGFloat width, CGFloat height) 14 | { 15 | //UIScreenMode *currentMode = [[UIScreen mainScreen]currentMode]; 16 | CGRect sreenBounds = [UIScreen mainScreen].bounds; 17 | CGFloat scale = sreenBounds.size.width/XIB_WIDTH; 18 | return CGRectMake(x*scale, y*scale, width *scale, height*scale); 19 | } 20 | 21 | CGPoint CGAdaptPointMake(CGFloat x, CGFloat y){ 22 | //UIScreenMode *currentMode = [[UIScreen mainScreen]currentMode]; 23 | CGRect sreenBounds = [UIScreen mainScreen].bounds; 24 | CGFloat scale = sreenBounds.size.width/XIB_WIDTH; 25 | return CGPointMake(x*scale, y*scale); 26 | } 27 | 28 | -(CGFloat)factorAdapt{ 29 | //IScreenMode *currentMode = [[UIScreen mainScreen]currentMode]; 30 | CGRect sreenBounds = [UIScreen mainScreen].bounds; 31 | CGFloat scale = sreenBounds.size.width/XIB_WIDTH; 32 | return scale; 33 | } 34 | @end 35 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIScreen/UIScreen+Frame.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScreen+Frame.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIScreen (Frame) 12 | + (CGSize)size; 13 | + (CGFloat)width; 14 | + (CGFloat)height; 15 | 16 | + (CGSize)orientationSize; 17 | + (CGFloat)orientationWidth; 18 | + (CGFloat)orientationHeight; 19 | + (CGSize)DPISize; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIScreen/UIScreen+Frame.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIScreen+Frame.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIScreen+Frame.h" 10 | 11 | @implementation UIScreen (Frame) 12 | + (CGSize)size 13 | { 14 | return [[UIScreen mainScreen] bounds].size; 15 | } 16 | 17 | + (CGFloat)width 18 | { 19 | return [[UIScreen mainScreen] bounds].size.width; 20 | } 21 | 22 | + (CGFloat)height 23 | { 24 | return [[UIScreen mainScreen] bounds].size.height; 25 | } 26 | 27 | + (CGSize)orientationSize 28 | { 29 | CGFloat systemVersion = [[[UIDevice currentDevice] systemVersion] 30 | doubleValue]; 31 | BOOL isLand = UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation); 32 | return (systemVersion>8.0 && isLand) ? SizeSWAP([UIScreen size]) : [UIScreen size]; 33 | } 34 | 35 | + (CGFloat)orientationWidth 36 | { 37 | return [UIScreen orientationSize].width; 38 | } 39 | 40 | + (CGFloat)orientationHeight 41 | { 42 | return [UIScreen orientationSize].height; 43 | } 44 | 45 | + (CGSize)DPISize 46 | { 47 | CGSize size = [[UIScreen mainScreen] bounds].size; 48 | CGFloat scale = [[UIScreen mainScreen] scale]; 49 | return CGSizeMake(size.width * scale, size.height * scale); 50 | } 51 | 52 | 53 | /** 54 | * 交换高度与宽度 55 | */ 56 | static inline CGSize SizeSWAP(CGSize size) { 57 | return CGSizeMake(size.height, size.width); 58 | } 59 | @end 60 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIScrollView/UIScrollView+Addition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+Addition.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef NS_ENUM(NSInteger, ScrollDirection) { 11 | ScrollDirectionUp, 12 | ScrollDirectionDown, 13 | ScrollDirectionLeft, 14 | ScrollDirectionRight, 15 | ScrollDirectionWTF 16 | }; 17 | 18 | @interface UIScrollView (Addition) 19 | @property(nonatomic) CGFloat contentWidth; 20 | @property(nonatomic) CGFloat contentHeight; 21 | @property(nonatomic) CGFloat contentOffsetX; 22 | @property(nonatomic) CGFloat contentOffsetY; 23 | 24 | - (CGPoint)topContentOffset; 25 | - (CGPoint)bottomContentOffset; 26 | - (CGPoint)leftContentOffset; 27 | - (CGPoint)rightContentOffset; 28 | 29 | - (ScrollDirection)ScrollDirection; 30 | 31 | - (BOOL)isScrolledToTop; 32 | - (BOOL)isScrolledToBottom; 33 | - (BOOL)isScrolledToLeft; 34 | - (BOOL)isScrolledToRight; 35 | - (void)scrollToTopAnimated:(BOOL)animated; 36 | - (void)scrollToBottomAnimated:(BOOL)animated; 37 | - (void)scrollToLeftAnimated:(BOOL)animated; 38 | - (void)scrollToRightAnimated:(BOOL)animated; 39 | 40 | - (NSUInteger)verticalPageIndex; 41 | - (NSUInteger)horizontalPageIndex; 42 | 43 | - (void)scrollToVerticalPageIndex:(NSUInteger)pageIndex animated:(BOOL)animated; 44 | - (void)scrollToHorizontalPageIndex:(NSUInteger)pageIndex animated:(BOOL)animated; 45 | @end 46 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIScrollView/UIScrollView+Pages.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+Pages.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIScrollView (Pages) 12 | - (NSInteger)pages; 13 | - (NSInteger)currentPage; 14 | - (CGFloat)scrollPercent; 15 | 16 | - (CGFloat)pagesY; 17 | - (CGFloat)pagesX; 18 | - (CGFloat)currentPageY; 19 | - (CGFloat)currentPageX; 20 | - (void) setPageY:(CGFloat)page; 21 | - (void) setPageX:(CGFloat)page; 22 | - (void) setPageY:(CGFloat)page animated:(BOOL)animated; 23 | - (void) setPageX:(CGFloat)page animated:(BOOL)animated; 24 | @end 25 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UISplitViewController/UISplitViewController+QuickAccess.h: -------------------------------------------------------------------------------- 1 | // 2 | // UISplitViewController+QuickAccess.h 3 | // 4 | // Created by Timothy Sanders on 6/28/12. 5 | // Copyright (c) 2012 HiddenJester Software. 6 | // This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. 7 | // See http://creativecommons.org/licenses/by-nc-sa/4.0/ 8 | // https://github.com/HiddenJester/UISplitViewController-QuickAccess 9 | 10 | @import UIKit; 11 | 12 | /* 13 | I often want the "left content view controller" or the "right content view controller". 14 | Many times the UIViewControllers in viewControllers are actually UINavigationControllers and then 15 | I want to get the topViewController from that. So these methods pull the left or right VC and then 16 | check if they are UINavigationControllers. If they are then they go ahead and return the controller's 17 | topViewController property. 18 | */ 19 | 20 | @interface UISplitViewController (QuickAccess) 21 | 22 | @property (weak, readonly, nonatomic) UIViewController * leftController; 23 | @property (weak, readonly, nonatomic) UIViewController * rightController; 24 | 25 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UISplitViewController/UISplitViewController+QuickAccess.m: -------------------------------------------------------------------------------- 1 | // 2 | // UISplitViewController+QuickAccess.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | #import "UISplitViewController+QuickAccess.h" 12 | 13 | @implementation UISplitViewController (QuickAccess) 14 | 15 | - (UIViewController *)leftController { 16 | UIViewController * leftVC = [[self viewControllers] objectAtIndex:0]; 17 | 18 | if ([leftVC isKindOfClass:[UINavigationController class]]) { 19 | leftVC = [(UINavigationController *)leftVC topViewController]; 20 | } 21 | return leftVC; 22 | } 23 | 24 | - (UIViewController *)rightController { 25 | UIViewController * rightVC = [[self viewControllers] lastObject]; 26 | 27 | if ([rightVC isKindOfClass:[UINavigationController class]]) { 28 | rightVC = [(UINavigationController *)rightVC topViewController]; 29 | } 30 | return rightVC; 31 | } 32 | 33 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITableView/UITableView+iOS7Style.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+iOS7Style.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/6/1. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UITableView (iOS7Style) 12 | /** 13 | * @brief ios7设置页面的UITableViewCell样式 14 | * 15 | * @param cell cell 16 | * @param indexPath indexPath 17 | */ 18 | -(void)applyiOS7SettingsStyleGrouping:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; 19 | @end 20 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITableViewCell/UITableViewCell+NIB.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewCell+NIB.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/11/19. 6 | // Copyright (c) 2014年 jakey. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UITableViewCell (NIB) 12 | /** 13 | * @brief 加载同类名的nib 14 | * 15 | * @return nib 16 | */ 17 | +(UINib*)nib; 18 | @end 19 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITableViewCell/UITableViewCell+NIB.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewCell+NIB.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/11/19. 6 | // Copyright (c) 2014年 jakey. All rights reserved. 7 | // 8 | 9 | #import "UITableViewCell+NIB.h" 10 | 11 | @implementation UITableViewCell (NIB) 12 | /** 13 | * @brief 加载同类名的nib 14 | * 15 | * @return nib 16 | */ 17 | +(UINib*)nib{ 18 | return [UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil]; 19 | } 20 | @end 21 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITableViewCell/UITableViewCell+TS_delaysContentTouches.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewCell+TS_delaysContentTouches.h 3 | // tableViewCellDelaysContentTouches 4 | // 5 | // Created by Nicholas Hodapp on 1/31/14. 6 | // Copyright (c) 2014 Nicholas Hodapp. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UITableViewCell (TS_delaysContentTouches) 12 | 13 | @property (nonatomic, assign) BOOL ts_delaysContentTouches; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITableViewCell/UITableViewCell+TS_delaysContentTouches.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITableViewCell+TS_delaysContentTouches.m 3 | // tableViewCellDelaysContentTouches 4 | // 5 | // Created by Nicholas Hodapp on 1/31/14. 6 | // Copyright (c) 2014 Nicholas Hodapp. All rights reserved. 7 | // 8 | 9 | #import "UITableViewCell+TS_delaysContentTouches.h" 10 | 11 | @implementation UITableViewCell (TS_delaysContentTouches) 12 | 13 | - (UIScrollView*) ts_scrollView 14 | { 15 | id sv = self.contentView.superview; 16 | while ( ![sv isKindOfClass: [UIScrollView class]] && sv != self ) 17 | { 18 | sv = [sv superview]; 19 | } 20 | 21 | return sv == self ? nil : sv; 22 | } 23 | 24 | - (void) setTs_delaysContentTouches:(BOOL)delaysContentTouches 25 | { 26 | [self willChangeValueForKey: @"ts_delaysContentTouches"]; 27 | 28 | [[self ts_scrollView] setDelaysContentTouches: delaysContentTouches]; 29 | 30 | [self didChangeValueForKey: @"ts_delaysContentTouches"]; 31 | } 32 | 33 | - (BOOL) ts_delaysContentTouches 34 | { 35 | return [[self ts_scrollView] delaysContentTouches]; 36 | } 37 | 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITextField/UITextField+Blocks.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextField+Blocks.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | @interface UITextField (Blocks) 11 | @property (copy, nonatomic) BOOL (^shouldBegindEditingBlock)(UITextField *textField); 12 | @property (copy, nonatomic) BOOL (^shouldEndEditingBlock)(UITextField *textField); 13 | @property (copy, nonatomic) void (^didBeginEditingBlock)(UITextField *textField); 14 | @property (copy, nonatomic) void (^didEndEditingBlock)(UITextField *textField); 15 | @property (copy, nonatomic) BOOL (^shouldChangeCharactersInRangeBlock)(UITextField *textField, NSRange range, NSString *replacementString); 16 | @property (copy, nonatomic) BOOL (^shouldReturnBlock)(UITextField *textField); 17 | @property (copy, nonatomic) BOOL (^shouldClearBlock)(UITextField *textField); 18 | - (void)setShouldBegindEditingBlock:(BOOL (^)(UITextField *textField))shouldBegindEditingBlock; 19 | - (void)setShouldEndEditingBlock:(BOOL (^)(UITextField *textField))shouldEndEditingBlock; 20 | - (void)setDidBeginEditingBlock:(void (^)(UITextField *textField))didBeginEditingBlock; 21 | - (void)setDidEndEditingBlock:(void (^)(UITextField *textField))didEndEditingBlock; 22 | - (void)setShouldChangeCharactersInRangeBlock:(BOOL (^)(UITextField *textField, NSRange range, NSString *string))shouldChangeCharactersInRangeBlock; 23 | - (void)setShouldClearBlock:(BOOL (^)(UITextField *textField))shouldClearBlock; 24 | - (void)setShouldReturnBlock:(BOOL (^)(UITextField *textField))shouldReturnBlock; 25 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITextField/UITextField+History.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextField+History.h 3 | // Demo 4 | // 5 | // Created by DamonDing on 15/5/26. 6 | // Copyright (c) 2015年 morenotepad. All rights reserved. 7 | // 8 | // https://github.com/Jameson-zxm/UITextField-History 9 | // A category of UITextfiled that can record it's input as history 10 | 11 | #import 12 | 13 | @interface UITextField (History) 14 | 15 | /** 16 | * identity of this textfield 17 | */ 18 | @property (retain, nonatomic) NSString* identify; 19 | 20 | /** 21 | * load textfiled input history 22 | * 23 | * @param identify identity of this textfield 24 | * 25 | * @return the history of it's input 26 | */ 27 | - (NSArray*) loadHistroy; 28 | 29 | /** 30 | * save current input text 31 | */ 32 | - (void) synchronize; 33 | 34 | - (void) showHistory; 35 | - (void) hideHistroy; 36 | 37 | - (void) clearHistory; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITextField/UITextField+Select.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextField+Select.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/6/1. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UITextField (Select) 12 | /** 13 | * @brief 当前选中的字符串范围 14 | * 15 | * @return NSRange 16 | */ 17 | - (NSRange)selectedRange; 18 | /** 19 | * @brief 选中所有文字 20 | */ 21 | - (void)selectAllText; 22 | /** 23 | * @brief 选中指定范围的文字 24 | * 25 | * @param range NSRange范围 26 | */ 27 | - (void)setSelectedRange:(NSRange)range; 28 | @end 29 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITextField/UITextField+Select.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITextField+Select.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/6/1. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UITextField+Select.h" 10 | 11 | @implementation UITextField (Select) 12 | /** 13 | * @brief 当前选中的字符串范围 14 | * 15 | * @return NSRange 16 | */ 17 | - (NSRange)selectedRange 18 | { 19 | UITextPosition* beginning = self.beginningOfDocument; 20 | 21 | UITextRange* selectedRange = self.selectedTextRange; 22 | UITextPosition* selectionStart = selectedRange.start; 23 | UITextPosition* selectionEnd = selectedRange.end; 24 | 25 | NSInteger location = [self offsetFromPosition:beginning toPosition:selectionStart]; 26 | NSInteger length = [self offsetFromPosition:selectionStart toPosition:selectionEnd]; 27 | 28 | return NSMakeRange(location, length); 29 | } 30 | /** 31 | * @brief 选中所有文字 32 | */ 33 | - (void)selectAllText { 34 | UITextRange *range = [self textRangeFromPosition:self.beginningOfDocument toPosition:self.endOfDocument]; 35 | [self setSelectedTextRange:range]; 36 | } 37 | /** 38 | * @brief 选中指定范围的文字 39 | * 40 | * @param range NSRange范围 41 | */ 42 | - (void)setSelectedRange:(NSRange)range { 43 | UITextPosition *beginning = self.beginningOfDocument; 44 | UITextPosition *startPosition = [self positionFromPosition:beginning offset:range.location]; 45 | UITextPosition *endPosition = [self positionFromPosition:beginning offset:NSMaxRange(range)]; 46 | UITextRange *selectionRange = [self textRangeFromPosition:startPosition toPosition:endPosition]; 47 | [self setSelectedTextRange:selectionRange]; 48 | } 49 | @end 50 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITextView/UITextView+PinchZoom.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextView+PinchZoom.h 3 | // 4 | // Created by Stan Serebryakov on 04.12.12. 5 | // 6 | // Based on Aral Balkan snippet. 7 | 8 | // https://github.com/cfr/UITextView-PinchZoom 9 | // Simple pinch-zoom category for UITextView 10 | 11 | /* 12 | UITextView *textView = [[UITextView alloc] initWithFrame:self.view.frame]; 13 | [self.view addSubview:textView]; 14 | textView.zoomEnabled = YES; 15 | textView.minFontSize = 10; 16 | textView.maxFontSize = 40; 17 | */ 18 | #import 19 | 20 | @interface UITextView (PinchZoom) 21 | 22 | @property (nonatomic) CGFloat maxFontSize, minFontSize; 23 | 24 | @property (nonatomic, getter = isZoomEnabled) BOOL zoomEnabled; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITextView/UITextView+PlaceHolder.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextView+PlaceHolder.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | @interface UITextView (PlaceHolder) 12 | @property (nonatomic, strong) UITextView *placeHolderTextView; 13 | //@property (nonatomic, assign) id textViewDelegate; 14 | - (void)addPlaceHolder:(NSString *)placeHolder; 15 | @end 16 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UITextView/UITextView+Select.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextView+Select.h 3 | // IOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/6/1. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UITextView (Select) 12 | /** 13 | * @brief 当前选中的字符串范围 14 | * 15 | * @return NSRange 16 | */ 17 | - (NSRange)selectedRange; 18 | /** 19 | * @brief 选中所有文字 20 | */ 21 | - (void)selectAllText; 22 | /** 23 | * @brief 选中指定范围的文字 24 | * 25 | * @param range NSRange范围 26 | */ 27 | - (void)setSelectedRange:(NSRange)range; 28 | 29 | 30 | 31 | //https://github.com/pclion/TextViewCalculateLength 32 | // 用于计算textview输入情况下的字符数,解决实现限制字符数时,计算不准的问题 33 | - (NSInteger)getInputLengthWithText:(NSString *)text; 34 | /* 35 | - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text 36 | { 37 | NSInteger textLength = [textView getInputLengthWithText:text]; 38 | if (textLength > 20) { 39 | //超过20个字可以删除 40 | if ([text isEqualToString:@""]) { 41 | return YES; 42 | } 43 | return NO; 44 | } 45 | return YES; 46 | } 47 | 48 | - (void)textViewDidChange:(UITextView *)textView 49 | { 50 | if ([textView getInputLengthWithText:nil] > 20) { 51 | textView.text = [textView.text substringToIndex:20]; 52 | } 53 | } 54 | */ 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+Animation.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Animation.h 3 | // CoolUIViewAnimations 4 | // 5 | // Created by Peter de Tagyos on 12/10/11. 6 | // Copyright (c) 2011 PT Software Solutions. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | float radiansForDegrees(int degrees); 12 | 13 | @interface UIView (Animation) 14 | 15 | // Moves 16 | - (void)moveTo:(CGPoint)destination duration:(float)secs option:(UIViewAnimationOptions)option; 17 | - (void)moveTo:(CGPoint)destination duration:(float)secs option:(UIViewAnimationOptions)option delegate:(id)delegate callback:(SEL)method; 18 | - (void)raceTo:(CGPoint)destination withSnapBack:(BOOL)withSnapBack; 19 | - (void)raceTo:(CGPoint)destination withSnapBack:(BOOL)withSnapBack delegate:(id)delegate callback:(SEL)method; 20 | 21 | // Transforms 22 | - (void)rotate:(int)degrees secs:(float)secs delegate:(id)delegate callback:(SEL)method; 23 | - (void)scale:(float)secs x:(float)scaleX y:(float)scaleY delegate:(id)delegate callback:(SEL)method; 24 | - (void)spinClockwise:(float)secs; 25 | - (void)spinCounterClockwise:(float)secs; 26 | 27 | // Transitions 28 | - (void)curlDown:(float)secs; 29 | - (void)curlUpAndAway:(float)secs; 30 | - (void)drainAway:(float)secs; 31 | 32 | // Effects 33 | - (void)changeAlpha:(float)newAlpha secs:(float)secs; 34 | - (void)pulse:(float)secs continuously:(BOOL)continuously; 35 | 36 | //add subview 37 | - (void)addSubviewWithFadeAnimation:(UIView *)subview; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+BlockGesture.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+UIView_BlockGesture.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef void (^GestureActionBlock)(UIGestureRecognizer *gestureRecoginzer); 11 | 12 | @interface UIView (BlockGesture) 13 | /** 14 | * @brief 添加tap手势 15 | * 16 | * @param block 代码块 17 | */ 18 | - (void)addTapActionWithBlock:(GestureActionBlock)block; 19 | /** 20 | * @brief 添加长按手势 21 | * 22 | * @param block 代码块 23 | */ 24 | - (void)addLongPressActionWithBlock:(GestureActionBlock)block; 25 | @end 26 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+Constraints.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Constraints.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/5/22. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (Constraints) 12 | - (NSLayoutConstraint *)constraintForAttribute:(NSLayoutAttribute)attribute; 13 | 14 | - (NSLayoutConstraint *)leftConstraint; 15 | - (NSLayoutConstraint *)rightConstraint; 16 | - (NSLayoutConstraint *)topConstraint; 17 | - (NSLayoutConstraint *)bottomConstraint; 18 | - (NSLayoutConstraint *)leadingConstraint; 19 | - (NSLayoutConstraint *)trailingConstraint; 20 | - (NSLayoutConstraint *)widthConstraint; 21 | - (NSLayoutConstraint *)heightConstraint; 22 | - (NSLayoutConstraint *)centerXConstraint; 23 | - (NSLayoutConstraint *)centerYConstraint; 24 | - (NSLayoutConstraint *)baseLineConstraint; 25 | @end 26 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+CustomBorder.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+CustomBorder.h 3 | // Categories 4 | // 5 | // Created by luomeng on 15/11/3. 6 | // Copyright © 2015年 luomeng. All rights reserved. 7 | // 8 | /** 9 | * 视图添加边框 10 | */ 11 | 12 | #import 13 | 14 | typedef NS_OPTIONS(NSUInteger, ExcludePoint) { 15 | ExcludeStartPoint = 1 << 0, 16 | ExcludeEndPoint = 1 << 1, 17 | ExcludeAllPoint = ~0UL 18 | }; 19 | 20 | 21 | @interface UIView (CustomBorder) 22 | 23 | - (void)addTopBorderWithColor:(UIColor *)color width:(CGFloat) borderWidth; 24 | - (void)addLeftBorderWithColor: (UIColor *) color width:(CGFloat) borderWidth; 25 | - (void)addBottomBorderWithColor:(UIColor *)color width:(CGFloat) borderWidth; 26 | - (void)addRightBorderWithColor:(UIColor *)color width:(CGFloat) borderWidth; 27 | 28 | - (void)removeTopBorder; 29 | - (void)removeLeftBorder; 30 | - (void)removeBottomBorder; 31 | - (void)removeRightBorder; 32 | 33 | 34 | - (void)addTopBorderWithColor:(UIColor *)color width:(CGFloat) borderWidth excludePoint:(CGFloat)point edgeType:(ExcludePoint)edge; 35 | - (void)addLeftBorderWithColor: (UIColor *) color width:(CGFloat) borderWidth excludePoint:(CGFloat)point edgeType:(ExcludePoint)edge; 36 | - (void)addBottomBorderWithColor:(UIColor *)color width:(CGFloat) borderWidth excludePoint:(CGFloat)point edgeType:(ExcludePoint)edge; 37 | - (void)addRightBorderWithColor:(UIColor *)color width:(CGFloat) borderWidth excludePoint:(CGFloat)point edgeType:(ExcludePoint)edge; 38 | @end 39 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+Debug.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIVIew+Debug.h 3 | // Constraints_Hybrid 4 | // 5 | // Created by Eric Rolf on 1/3/13. 6 | // Copyright (c) 2013 Cardinal Solutions. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | 13 | @interface UIView (Debug) 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+Find.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Find.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/4/25. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (Find) 12 | /** 13 | * @brief 找到指定类名的SubVie对象 14 | * 15 | * @param clazz SubVie类名 16 | * 17 | * @return view对象 18 | */ 19 | - (id)findSubViewWithSubViewClass:(Class)clazz; 20 | /** 21 | * @brief 找到指定类名的SuperView对象 22 | * 23 | * @param clazz SuperView类名 24 | * 25 | * @return view对象 26 | */ 27 | - (id)findSuperViewWithSuperViewClass:(Class)clazz; 28 | 29 | /** 30 | * @brief 找到并且resign第一响应者 31 | * 32 | * @return 结果 33 | */ 34 | - (BOOL)findAndResignFirstResponder; 35 | /** 36 | * @brief 找到第一响应者 37 | * 38 | * @return 第一响应者 39 | */ 40 | - (UIView *)findFirstResponder; 41 | @end 42 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+Frame.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Frame.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (Frame) 12 | // shortcuts for frame properties 13 | @property (nonatomic, assign) CGPoint origin; 14 | @property (nonatomic, assign) CGSize size; 15 | 16 | // shortcuts for positions 17 | @property (nonatomic) CGFloat centerX; 18 | @property (nonatomic) CGFloat centerY; 19 | 20 | 21 | @property (nonatomic) CGFloat top; 22 | @property (nonatomic) CGFloat bottom; 23 | @property (nonatomic) CGFloat right; 24 | @property (nonatomic) CGFloat left; 25 | 26 | @property (nonatomic) CGFloat width; 27 | @property (nonatomic) CGFloat height; 28 | @end 29 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+Nib.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Nib.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface UIView (Nib) 13 | + (UINib *)loadNib; 14 | + (UINib *)loadNibNamed:(NSString*)nibName; 15 | + (UINib *)loadNibNamed:(NSString*)nibName bundle:(NSBundle *)bundle; 16 | + (instancetype)loadInstanceFromNib; 17 | + (instancetype)loadInstanceFromNibWithName:(NSString *)nibName; 18 | + (instancetype)loadInstanceFromNibWithName:(NSString *)nibName owner:(id)owner; 19 | + (instancetype)loadInstanceFromNibWithName:(NSString *)nibName owner:(id)owner bundle:(NSBundle *)bundle; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+Nib.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Nib.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIView+Nib.h" 10 | 11 | @implementation UIView (Nib) 12 | #pragma mark - Nibs 13 | + (UINib *)loadNib 14 | { 15 | return [self loadNibNamed:NSStringFromClass([self class])]; 16 | } 17 | + (UINib *)loadNibNamed:(NSString*)nibName 18 | { 19 | return [self loadNibNamed:nibName bundle:[NSBundle mainBundle]]; 20 | } 21 | + (UINib *)loadNibNamed:(NSString*)nibName bundle:(NSBundle *)bundle 22 | { 23 | return [UINib nibWithNibName:nibName bundle:bundle]; 24 | } 25 | + (instancetype)loadInstanceFromNib 26 | { 27 | return [self loadInstanceFromNibWithName:NSStringFromClass([self class])]; 28 | } 29 | + (instancetype)loadInstanceFromNibWithName:(NSString *)nibName 30 | { 31 | return [self loadInstanceFromNibWithName:nibName owner:nil]; 32 | } 33 | + (instancetype)loadInstanceFromNibWithName:(NSString *)nibName owner:(id)owner 34 | { 35 | return [self loadInstanceFromNibWithName:nibName owner:owner bundle:[NSBundle mainBundle]]; 36 | } 37 | + (instancetype)loadInstanceFromNibWithName:(NSString *)nibName owner:(id)owner bundle:(NSBundle *)bundle 38 | { 39 | UIView *result = nil; 40 | NSArray* elements = [bundle loadNibNamed:nibName owner:owner options:nil]; 41 | for (id object in elements) 42 | { 43 | if ([object isKindOfClass:[self class]]) 44 | { 45 | result = object; 46 | break; 47 | } 48 | } 49 | return result; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+Recursion.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Recursion.h 3 | // IOS-Categories 4 | // 5 | // Created by Jakey on 15/6/23. 6 | // Copyright © 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef void (^SubviewBlock) (UIView* view); 11 | typedef void (^SuperviewBlock) (UIView* superview); 12 | @interface UIView (Recursion) 13 | 14 | /** 15 | * @brief 寻找子视图 16 | * 17 | * @param recurse 回调 18 | * 19 | * @return Return YES from the block to recurse into the subview. 20 | Set stop to YES to return the subview. 21 | */ 22 | - (UIView*)findViewRecursively:(BOOL(^)(UIView* subview, BOOL* stop))recurse; 23 | 24 | 25 | -(void)runBlockOnAllSubviews:(SubviewBlock)block; 26 | -(void)runBlockOnAllSuperviews:(SuperviewBlock)block; 27 | -(void)enableAllControlsInViewHierarchy; 28 | -(void)disableAllControlsInViewHierarchy; 29 | @end 30 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+Screenshot.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Screenshot.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/10. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (Screenshot) 12 | /** 13 | * @brief view截图 14 | * 15 | * @return 截图 16 | */ 17 | - (UIImage *)screenshot; 18 | 19 | /** 20 | * @author Jakey 21 | * 22 | * @brief 截图一个view中所有视图 包括旋转缩放效果 23 | * 24 | * @param aView 一个view 25 | * @param limitWidth 限制缩放的最大宽度 保持默认传0 26 | * 27 | * @return 截图 28 | */ 29 | - (UIImage *)screenshot:(CGFloat)maxWidth; 30 | @end 31 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+ViewController.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by 符现超 on 15/5/9. 6 | // Copyright (c) 2015年 http://weibo.com/u/1655766025 All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (ViewController) 12 | /** 13 | * @brief 找到当前view所在的viewcontroler 14 | */ 15 | @property (readonly) UIViewController *viewController; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIView/UIView+ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+ViewController.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by 符现超 on 15/5/9. 6 | // Copyright (c) 2015年 http://weibo.com/u/1655766025 All rights reserved. 7 | // 8 | 9 | #import "UIView+ViewController.h" 10 | 11 | @implementation UIView (ViewController) 12 | /** 13 | * @brief 找到当前view所在的viewcontroler 14 | */ 15 | - (UIViewController *)viewController 16 | { 17 | UIResponder *responder = self.nextResponder; 18 | do { 19 | if ([responder isKindOfClass:[UIViewController class]]) { 20 | return (UIViewController *)responder; 21 | } 22 | responder = responder.nextResponder; 23 | } while (responder); 24 | return nil; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIViewController/UIViewController+BackButtonHandler.h: -------------------------------------------------------------------------------- 1 | // UIViewController+BackButtonHandler.h 2 | // 3 | // Created by Sergey Nikitenko on 10/1/13. 4 | // Copyright 2013 Sergey Nikitenko. All rights reserved. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | 25 | #import 26 | 27 | @protocol BackButtonHandlerProtocol 28 | @optional 29 | // Override this method in UIViewController derived class to handle 'Back' button click 30 | -(BOOL)navigationShouldPopOnBackButton; 31 | @end 32 | 33 | @interface UIViewController (BackButtonHandler) 34 | 35 | @end 36 | 37 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIViewController/UIViewController+BackButtonItemTitle.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+BackButtonItemTitle.h 3 | // Author : https://github.com/KevinHM 4 | // 5 | // Created by KevinHM on 15/8/6. 6 | // Copyright (c) 2015年 KevinHM. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol BackButtonItemTitleProtocol 12 | 13 | @optional 14 | - (NSString *)navigationItemBackBarButtonTitle; //The length of the text is limited, otherwise it will be set to "Back" 15 | 16 | @end 17 | 18 | @interface UIViewController (BackButtonItemTitle) 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIViewController/UIViewController+BackButtonItemTitle.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+BackButtonItemTitle.m 3 | // Author : https://github.com/KevinHM 4 | // 5 | // Created by KevinHM on 15/8/6. 6 | // Copyright (c) 2015年 KevinHM. All rights reserved. 7 | // 8 | 9 | #import "UIViewController+BackButtonItemTitle.h" 10 | 11 | @implementation UIViewController (BackButtonItemTitle) 12 | 13 | @end 14 | 15 | @implementation UINavigationController (NavigationItemBackBtnTile) 16 | 17 | - (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPushItem:(UINavigationItem *)item { 18 | 19 | UIViewController * viewController = self.viewControllers.count > 1 ? \ 20 | [self.viewControllers objectAtIndex:self.viewControllers.count - 2] : nil; 21 | 22 | if (!viewController) { 23 | return YES; 24 | } 25 | 26 | NSString *backButtonTitle = nil; 27 | if ([viewController respondsToSelector:@selector(navigationItemBackBarButtonTitle)]) { 28 | backButtonTitle = [viewController navigationItemBackBarButtonTitle]; 29 | } 30 | 31 | if (!backButtonTitle) { 32 | backButtonTitle = viewController.title; 33 | } 34 | 35 | UIBarButtonItem *backButtonItem = [[UIBarButtonItem alloc] initWithTitle:backButtonTitle 36 | style:UIBarButtonItemStylePlain 37 | target:nil action:nil]; 38 | viewController.navigationItem.backBarButtonItem = backButtonItem; 39 | 40 | return YES; 41 | } 42 | 43 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIViewController/UIViewController+BackButtonTouched.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+BackButtonTouched.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | #import 9 | typedef void (^BackButtonHandler)(UIViewController *vc); 10 | @interface UIViewController (BackButtonTouched) 11 | -(void)backButtonTouched:(BackButtonHandler)backButtonHandler; 12 | @end 13 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIViewController/UIViewController+BackButtonTouched.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+BackButtonTouched.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/30. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIViewController+BackButtonTouched.h" 10 | #import 11 | static const void *BackButtonHandlerKey = &BackButtonHandlerKey; 12 | 13 | @implementation UIViewController (BackButtonTouched) 14 | -(void)backButtonTouched:(BackButtonHandler)backButtonHandler{ 15 | objc_setAssociatedObject(self, BackButtonHandlerKey, backButtonHandler, OBJC_ASSOCIATION_COPY); 16 | } 17 | - (BackButtonHandler)backButtonHandler 18 | { 19 | return objc_getAssociatedObject(self, BackButtonHandlerKey); 20 | } 21 | @end 22 | 23 | @implementation UINavigationController (ShouldPopItem) 24 | - (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item { 25 | 26 | if([self.viewControllers count] < [navigationBar.items count]) { 27 | return YES; 28 | } 29 | 30 | UIViewController* vc = [self topViewController]; 31 | BackButtonHandler handler = [vc backButtonHandler]; 32 | if (handler) { 33 | dispatch_async(dispatch_get_main_queue(), ^{ 34 | handler(self); 35 | }); 36 | }else{ 37 | dispatch_async(dispatch_get_main_queue(), ^{ 38 | [self popViewControllerAnimated:YES]; 39 | }); 40 | } 41 | 42 | return NO; 43 | } 44 | @end 45 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIViewController/UIViewController+BlockSegue.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Jorge Maroto García 3 | http://maroto.me 4 | 5 | Permission is hereby granted, free of charge, to any 6 | person obtaining a copy of this software and associated 7 | documentation files (the "Software"), to deal in the 8 | Software without restriction, including without limitation 9 | the rights to use, copy, modify, merge, publish, 10 | distribute, sublicense, and/or sell copies of the 11 | Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice 15 | shall be included in all copies or substantial portions of 16 | the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 19 | KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 20 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 21 | PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 22 | OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 23 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 24 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | */ 27 | 28 | //https://github.com/patoroco/UIViewController-BlockSegue 29 | 30 | #import 31 | 32 | typedef void (^UIViewControllerSegueBlock) (id sender, id destinationVC, UIStoryboardSegue *segue); 33 | 34 | @interface UIViewController (BlockSegue) 35 | 36 | -(void)configureSegue:(NSString *)identifier withBlock:(UIViewControllerSegueBlock)block; 37 | -(void)performSegueWithIdentifier:(NSString *)identifier sender:(id)sender withBlock:(UIViewControllerSegueBlock)block; 38 | 39 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIViewController/UIViewController+MJPopupViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MJPopupViewController.h 3 | // MJModalViewController 4 | // 5 | // Created by Martin Juhasz on 11.05.12. 6 | // Copyright (c) 2012 martinjuhasz.de. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MJPopupBackgroundView; 12 | 13 | typedef NS_ENUM(NSInteger, MJPopupViewAnimation) { 14 | MJPopupViewAnimationFade = 0, 15 | MJPopupViewAnimationSlideBottomTop = 1, 16 | MJPopupViewAnimationSlideBottomBottom, 17 | MJPopupViewAnimationSlideTopTop, 18 | MJPopupViewAnimationSlideTopBottom, 19 | MJPopupViewAnimationSlideLeftLeft, 20 | MJPopupViewAnimationSlideLeftRight, 21 | MJPopupViewAnimationSlideRightLeft, 22 | MJPopupViewAnimationSlideRightRight, 23 | }; 24 | 25 | @interface UIViewController (MJPopupViewController) 26 | 27 | @property (nonatomic, retain) UIViewController *mj_popupViewController; 28 | @property (nonatomic, retain) MJPopupBackgroundView *mj_popupBackgroundView; 29 | 30 | - (void)presentPopupViewController:(UIViewController*)popupViewController animationType:(MJPopupViewAnimation)animationType; 31 | - (void)presentPopupViewController:(UIViewController*)popupViewController animationType:(MJPopupViewAnimation)animationType backgroundTouch:(BOOL)enable dismissed:(void(^)(void))dismissed; 32 | 33 | - (void)dismissPopupViewControllerWithanimationType:(MJPopupViewAnimation)animationType; 34 | 35 | @end 36 | 37 | 38 | 39 | @interface MJPopupBackgroundView : UIView 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIViewController/UIViewController+StoreKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+StoreKit.h 3 | // Picks 4 | // 5 | // Created by Joe Fabisevich on 8/12/14. 6 | // Copyright (c) 2014 Snarkbots. All rights reserved. 7 | // https://github.com/mergesort/UIViewController-StoreKit 8 | 9 | #import 10 | 11 | //////////////////////////////////////////////////////////////////////////////// 12 | #pragma mark - Constants 13 | 14 | #define affiliateToken @"10laQX" 15 | 16 | //////////////////////////////////////////////////////////////////////////////// 17 | #pragma mark - Interface 18 | 19 | @interface UIViewController (StoreKit) 20 | 21 | @property NSString* campaignToken; 22 | @property (nonatomic, copy) void (^loadingStoreKitItemBlock)(void); 23 | @property (nonatomic, copy) void (^loadedStoreKitItemBlock)(void); 24 | 25 | - (void)presentStoreKitItemWithIdentifier:(NSInteger)itemIdentifier; 26 | 27 | + (NSURL*)appURLForIdentifier:(NSInteger)identifier; 28 | 29 | + (void)openAppURLForIdentifier:(NSInteger)identifier; 30 | + (void)openAppReviewURLForIdentifier:(NSInteger)identifier; 31 | 32 | + (BOOL)containsITunesURLString:(NSString*)URLString; 33 | + (NSInteger)IDFromITunesURL:(NSString*)URLString; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIViewController/UIViewController+Visible.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+Visible.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIViewController (Visible) 12 | - (BOOL)isVisible; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIViewController/UIViewController+Visible.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+Visible.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIViewController+Visible.h" 10 | 11 | @implementation UIViewController (Visible) 12 | - (BOOL)isVisible { 13 | return [self isViewLoaded] && self.view.window; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIWebView/UIWebVIew+SwipeGesture.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebVIew+SwipeGesture.h 3 | // SNSwipeGestureSample 4 | // 5 | // Created by Noda Shimpei on 2013/05/18. 6 | // Copyright (c) 2013年 Noda Shimpei. All rights reserved. 7 | // 8 | 9 | /** 10 | * @Author(作者) IOS-Categories 11 | * 12 | * @URL(地址) https://github.com/OopsMouse/UIWebView-SwipeGesture 13 | * 14 | * @Version(版本) 20150620 15 | * 16 | * @Requirements(运行要求) 17 | * 18 | * @Description(描述) Category for UIWebView to back and go a browser page with double finger swipe. 19 | * @Usage(使用) .. 20 | */ 21 | 22 | 23 | #import 24 | 25 | @interface UIWebView (SwipeGesture) 26 | 27 | - (void)useSwipeGesture; 28 | 29 | @end -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIWebView/UIWebView+Alert.h: -------------------------------------------------------------------------------- 1 | // 2 | // WebView+Alert.h 3 | // AlertProject 4 | // 5 | // Created by Peter.Kang on 14-1-23. 6 | // Copyright (c) 2014年 Peter.Kang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIWebView (JavaScriptAlert) 12 | -(void)webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(id)frame; 13 | 14 | -(BOOL)webView:(UIWebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(id)frame; 15 | @end 16 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIWebView/UIWebView+Alert.m: -------------------------------------------------------------------------------- 1 | // 2 | // WebView+Alert.m 3 | // AlertProject 4 | // 5 | // Created by Peter.Kang on 14-1-23. 6 | // Copyright (c) 2014年 Peter.Kang. All rights reserved. 7 | // 8 | 9 | #import "UIWebView+Alert.h" 10 | 11 | @implementation UIWebView (JavaScriptAlert) 12 | 13 | static BOOL diagStat = NO; 14 | 15 | -(void)webView:(UIWebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(id)frame{ 16 | UIAlertView* dialogue = [[UIAlertView alloc]initWithTitle:nil message:message delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil, nil]; 17 | [dialogue show];; 18 | } 19 | 20 | -(BOOL)webView:(UIWebView *)sender runJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(id)frame{ 21 | UIAlertView* dialogue = [[UIAlertView alloc] initWithTitle:nil message:message delegate:self cancelButtonTitle:NSLocalizedString(@"Okay", @"Okay") otherButtonTitles:NSLocalizedString(@"Cancel", @"Cancel"), nil]; 22 | [dialogue show]; 23 | while (dialogue.hidden==NO && dialogue.superview!=nil) { 24 | [[NSRunLoop mainRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01f]]; 25 | } 26 | 27 | return diagStat; 28 | } 29 | 30 | -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{ 31 | if (buttonIndex==0) { 32 | diagStat=YES; 33 | }else if(buttonIndex==1){ 34 | diagStat=NO; 35 | } 36 | } 37 | @end 38 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIWebView/UIWebView+JS.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebView+JS.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/22. 6 | // Copyright (c) 2014年 duzixi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIWebView (JS) 12 | 13 | #pragma mark - 14 | #pragma mark 获取网页中的数据 15 | /// 获取某个标签的结点个数 16 | - (int)nodeCountOfTag:(NSString *)tag; 17 | /// 获取当前页面URL 18 | - (NSString *) getCurrentURL; 19 | /// 获取标题 20 | - (NSString *) getTitle; 21 | /// 获取图片 22 | - (NSArray *) getImgs; 23 | /// 获取当前页面所有链接 24 | - (NSArray *) getOnClicks; 25 | #pragma mark - 26 | #pragma mark 改变网页样式和行为 27 | /// 改变背景颜色 28 | - (void) setBackgroundColor:(UIColor *)color; 29 | /// 为所有图片添加点击事件(网页中有些图片添加无效) 30 | - (void) addClickEventOnImg; 31 | /// 改变所有图像的宽度 32 | - (void) setImgWidth:(int)size; 33 | /// 改变所有图像的高度 34 | - (void) setImgHeight:(int)size; 35 | /// 改变指定标签的字体颜色 36 | - (void) setFontColor:(UIColor *) color withTag:(NSString *)tagName; 37 | /// 改变指定标签的字体大小 38 | - (void) setFontSize:(int) size withTag:(NSString *)tagName; 39 | @end 40 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIWebView/UIWebView+Load.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebView+loadURL.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIWebView+Load.h" 10 | 11 | @implementation UIWebView (Load) 12 | /** 13 | * @brief 读取一个网页地址 14 | * 15 | * @param URLString 网页地址 16 | */ 17 | - (void)loadURL:(NSString*)URLString{ 18 | NSString *encodedUrl = (__bridge NSString *) CFURLCreateStringByAddingPercentEscapes (NULL, (__bridge CFStringRef) URLString, NULL, NULL,kCFStringEncodingUTF8); 19 | NSURL *url = [NSURL URLWithString:encodedUrl]; 20 | NSURLRequest *req = [NSURLRequest requestWithURL:url]; 21 | [self loadRequest:req]; 22 | } 23 | /** 24 | * @brief 读取bundle中的webview 25 | * 26 | * @param htmlName webview名称 27 | */ 28 | - (void)loadLocalHtml:(NSString*)htmlName{ 29 | NSString *filePath = [[NSBundle mainBundle]pathForResource:htmlName ofType:@"html"]; 30 | NSURL *url = [NSURL fileURLWithPath:filePath]; 31 | NSURLRequest *request = [NSURLRequest requestWithURL:url]; 32 | [self loadRequest:request]; 33 | } 34 | /** 35 | * @brief 清空cookie 36 | */ 37 | - (void)clearCookies 38 | { 39 | NSHTTPCookieStorage *storage = NSHTTPCookieStorage.sharedHTTPCookieStorage; 40 | 41 | for (NSHTTPCookie *cookie in storage.cookies) 42 | [storage deleteCookie:cookie]; 43 | 44 | [NSUserDefaults.standardUserDefaults synchronize]; 45 | } 46 | @end 47 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIWebView/UIWebView+MetaParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebView+MetaParser.h 3 | // UIWebView+MetaParser 4 | // 5 | // Created by Hirose Tatsuya on 2013/09/15. 6 | // Copyright (c) 2013年 Tatyusa. All rights reserved. 7 | // 8 | /** 9 | * @Author(作者) Hirose Tatsuya 10 | * 11 | * @URL(地址) https://github.com/tatyusa/UIWebView-MetaParser 12 | * 13 | * @Version(版本) 20150620 14 | * 15 | * @Requirements(运行要求) 16 | * 17 | * @Description(描述) UIWebView Category to parse meta tags in HTML. 18 | 19 | * 20 | * @Usage(使用) .. 21 | */ 22 | 23 | 24 | #import 25 | 26 | @interface UIWebView (MetaParser) 27 | /** 28 | * @brief 获取网页meta信息 29 | * 30 | * @return meta信息 31 | */ 32 | -(NSArray *)getMetaData; 33 | @end 34 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIWebView/UIWebView+Style.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebView+style.h 3 | // vw-vip 4 | // 5 | // Created by jakey on 14-3-11. 6 | // Copyright (c) 2014年 zhangkongli. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIWebView (Style) 12 | /** 13 | * @brief 是否显示阴影 14 | * 15 | * @param b 是否显示阴影 16 | */ 17 | - (void)setShadowViewHidden:(BOOL)b; 18 | 19 | /** 20 | * @brief 是否显示水平滑动指示器 21 | * 22 | * @param b 是否显示水平滑动指示器 23 | */ 24 | - (void)setShowsHorizontalScrollIndicator:(BOOL)b; 25 | /** 26 | * @brief 是否显示垂直滑动指示器 27 | * 28 | * @param b 是否显示垂直滑动指示器 29 | */ 30 | - (void)setShowsVerticalScrollIndicator:(BOOL)b; 31 | 32 | /** 33 | * @brief 网页透明 34 | */ 35 | -(void) makeTransparent; 36 | /** 37 | * @brief 网页透明移除+阴影 38 | */ 39 | -(void) makeTransparentAndRemoveShadow; 40 | @end 41 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIWebView/UIWebView+load.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebView+loadURL.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 14/12/15. 6 | // Copyright (c) 2014年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIWebView (Load) 12 | /** 13 | * @brief 读取一个网页地址 14 | * 15 | * @param URLString 网页地址 16 | */ 17 | - (void)loadURL:(NSString*)URLString; 18 | /** 19 | * @brief 读取bundle中的webview 20 | * 21 | * @param htmlName webview名称 22 | */ 23 | - (void)loadLocalHtml:(NSString*)htmlName; 24 | /** 25 | * @brief 清空cookie 26 | */ 27 | - (void)clearCookies; 28 | @end 29 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIWindow/UIWindow+Hierarchy.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+Hierarchy.h 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/16. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIWindow (Hierarchy) 12 | /*! 13 | @method topMostController 14 | 15 | @return Returns the current Top Most ViewController in hierarchy. 16 | */ 17 | - (UIViewController*) topMostController; 18 | 19 | /*! 20 | @method currentViewController 21 | 22 | @return Returns the topViewController in stack of topMostController. 23 | */ 24 | - (UIViewController*)currentViewController; 25 | @end 26 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UIKit/UIWindow/UIWindow+Hierarchy.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWindow+Hierarchy.m 3 | // iOS-Categories (https://github.com/shaojiankui/iOS-Categories) 4 | // 5 | // Created by Jakey on 15/1/16. 6 | // Copyright (c) 2015年 www.skyfox.org. All rights reserved. 7 | // 8 | 9 | #import "UIWindow+Hierarchy.h" 10 | 11 | @implementation UIWindow (Hierarchy) 12 | - (UIViewController*) topMostController 13 | { 14 | UIViewController *topController = [self rootViewController]; 15 | 16 | // Getting topMost ViewController 17 | while ([topController presentedViewController]) topController = [topController presentedViewController]; 18 | 19 | // Returning topMost ViewController 20 | return topController; 21 | } 22 | 23 | - (UIViewController*)currentViewController; 24 | { 25 | UIViewController *currentViewController = [self topMostController]; 26 | 27 | while ([currentViewController isKindOfClass:[UINavigationController class]] && [(UINavigationController*)currentViewController topViewController]) 28 | currentViewController = [(UINavigationController*)currentViewController topViewController]; 29 | 30 | return currentViewController; 31 | } 32 | @end 33 | -------------------------------------------------------------------------------- /MVCProject/Expand/Category/UITabBar/UITabBar+RangeClick.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITabBar+RangeClick.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/20. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | extern NSUInteger const kTabBarBadgeViewDelta; 11 | @interface UITabBar (RangeClick) 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Expand/Const(常量)/ThirdKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // ThirdKey.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/22. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | // 开放平台Key管理 9 | // 10 | 11 | #ifndef ThirdKey_h 12 | #define ThirdKey_h 13 | 14 | /** 微信 */ 15 | static NSString* const WeChatKey_ID=@"" 16 | 17 | /** QQ */ 18 | static NSString* const QQKey_ID=@""; 19 | 20 | #endif /* ThirdKey_h */ 21 | -------------------------------------------------------------------------------- /MVCProject/Main/Base/NavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NavigationController.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/20. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | // Github:https://github.com/JWXIAN/MVCProject 9 | // 10 | 11 | #import 12 | 13 | @interface NavigationController : UINavigationController 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MVCProject/Main/Base/TabBarController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarController.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/20. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | // 9 | // Github:https://github.com/JWXIAN/MVCProject 10 | // 11 | 12 | #import 13 | 14 | @interface TabBarController : UITabBarController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MVCProject/Main/Home/Controller/HomeVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // HomeVC.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/20. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomeVC : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Main/Home/View/HomeCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // HomeCell.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/22. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HomeCell : UITableViewCell 12 | + (instancetype)cellWithTableView:(UITableView *)tableView; 13 | @property (weak, nonatomic) IBOutlet UIImageView *imageV; 14 | @property (weak, nonatomic) IBOutlet UILabel *lblDetail; 15 | @end 16 | -------------------------------------------------------------------------------- /MVCProject/Main/Home/View/HomeCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // HomeCell.m 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/22. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import "HomeCell.h" 10 | 11 | @implementation HomeCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | } 16 | 17 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 18 | [super setSelected:selected animated:animated]; 19 | } 20 | + (instancetype)cellWithTableView:(UITableView *)tableView{ 21 | // 1. 可重用标示符 22 | static NSString *ID = @"HomeCell"; 23 | // 2. tableView查询可重用Cell 24 | HomeCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; 25 | // 3. 如果没有可重用cell 26 | if (cell == nil) { 27 | //4. 从XIB加载自定义视图 28 | cell = [[[NSBundle mainBundle] loadNibNamed:@"HomeCell" owner:nil options:nil] lastObject]; 29 | } 30 | return cell; 31 | } 32 | @end 33 | -------------------------------------------------------------------------------- /MVCProject/Main/UserCenter/Controller/UserCenterVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // UserCenterVC.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/28. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UserCenterVC : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Main/UserCenter/View/UserCenterGiftCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // UserCenterGiftCell.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/28. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UserCenterGiftCell : UITableViewCell 12 | + (instancetype)cellWithTableView:(UITableView *)tableView; 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Main/UserCenter/View/UserCenterGiftCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // UserCenterGiftCell.m 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/28. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import "UserCenterGiftCell.h" 10 | 11 | @implementation UserCenterGiftCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code 16 | } 17 | 18 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 19 | [super setSelected:selected animated:animated]; 20 | 21 | // Configure the view for the selected state 22 | } 23 | + (instancetype)cellWithTableView:(UITableView *)tableView{ 24 | // 1. 可重用标示符 25 | static NSString *ID = @"UserCenterGiftCell"; 26 | // 2. tableView查询可重用Cell 27 | UserCenterGiftCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; 28 | // 3. 如果没有可重用cell 29 | if (cell == nil) { 30 | //4. 从XIB加载自定义视图 31 | cell = [[[NSBundle mainBundle] loadNibNamed:@"UserCenterInfoCell" owner:nil options:nil] objectAtIndex:1]; 32 | } 33 | cell.contentView.alpha = 0.8; 34 | return cell; 35 | } 36 | @end 37 | -------------------------------------------------------------------------------- /MVCProject/Main/UserCenter/View/UserCenterHeadCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // UserCenterHeadCell.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/28. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UserCenterHeadCell : UITableViewCell 12 | + (instancetype)cellWithTableView:(UITableView *)tableView; 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Main/UserCenter/View/UserCenterHeadCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // UserCenterHeadCell.m 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/28. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import "UserCenterHeadCell.h" 10 | @implementation UserCenterHeadCell 11 | 12 | - (void)awakeFromNib { 13 | [super awakeFromNib]; 14 | // Initialization code 15 | } 16 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 17 | [super setSelected:selected animated:animated]; 18 | 19 | // Configure the view for the selected state 20 | } 21 | 22 | + (instancetype)cellWithTableView:(UITableView *)tableView{ 23 | // 1. 可重用标示符 24 | static NSString *ID = @"UserCenterHeadCell"; 25 | // 2. tableView查询可重用Cell 26 | UserCenterHeadCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; 27 | // 3. 如果没有可重用cell 28 | if (cell == nil) { 29 | //4. 从XIB加载自定义视图 30 | cell = [[[NSBundle mainBundle] loadNibNamed:@"UserCenterInfoCell" owner:nil options:nil] objectAtIndex:2]; 31 | } 32 | cell.contentView.alpha = 0.8; 33 | return cell; 34 | } 35 | @end 36 | -------------------------------------------------------------------------------- /MVCProject/Main/UserCenter/View/UserCenterInfoCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // UserCenterInfoCell.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/28. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UserCenterInfoCell : UITableViewCell 12 | + (instancetype)cellWithTableView:(UITableView *)tableView; 13 | @end 14 | -------------------------------------------------------------------------------- /MVCProject/Main/UserCenter/View/UserCenterInfoCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // UserCenterInfoCell.m 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/28. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import "UserCenterInfoCell.h" 10 | 11 | @implementation UserCenterInfoCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | // Initialization code 16 | } 17 | 18 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 19 | [super setSelected:selected animated:animated]; 20 | 21 | // Configure the view for the selected state 22 | } 23 | + (instancetype)cellWithTableView:(UITableView *)tableView{ 24 | // 1. 可重用标示符 25 | static NSString *ID = @"UserCenterInfoCell"; 26 | // 2. tableView查询可重用Cell 27 | UserCenterInfoCell *cell = [tableView dequeueReusableCellWithIdentifier:ID]; 28 | // 3. 如果没有可重用cell 29 | if (cell == nil) { 30 | //4. 从XIB加载自定义视图 31 | cell = [[[NSBundle mainBundle] loadNibNamed:@"UserCenterInfoCell" owner:nil options:nil] objectAtIndex:0]; 32 | } 33 | cell.contentView.alpha = 0.8; 34 | return cell; 35 | } 36 | @end 37 | -------------------------------------------------------------------------------- /MVCProject/Other/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/20. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /MVCProject/Resource/Global(全局)/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/22. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 14 | #import "Macros.h" 15 | #endif /* PrefixHeader_pch */ 16 | -------------------------------------------------------------------------------- /MVCProject/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MVCProject 4 | // 5 | // Created by GJW on 16/7/20. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MVCProjectTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /MVCProjectTests/MVCProjectTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MVCProjectTests.m 3 | // MVCProjectTests 4 | // 5 | // Created by GJW on 16/7/20. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MVCProjectTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MVCProjectTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /MVCProjectUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /MVCProjectUITests/MVCProjectUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // MVCProjectUITests.m 3 | // MVCProjectUITests 4 | // 5 | // Created by GJW on 16/7/20. 6 | // Copyright © 2016年 JW. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MVCProjectUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation MVCProjectUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MVCProject 2 | 3 | MVC的项目框架,并集成一些常用的功能,持续更新添加一些常用功能。 4 | 5 | [![Support](https://img.shields.io/badge/support-iOS%207%2B-brightgreen.svg)](https://github.com/JWXIAN/MVCProject) 6 | [![AppVeyor](https://img.shields.io/appveyor/ci/gruntjs/grunt.svg?maxAge=2592000)](https://github.com/JWXIAN/MVCProject) 7 | [![Bintray](https://img.shields.io/badge/version-1.0-brightgreen.svg)](https://github.com/JWXIAN/MVCProject) 8 | 9 | -- 10 | 项目结构 11 | - 12 | ![image](https://github.com/JWXIAN/MVCProject/blob/master/Image/Structure.png) 13 | 14 | - 15 | 效果图 16 | ------------ 17 | ![image](https://github.com/JWXIAN/MVCProject/blob/master/Image/shot.png) 18 | ![image](https://github.com/JWXIAN/MVCProject/blob/master/Image/a.gif) 19 | --------------------------------------------------------------------------------