diff --git a/LJHY_User.xcodeproj/project.pbxproj b/LJHY_User.xcodeproj/project.pbxproj index fee8871..4613939 100644 --- a/LJHY_User.xcodeproj/project.pbxproj +++ b/LJHY_User.xcodeproj/project.pbxproj @@ -8,32 +8,96 @@ /* Begin PBXBuildFile section */ 410E8A32C41C90A4E3BFAA07 /* Pods_LJHY_UserUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C9A09D7F84D049B7346FF0D /* Pods_LJHY_UserUITests.framework */; }; - 88E155731E45CBAB00DC334F /* LJDoctorRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E155721E45CBAB00DC334F /* LJDoctorRequest.m */; }; - 88E155751E45D31400DC334F /* Foundation+Log.m in Sources */ = {isa = PBXBuildFile; fileRef = 88E155741E45D31400DC334F /* Foundation+Log.m */; }; 8EBAC7E1FB2645DC0A1B93F1 /* Pods_LJHY_User.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 38257023F222C3926B7CF067 /* Pods_LJHY_User.framework */; }; 9BC1D8A977CC0A02AE8D5340 /* Pods_LJHY_UserTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BE679A193E256B42498A794C /* Pods_LJHY_UserTests.framework */; }; - DA0EA93C1DFE7BAC00E011B4 /* UIImage+LJColor.m in Sources */ = {isa = PBXBuildFile; fileRef = DA0EA93B1DFE7BAC00E011B4 /* UIImage+LJColor.m */; }; - DA0EA93F1DFF90CC00E011B4 /* LJTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DA0EA93E1DFF90CC00E011B4 /* LJTableViewCell.m */; }; - DA31C4011E14CAFA009A7116 /* CTMediator+LJMediatorHomeActions.m in Sources */ = {isa = PBXBuildFile; fileRef = DA31C4001E14CAFA009A7116 /* CTMediator+LJMediatorHomeActions.m */; }; - DA31C4041E14CCFE009A7116 /* Target_Home.m in Sources */ = {isa = PBXBuildFile; fileRef = DA31C4031E14CCFE009A7116 /* Target_Home.m */; }; - DA74C2241DFA53F700F6F28B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C2231DFA53F700F6F28B /* main.m */; }; - DA74C2271DFA53F700F6F28B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C2261DFA53F700F6F28B /* AppDelegate.m */; }; - DA74C22F1DFA53F700F6F28B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DA74C22E1DFA53F700F6F28B /* Assets.xcassets */; }; DA74C23D1DFA53F700F6F28B /* LJHY_UserTests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C23C1DFA53F700F6F28B /* LJHY_UserTests.m */; }; DA74C2481DFA53F700F6F28B /* LJHY_UserUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C2471DFA53F700F6F28B /* LJHY_UserUITests.m */; }; - DA74C2571DFA556400F6F28B /* LJNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C2561DFA556400F6F28B /* LJNavigationController.m */; }; - DA74C25A1DFA559600F6F28B /* LJTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C2591DFA559600F6F28B /* LJTabBarController.m */; }; - DA74C25D1DFA55B600F6F28B /* LJBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C25C1DFA55B600F6F28B /* LJBaseViewController.m */; }; - DA74C2601DFA55C700F6F28B /* LJHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C25F1DFA55C700F6F28B /* LJHomeViewController.m */; }; - DA74C2631DFA603800F6F28B /* LJDoctorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C2621DFA603800F6F28B /* LJDoctorViewController.m */; }; - DA74C2661DFA604100F6F28B /* LJServiceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C2651DFA604100F6F28B /* LJServiceViewController.m */; }; - DA74C2691DFA605800F6F28B /* LJPersonalViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C2681DFA605800F6F28B /* LJPersonalViewController.m */; }; - DA74C26C1DFA950200F6F28B /* LJBaseRootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C26B1DFA950200F6F28B /* LJBaseRootViewController.m */; }; - DA74C26F1DFA951300F6F28B /* LJBaseSubViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C26E1DFA951300F6F28B /* LJBaseSubViewController.m */; }; - DA74C2791DFA96D700F6F28B /* LJView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C2781DFA96D700F6F28B /* LJView.m */; }; - DA74C27C1DFA96E400F6F28B /* LJButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C27B1DFA96E400F6F28B /* LJButton.m */; }; - DA74C27F1DFA96F000F6F28B /* LJLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C27E1DFA96F000F6F28B /* LJLabel.m */; }; - DA74C2821DFA970700F6F28B /* LJImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = DA74C2811DFA970700F6F28B /* LJImageView.m */; }; + DD1E554F1ED431E1007DBBEF /* AgreeButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DD1E554E1ED431E1007DBBEF /* AgreeButton.m */; }; + DD2D00671ECAD69800C21A3C /* LJBaseRootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00371ECAD69800C21A3C /* LJBaseRootViewController.m */; }; + DD2D00681ECAD69800C21A3C /* LJBaseSubViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00391ECAD69800C21A3C /* LJBaseSubViewController.m */; }; + DD2D00691ECAD69800C21A3C /* LJBaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D003B1ECAD69800C21A3C /* LJBaseViewController.m */; }; + DD2D006A1ECAD69800C21A3C /* LJButton.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D003E1ECAD69800C21A3C /* LJButton.m */; }; + DD2D006B1ECAD69800C21A3C /* LJImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00401ECAD69800C21A3C /* LJImageView.m */; }; + DD2D006C1ECAD69800C21A3C /* LJLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00421ECAD69800C21A3C /* LJLabel.m */; }; + DD2D006D1ECAD69800C21A3C /* LJTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00441ECAD69800C21A3C /* LJTableViewCell.m */; }; + DD2D006E1ECAD69800C21A3C /* LJView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00461ECAD69800C21A3C /* LJView.m */; }; + DD2D006F1ECAD69800C21A3C /* LJNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00491ECAD69800C21A3C /* LJNavigationController.m */; }; + DD2D00701ECAD69800C21A3C /* LJTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D004B1ECAD69800C21A3C /* LJTabBarController.m */; }; + DD2D00711ECAD69800C21A3C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D004E1ECAD69800C21A3C /* AppDelegate.m */; }; + DD2D00721ECAD69800C21A3C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DD2D004F1ECAD69800C21A3C /* Assets.xcassets */; }; + DD2D00731ECAD69800C21A3C /* Foundation+Log.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00501ECAD69800C21A3C /* Foundation+Log.m */; }; + DD2D00741ECAD69800C21A3C /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DD2D00511ECAD69800C21A3C /* Info.plist */; }; + DD2D00751ECAD69800C21A3C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00531ECAD69800C21A3C /* main.m */; }; + DD2D00761ECAD69800C21A3C /* LJDoctorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00571ECAD69800C21A3C /* LJDoctorViewController.m */; }; + DD2D00771ECAD69800C21A3C /* CTMediator+LJMediatorHomeActions.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D005A1ECAD69800C21A3C /* CTMediator+LJMediatorHomeActions.m */; }; + DD2D00781ECAD69800C21A3C /* LJDoctorRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D005C1ECAD69800C21A3C /* LJDoctorRequest.m */; }; + DD2D00791ECAD69800C21A3C /* LJHomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D005E1ECAD69800C21A3C /* LJHomeViewController.m */; }; + DD2D007A1ECAD69800C21A3C /* Target_Home.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00601ECAD69800C21A3C /* Target_Home.m */; }; + DD2D007B1ECAD69800C21A3C /* LJPersonalViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00631ECAD69800C21A3C /* LJPersonalViewController.m */; }; + DD2D007C1ECAD69800C21A3C /* LJServiceViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD2D00661ECAD69800C21A3C /* LJServiceViewController.m */; }; + DD6A412D1ECAAA3400D42E93 /* NSArray+Log.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A410F1ECAAA3400D42E93 /* NSArray+Log.m */; }; + DD6A412E1ECAAA3400D42E93 /* NSDate+Helper.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41111ECAAA3400D42E93 /* NSDate+Helper.m */; }; + DD6A412F1ECAAA3400D42E93 /* NSString+call.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41131ECAAA3400D42E93 /* NSString+call.m */; }; + DD6A41301ECAAA3400D42E93 /* NSString+checkTeleNumber.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41151ECAAA3400D42E93 /* NSString+checkTeleNumber.m */; }; + DD6A41311ECAAA3400D42E93 /* NSString+Hash.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41171ECAAA3400D42E93 /* NSString+Hash.m */; }; + DD6A41321ECAAA3400D42E93 /* NSString+timeStamp.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41191ECAAA3400D42E93 /* NSString+timeStamp.m */; }; + DD6A41331ECAAA3400D42E93 /* NSString+Valid.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A411B1ECAAA3400D42E93 /* NSString+Valid.m */; }; + DD6A41341ECAAA3400D42E93 /* UIImage+cutCircleImage.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A411D1ECAAA3400D42E93 /* UIImage+cutCircleImage.m */; }; + DD6A41351ECAAA3400D42E93 /* UIImage+Help.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A411F1ECAAA3400D42E93 /* UIImage+Help.m */; }; + DD6A41361ECAAA3400D42E93 /* UIImage+ImageWithColor.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41211ECAAA3400D42E93 /* UIImage+ImageWithColor.m */; }; + DD6A41371ECAAA3400D42E93 /* UIImage+LJColor.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41231ECAAA3400D42E93 /* UIImage+LJColor.m */; }; + DD6A41381ECAAA3400D42E93 /* UIResponder+Router.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41251ECAAA3400D42E93 /* UIResponder+Router.m */; }; + DD6A41391ECAAA3400D42E93 /* UIScrollView+UITouch.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41271ECAAA3400D42E93 /* UIScrollView+UITouch.m */; }; + DD6A413A1ECAAA3400D42E93 /* UIView+font.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41291ECAAA3400D42E93 /* UIView+font.m */; }; + DD6A413B1ECAAA3400D42E93 /* UIView+ParentController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A412B1ECAAA3400D42E93 /* UIView+ParentController.m */; }; + DD6A41DD1ECAAB4C00D42E93 /* ImageCacheSize.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A415C1ECAAB4C00D42E93 /* ImageCacheSize.m */; }; + DD6A41DE1ECAAB4C00D42E93 /* KZAreaM.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A415F1ECAAB4C00D42E93 /* KZAreaM.m */; }; + DD6A41DF1ECAAB4C00D42E93 /* KZAreaVC.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41611ECAAB4C00D42E93 /* KZAreaVC.m */; }; + DD6A41E01ECAAB4C00D42E93 /* KZChoseAreaTool.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41631ECAAB4C00D42E93 /* KZChoseAreaTool.m */; }; + DD6A41E11ECAAB4C00D42E93 /* zyb.db in Resources */ = {isa = PBXBuildFile; fileRef = DD6A41641ECAAB4C00D42E93 /* zyb.db */; }; + DD6A41EC1ECAAB4C00D42E93 /* DLLRUCache.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41861ECAAB4C00D42E93 /* DLLRUCache.m */; }; + DD6A41ED1ECAAB4C00D42E93 /* DLCustomSlideView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41881ECAAB4C00D42E93 /* DLCustomSlideView.m */; }; + DD6A41EE1ECAAB4C00D42E93 /* DLSlideView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A418A1ECAAB4C00D42E93 /* DLSlideView.m */; }; + DD6A41EF1ECAAB4C00D42E93 /* DLFixedTabbarView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A418D1ECAAB4C00D42E93 /* DLFixedTabbarView.m */; }; + DD6A41F01ECAAB4C00D42E93 /* DLScrollTabbarView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A418F1ECAAB4C00D42E93 /* DLScrollTabbarView.m */; }; + DD6A41F11ECAAB4C00D42E93 /* DlTabedSlideView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41921ECAAB4C00D42E93 /* DlTabedSlideView.m */; }; + DD6A41F21ECAAB4C00D42E93 /* DLUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41941ECAAB4C00D42E93 /* DLUtility.m */; }; + DD6A41F31ECAAB4C00D42E93 /* EMAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41971ECAAB4C00D42E93 /* EMAlertView.m */; }; + DD6A41F41ECAAB4C00D42E93 /* AppCurrentControllerTool.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A419A1ECAAB4C00D42E93 /* AppCurrentControllerTool.m */; }; + DD6A41F51ECAAB4C00D42E93 /* UIViewController+countDown.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A419E1ECAAB4C00D42E93 /* UIViewController+countDown.m */; }; + DD6A41F61ECAAB4C00D42E93 /* KxMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41A31ECAAB4C00D42E93 /* KxMenu.m */; }; + DD6A41F71ECAAB4C00D42E93 /* LimitTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41A61ECAAB4C00D42E93 /* LimitTextField.m */; }; + DD6A41F81ECAAB4C00D42E93 /* PJTernarySearchTree.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41AD1ECAAB4C00D42E93 /* PJTernarySearchTree.m */; }; + DD6A41F91ECAAB4C00D42E93 /* PlaceholderTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41B01ECAAB4C00D42E93 /* PlaceholderTextView.m */; }; + DD6A42001ECAAB4C00D42E93 /* NSCalendar+ST.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41C11ECAAB4C00D42E93 /* NSCalendar+ST.m */; }; + DD6A42011ECAAB4C00D42E93 /* STPickerDate.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41C31ECAAB4C00D42E93 /* STPickerDate.m */; }; + DD6A42021ECAAB4C00D42E93 /* STPickerSingle.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41C61ECAAB4C00D42E93 /* STPickerSingle.m */; }; + DD6A42031ECAAB4C00D42E93 /* STConst.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41CA1ECAAB4C00D42E93 /* STConst.m */; }; + DD6A42041ECAAB4C00D42E93 /* STUI.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41CC1ECAAB4C00D42E93 /* STUI.m */; }; + DD6A42051ECAAB4C00D42E93 /* UIView+ST.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41CE1ECAAB4C00D42E93 /* UIView+ST.m */; }; + DD6A42061ECAAB4C00D42E93 /* STPickerView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41D01ECAAB4C00D42E93 /* STPickerView.m */; }; + DD6A42071ECAAB4C00D42E93 /* KZPortaitView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41D31ECAAB4C00D42E93 /* KZPortaitView.m */; }; + DD6A42081ECAAB4C00D42E93 /* UIImageView+KJ.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41D51ECAAB4C00D42E93 /* UIImageView+KJ.m */; }; + DD6A42091ECAAB4C00D42E93 /* VPImageCropperViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41D71ECAAB4C00D42E93 /* VPImageCropperViewController.m */; }; + DD6A420A1ECAAB4C00D42E93 /* VPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41D91ECAAB4C00D42E93 /* VPViewController.m */; }; + DD6A420B1ECAAB4C00D42E93 /* ZoomImage.m in Sources */ = {isa = PBXBuildFile; fileRef = DD6A41DC1ECAAB4C00D42E93 /* ZoomImage.m */; }; + DDEE57251ED569C600F237C4 /* dailylog_fabulous_selected@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DDEE57211ED569C600F237C4 /* dailylog_fabulous_selected@2x.png */; }; + DDEE57261ED569C600F237C4 /* dailylog_fabulous_selected@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DDEE57221ED569C600F237C4 /* dailylog_fabulous_selected@3x.png */; }; + DDEE57271ED569C600F237C4 /* dailylog_fabulous@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DDEE57231ED569C600F237C4 /* dailylog_fabulous@2x.png */; }; + DDEE57281ED569C600F237C4 /* dailylog_fabulous@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DDEE57241ED569C600F237C4 /* dailylog_fabulous@3x.png */; }; + DDFC91C31ECC40A3002AFA6F /* UIImage+ResizeImage.m in Sources */ = {isa = PBXBuildFile; fileRef = DDFC91C21ECC40A3002AFA6F /* UIImage+ResizeImage.m */; }; + DDFC91E81ECD29BE002AFA6F /* Common.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91D91ECD29BE002AFA6F /* Common.xcconfig */; }; + DDFC91E91ECD29BF002AFA6F /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91DB1ECD29BE002AFA6F /* Debug.xcconfig */; }; + DDFC91EA1ECD29BF002AFA6F /* Profile.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91DC1ECD29BE002AFA6F /* Profile.xcconfig */; }; + DDFC91EB1ECD29BF002AFA6F /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91DD1ECD29BE002AFA6F /* Release.xcconfig */; }; + DDFC91EC1ECD29BF002AFA6F /* Test.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91DE1ECD29BE002AFA6F /* Test.xcconfig */; }; + DDFC91ED1ECD29BF002AFA6F /* Application.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91E01ECD29BE002AFA6F /* Application.xcconfig */; }; + DDFC91EE1ECD29BF002AFA6F /* Framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91E11ECD29BE002AFA6F /* Framework.xcconfig */; }; + DDFC91EF1ECD29BF002AFA6F /* StaticLibrary.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91E21ECD29BE002AFA6F /* StaticLibrary.xcconfig */; }; + DDFC91F01ECD29BF002AFA6F /* iOS-Application.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91E41ECD29BE002AFA6F /* iOS-Application.xcconfig */; }; + DDFC91F11ECD29BF002AFA6F /* iOS-Base.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91E51ECD29BE002AFA6F /* iOS-Base.xcconfig */; }; + DDFC91F21ECD29BF002AFA6F /* iOS-Framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91E61ECD29BE002AFA6F /* iOS-Framework.xcconfig */; }; + DDFC91F31ECD29BF002AFA6F /* iOS-StaticLibrary.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DDFC91E71ECD29BE002AFA6F /* iOS-StaticLibrary.xcconfig */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -59,59 +123,172 @@ 38257023F222C3926B7CF067 /* Pods_LJHY_User.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LJHY_User.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 45B49A0322FDB7E6F1316799 /* Pods-LJHY_UserTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LJHY_UserTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-LJHY_UserTests/Pods-LJHY_UserTests.release.xcconfig"; sourceTree = ""; }; 5C9A09D7F84D049B7346FF0D /* Pods_LJHY_UserUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LJHY_UserUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 88E155711E45CBAB00DC334F /* LJDoctorRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJDoctorRequest.h; sourceTree = ""; }; - 88E155721E45CBAB00DC334F /* LJDoctorRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJDoctorRequest.m; sourceTree = ""; }; - 88E155741E45D31400DC334F /* Foundation+Log.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Foundation+Log.m"; sourceTree = ""; }; A8FD70A0E29C09FD2BABC762 /* Pods-LJHY_UserUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LJHY_UserUITests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LJHY_UserUITests/Pods-LJHY_UserUITests.debug.xcconfig"; sourceTree = ""; }; BE679A193E256B42498A794C /* Pods_LJHY_UserTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LJHY_UserTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C10F3C374053DBEB0C9EA65D /* Pods-LJHY_User.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LJHY_User.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LJHY_User/Pods-LJHY_User.debug.xcconfig"; sourceTree = ""; }; - DA0EA93A1DFE7BAC00E011B4 /* UIImage+LJColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+LJColor.h"; sourceTree = ""; }; - DA0EA93B1DFE7BAC00E011B4 /* UIImage+LJColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+LJColor.m"; sourceTree = ""; }; - DA0EA93D1DFF90CC00E011B4 /* LJTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJTableViewCell.h; sourceTree = ""; }; - DA0EA93E1DFF90CC00E011B4 /* LJTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJTableViewCell.m; sourceTree = ""; }; - DA31C3FF1E14CAFA009A7116 /* CTMediator+LJMediatorHomeActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CTMediator+LJMediatorHomeActions.h"; sourceTree = ""; }; - DA31C4001E14CAFA009A7116 /* CTMediator+LJMediatorHomeActions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CTMediator+LJMediatorHomeActions.m"; sourceTree = ""; }; - DA31C4021E14CCFE009A7116 /* Target_Home.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Target_Home.h; sourceTree = ""; }; - DA31C4031E14CCFE009A7116 /* Target_Home.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Target_Home.m; sourceTree = ""; }; - DA74C21F1DFA53F700F6F28B /* LJHY_User.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LJHY_User.app; sourceTree = BUILT_PRODUCTS_DIR; }; - DA74C2231DFA53F700F6F28B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - DA74C2251DFA53F700F6F28B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - DA74C2261DFA53F700F6F28B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - DA74C22E1DFA53F700F6F28B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - DA74C2331DFA53F700F6F28B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DA74C21F1DFA53F700F6F28B /* 模版app debug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "模版app debug.app"; sourceTree = BUILT_PRODUCTS_DIR; }; DA74C2381DFA53F700F6F28B /* LJHY_UserTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LJHY_UserTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; DA74C23C1DFA53F700F6F28B /* LJHY_UserTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LJHY_UserTests.m; sourceTree = ""; }; DA74C23E1DFA53F700F6F28B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DA74C2431DFA53F700F6F28B /* LJHY_UserUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LJHY_UserUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; DA74C2471DFA53F700F6F28B /* LJHY_UserUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LJHY_UserUITests.m; sourceTree = ""; }; DA74C2491DFA53F700F6F28B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - DA74C2551DFA556400F6F28B /* LJNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJNavigationController.h; sourceTree = ""; }; - DA74C2561DFA556400F6F28B /* LJNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJNavigationController.m; sourceTree = ""; }; - DA74C2581DFA559600F6F28B /* LJTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJTabBarController.h; sourceTree = ""; }; - DA74C2591DFA559600F6F28B /* LJTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJTabBarController.m; sourceTree = ""; }; - DA74C25B1DFA55B600F6F28B /* LJBaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJBaseViewController.h; sourceTree = ""; }; - DA74C25C1DFA55B600F6F28B /* LJBaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJBaseViewController.m; sourceTree = ""; }; - DA74C25E1DFA55C700F6F28B /* LJHomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJHomeViewController.h; sourceTree = ""; }; - DA74C25F1DFA55C700F6F28B /* LJHomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJHomeViewController.m; sourceTree = ""; }; - DA74C2611DFA603800F6F28B /* LJDoctorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJDoctorViewController.h; sourceTree = ""; }; - DA74C2621DFA603800F6F28B /* LJDoctorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJDoctorViewController.m; sourceTree = ""; }; - DA74C2641DFA604100F6F28B /* LJServiceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJServiceViewController.h; sourceTree = ""; }; - DA74C2651DFA604100F6F28B /* LJServiceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJServiceViewController.m; sourceTree = ""; }; - DA74C2671DFA605800F6F28B /* LJPersonalViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJPersonalViewController.h; sourceTree = ""; }; - DA74C2681DFA605800F6F28B /* LJPersonalViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJPersonalViewController.m; sourceTree = ""; }; - DA74C26A1DFA950200F6F28B /* LJBaseRootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJBaseRootViewController.h; sourceTree = ""; }; - DA74C26B1DFA950200F6F28B /* LJBaseRootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJBaseRootViewController.m; sourceTree = ""; }; - DA74C26D1DFA951300F6F28B /* LJBaseSubViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJBaseSubViewController.h; sourceTree = ""; }; - DA74C26E1DFA951300F6F28B /* LJBaseSubViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJBaseSubViewController.m; sourceTree = ""; }; - DA74C2771DFA96D700F6F28B /* LJView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJView.h; sourceTree = ""; }; - DA74C2781DFA96D700F6F28B /* LJView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJView.m; sourceTree = ""; }; - DA74C27A1DFA96E400F6F28B /* LJButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJButton.h; sourceTree = ""; }; - DA74C27B1DFA96E400F6F28B /* LJButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJButton.m; sourceTree = ""; }; - DA74C27D1DFA96F000F6F28B /* LJLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJLabel.h; sourceTree = ""; }; - DA74C27E1DFA96F000F6F28B /* LJLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJLabel.m; sourceTree = ""; }; - DA74C2801DFA970700F6F28B /* LJImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJImageView.h; sourceTree = ""; }; - DA74C2811DFA970700F6F28B /* LJImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJImageView.m; sourceTree = ""; }; - DA74C2831DFA97F100F6F28B /* LJHYUser-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "LJHYUser-Prefix.pch"; sourceTree = ""; }; + DD1E554D1ED431E1007DBBEF /* AgreeButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AgreeButton.h; sourceTree = ""; }; + DD1E554E1ED431E1007DBBEF /* AgreeButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AgreeButton.m; sourceTree = ""; }; + DD2D00361ECAD69800C21A3C /* LJBaseRootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJBaseRootViewController.h; sourceTree = ""; }; + DD2D00371ECAD69800C21A3C /* LJBaseRootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJBaseRootViewController.m; sourceTree = ""; }; + DD2D00381ECAD69800C21A3C /* LJBaseSubViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJBaseSubViewController.h; sourceTree = ""; }; + DD2D00391ECAD69800C21A3C /* LJBaseSubViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJBaseSubViewController.m; sourceTree = ""; }; + DD2D003A1ECAD69800C21A3C /* LJBaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJBaseViewController.h; sourceTree = ""; }; + DD2D003B1ECAD69800C21A3C /* LJBaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJBaseViewController.m; sourceTree = ""; }; + DD2D003D1ECAD69800C21A3C /* LJButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJButton.h; sourceTree = ""; }; + DD2D003E1ECAD69800C21A3C /* LJButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJButton.m; sourceTree = ""; }; + DD2D003F1ECAD69800C21A3C /* LJImageView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJImageView.h; sourceTree = ""; }; + DD2D00401ECAD69800C21A3C /* LJImageView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJImageView.m; sourceTree = ""; }; + DD2D00411ECAD69800C21A3C /* LJLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJLabel.h; sourceTree = ""; }; + DD2D00421ECAD69800C21A3C /* LJLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJLabel.m; sourceTree = ""; }; + DD2D00431ECAD69800C21A3C /* LJTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJTableViewCell.h; sourceTree = ""; }; + DD2D00441ECAD69800C21A3C /* LJTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJTableViewCell.m; sourceTree = ""; }; + DD2D00451ECAD69800C21A3C /* LJView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJView.h; sourceTree = ""; }; + DD2D00461ECAD69800C21A3C /* LJView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJView.m; sourceTree = ""; }; + DD2D00481ECAD69800C21A3C /* LJNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJNavigationController.h; sourceTree = ""; }; + DD2D00491ECAD69800C21A3C /* LJNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJNavigationController.m; sourceTree = ""; }; + DD2D004A1ECAD69800C21A3C /* LJTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJTabBarController.h; sourceTree = ""; }; + DD2D004B1ECAD69800C21A3C /* LJTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJTabBarController.m; sourceTree = ""; }; + DD2D004D1ECAD69800C21A3C /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + DD2D004E1ECAD69800C21A3C /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + DD2D004F1ECAD69800C21A3C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + DD2D00501ECAD69800C21A3C /* Foundation+Log.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Foundation+Log.m"; sourceTree = ""; }; + DD2D00511ECAD69800C21A3C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DD2D00521ECAD69800C21A3C /* LJHYUser-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "LJHYUser-Prefix.pch"; sourceTree = ""; }; + DD2D00531ECAD69800C21A3C /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + DD2D00561ECAD69800C21A3C /* LJDoctorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJDoctorViewController.h; sourceTree = ""; }; + DD2D00571ECAD69800C21A3C /* LJDoctorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJDoctorViewController.m; sourceTree = ""; }; + DD2D00591ECAD69800C21A3C /* CTMediator+LJMediatorHomeActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "CTMediator+LJMediatorHomeActions.h"; sourceTree = ""; }; + DD2D005A1ECAD69800C21A3C /* CTMediator+LJMediatorHomeActions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "CTMediator+LJMediatorHomeActions.m"; sourceTree = ""; }; + DD2D005B1ECAD69800C21A3C /* LJDoctorRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJDoctorRequest.h; sourceTree = ""; }; + DD2D005C1ECAD69800C21A3C /* LJDoctorRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJDoctorRequest.m; sourceTree = ""; }; + DD2D005D1ECAD69800C21A3C /* LJHomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJHomeViewController.h; sourceTree = ""; }; + DD2D005E1ECAD69800C21A3C /* LJHomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJHomeViewController.m; sourceTree = ""; }; + DD2D005F1ECAD69800C21A3C /* Target_Home.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Target_Home.h; sourceTree = ""; }; + DD2D00601ECAD69800C21A3C /* Target_Home.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Target_Home.m; sourceTree = ""; }; + DD2D00621ECAD69800C21A3C /* LJPersonalViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJPersonalViewController.h; sourceTree = ""; }; + DD2D00631ECAD69800C21A3C /* LJPersonalViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJPersonalViewController.m; sourceTree = ""; }; + DD2D00651ECAD69800C21A3C /* LJServiceViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LJServiceViewController.h; sourceTree = ""; }; + DD2D00661ECAD69800C21A3C /* LJServiceViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LJServiceViewController.m; sourceTree = ""; }; + DD6A410E1ECAAA3400D42E93 /* NSArray+Log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Log.h"; sourceTree = ""; }; + DD6A410F1ECAAA3400D42E93 /* NSArray+Log.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSArray+Log.m"; sourceTree = ""; }; + DD6A41101ECAAA3400D42E93 /* NSDate+Helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+Helper.h"; sourceTree = ""; }; + DD6A41111ECAAA3400D42E93 /* NSDate+Helper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+Helper.m"; sourceTree = ""; }; + DD6A41121ECAAA3400D42E93 /* NSString+call.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+call.h"; sourceTree = ""; }; + DD6A41131ECAAA3400D42E93 /* NSString+call.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+call.m"; sourceTree = ""; }; + DD6A41141ECAAA3400D42E93 /* NSString+checkTeleNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+checkTeleNumber.h"; sourceTree = ""; }; + DD6A41151ECAAA3400D42E93 /* NSString+checkTeleNumber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+checkTeleNumber.m"; sourceTree = ""; }; + DD6A41161ECAAA3400D42E93 /* NSString+Hash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Hash.h"; sourceTree = ""; }; + DD6A41171ECAAA3400D42E93 /* NSString+Hash.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Hash.m"; sourceTree = ""; }; + DD6A41181ECAAA3400D42E93 /* NSString+timeStamp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+timeStamp.h"; sourceTree = ""; }; + DD6A41191ECAAA3400D42E93 /* NSString+timeStamp.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+timeStamp.m"; sourceTree = ""; }; + DD6A411A1ECAAA3400D42E93 /* NSString+Valid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+Valid.h"; sourceTree = ""; }; + DD6A411B1ECAAA3400D42E93 /* NSString+Valid.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+Valid.m"; sourceTree = ""; }; + DD6A411C1ECAAA3400D42E93 /* UIImage+cutCircleImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+cutCircleImage.h"; sourceTree = ""; }; + DD6A411D1ECAAA3400D42E93 /* UIImage+cutCircleImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+cutCircleImage.m"; sourceTree = ""; }; + DD6A411E1ECAAA3400D42E93 /* UIImage+Help.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+Help.h"; sourceTree = ""; }; + DD6A411F1ECAAA3400D42E93 /* UIImage+Help.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Help.m"; sourceTree = ""; }; + DD6A41201ECAAA3400D42E93 /* UIImage+ImageWithColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ImageWithColor.h"; sourceTree = ""; }; + DD6A41211ECAAA3400D42E93 /* UIImage+ImageWithColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ImageWithColor.m"; sourceTree = ""; }; + DD6A41221ECAAA3400D42E93 /* UIImage+LJColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+LJColor.h"; sourceTree = ""; }; + DD6A41231ECAAA3400D42E93 /* UIImage+LJColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+LJColor.m"; sourceTree = ""; }; + DD6A41241ECAAA3400D42E93 /* UIResponder+Router.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIResponder+Router.h"; sourceTree = ""; }; + DD6A41251ECAAA3400D42E93 /* UIResponder+Router.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIResponder+Router.m"; sourceTree = ""; }; + DD6A41261ECAAA3400D42E93 /* UIScrollView+UITouch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIScrollView+UITouch.h"; sourceTree = ""; }; + DD6A41271ECAAA3400D42E93 /* UIScrollView+UITouch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIScrollView+UITouch.m"; sourceTree = ""; }; + DD6A41281ECAAA3400D42E93 /* UIView+font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+font.h"; sourceTree = ""; }; + DD6A41291ECAAA3400D42E93 /* UIView+font.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+font.m"; sourceTree = ""; }; + DD6A412A1ECAAA3400D42E93 /* UIView+ParentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+ParentController.h"; sourceTree = ""; }; + DD6A412B1ECAAA3400D42E93 /* UIView+ParentController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+ParentController.m"; sourceTree = ""; }; + DD6A412C1ECAAA3400D42E93 /* UIViewController+CurrentVCLogging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+CurrentVCLogging.h"; sourceTree = ""; }; + DD6A415B1ECAAB4C00D42E93 /* ImageCacheSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageCacheSize.h; sourceTree = ""; }; + DD6A415C1ECAAB4C00D42E93 /* ImageCacheSize.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageCacheSize.m; sourceTree = ""; }; + DD6A415E1ECAAB4C00D42E93 /* KZAreaM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KZAreaM.h; sourceTree = ""; }; + DD6A415F1ECAAB4C00D42E93 /* KZAreaM.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KZAreaM.m; sourceTree = ""; }; + DD6A41601ECAAB4C00D42E93 /* KZAreaVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KZAreaVC.h; sourceTree = ""; }; + DD6A41611ECAAB4C00D42E93 /* KZAreaVC.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KZAreaVC.m; sourceTree = ""; }; + DD6A41621ECAAB4C00D42E93 /* KZChoseAreaTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KZChoseAreaTool.h; sourceTree = ""; }; + DD6A41631ECAAB4C00D42E93 /* KZChoseAreaTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KZChoseAreaTool.m; sourceTree = ""; }; + DD6A41641ECAAB4C00D42E93 /* zyb.db */ = {isa = PBXFileReference; lastKnownFileType = file; path = zyb.db; sourceTree = ""; }; + DD6A41841ECAAB4C00D42E93 /* DLCacheProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLCacheProtocol.h; sourceTree = ""; }; + DD6A41851ECAAB4C00D42E93 /* DLLRUCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLLRUCache.h; sourceTree = ""; }; + DD6A41861ECAAB4C00D42E93 /* DLLRUCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLLRUCache.m; sourceTree = ""; }; + DD6A41871ECAAB4C00D42E93 /* DLCustomSlideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLCustomSlideView.h; sourceTree = ""; }; + DD6A41881ECAAB4C00D42E93 /* DLCustomSlideView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLCustomSlideView.m; sourceTree = ""; }; + DD6A41891ECAAB4C00D42E93 /* DLSlideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLSlideView.h; sourceTree = ""; }; + DD6A418A1ECAAB4C00D42E93 /* DLSlideView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLSlideView.m; sourceTree = ""; }; + DD6A418C1ECAAB4C00D42E93 /* DLFixedTabbarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLFixedTabbarView.h; sourceTree = ""; }; + DD6A418D1ECAAB4C00D42E93 /* DLFixedTabbarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLFixedTabbarView.m; sourceTree = ""; }; + DD6A418E1ECAAB4C00D42E93 /* DLScrollTabbarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLScrollTabbarView.h; sourceTree = ""; }; + DD6A418F1ECAAB4C00D42E93 /* DLScrollTabbarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLScrollTabbarView.m; sourceTree = ""; }; + DD6A41901ECAAB4C00D42E93 /* DLSlideTabbarProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLSlideTabbarProtocol.h; sourceTree = ""; }; + DD6A41911ECAAB4C00D42E93 /* DlTabedSlideView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DlTabedSlideView.h; sourceTree = ""; }; + DD6A41921ECAAB4C00D42E93 /* DlTabedSlideView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DlTabedSlideView.m; sourceTree = ""; }; + DD6A41931ECAAB4C00D42E93 /* DLUtility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLUtility.h; sourceTree = ""; }; + DD6A41941ECAAB4C00D42E93 /* DLUtility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLUtility.m; sourceTree = ""; }; + DD6A41961ECAAB4C00D42E93 /* EMAlertView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EMAlertView.h; sourceTree = ""; }; + DD6A41971ECAAB4C00D42E93 /* EMAlertView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EMAlertView.m; sourceTree = ""; }; + DD6A41991ECAAB4C00D42E93 /* AppCurrentControllerTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppCurrentControllerTool.h; sourceTree = ""; }; + DD6A419A1ECAAB4C00D42E93 /* AppCurrentControllerTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppCurrentControllerTool.m; sourceTree = ""; }; + DD6A419D1ECAAB4C00D42E93 /* UIViewController+countDown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIViewController+countDown.h"; sourceTree = ""; }; + DD6A419E1ECAAB4C00D42E93 /* UIViewController+countDown.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIViewController+countDown.m"; sourceTree = ""; }; + DD6A41A21ECAAB4C00D42E93 /* KxMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KxMenu.h; sourceTree = ""; }; + DD6A41A31ECAAB4C00D42E93 /* KxMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KxMenu.m; sourceTree = ""; }; + DD6A41A51ECAAB4C00D42E93 /* LimitTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LimitTextField.h; sourceTree = ""; }; + DD6A41A61ECAAB4C00D42E93 /* LimitTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LimitTextField.m; sourceTree = ""; }; + DD6A41AC1ECAAB4C00D42E93 /* PJTernarySearchTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PJTernarySearchTree.h; sourceTree = ""; }; + DD6A41AD1ECAAB4C00D42E93 /* PJTernarySearchTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PJTernarySearchTree.m; sourceTree = ""; }; + DD6A41AF1ECAAB4C00D42E93 /* PlaceholderTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaceholderTextView.h; sourceTree = ""; }; + DD6A41B01ECAAB4C00D42E93 /* PlaceholderTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PlaceholderTextView.m; sourceTree = ""; }; + DD6A41C01ECAAB4C00D42E93 /* NSCalendar+ST.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSCalendar+ST.h"; sourceTree = ""; }; + DD6A41C11ECAAB4C00D42E93 /* NSCalendar+ST.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSCalendar+ST.m"; sourceTree = ""; }; + DD6A41C21ECAAB4C00D42E93 /* STPickerDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPickerDate.h; sourceTree = ""; }; + DD6A41C31ECAAB4C00D42E93 /* STPickerDate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPickerDate.m; sourceTree = ""; }; + DD6A41C51ECAAB4C00D42E93 /* STPickerSingle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPickerSingle.h; sourceTree = ""; }; + DD6A41C61ECAAB4C00D42E93 /* STPickerSingle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPickerSingle.m; sourceTree = ""; }; + DD6A41C81ECAAB4C00D42E93 /* STConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STConfig.h; sourceTree = ""; }; + DD6A41C91ECAAB4C00D42E93 /* STConst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STConst.h; sourceTree = ""; }; + DD6A41CA1ECAAB4C00D42E93 /* STConst.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STConst.m; sourceTree = ""; }; + DD6A41CB1ECAAB4C00D42E93 /* STUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STUI.h; sourceTree = ""; }; + DD6A41CC1ECAAB4C00D42E93 /* STUI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STUI.m; sourceTree = ""; }; + DD6A41CD1ECAAB4C00D42E93 /* UIView+ST.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+ST.h"; sourceTree = ""; }; + DD6A41CE1ECAAB4C00D42E93 /* UIView+ST.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+ST.m"; sourceTree = ""; }; + DD6A41CF1ECAAB4C00D42E93 /* STPickerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = STPickerView.h; sourceTree = ""; }; + DD6A41D01ECAAB4C00D42E93 /* STPickerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = STPickerView.m; sourceTree = ""; }; + DD6A41D21ECAAB4C00D42E93 /* KZPortaitView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KZPortaitView.h; sourceTree = ""; }; + DD6A41D31ECAAB4C00D42E93 /* KZPortaitView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KZPortaitView.m; sourceTree = ""; }; + DD6A41D41ECAAB4C00D42E93 /* UIImageView+KJ.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+KJ.h"; sourceTree = ""; }; + DD6A41D51ECAAB4C00D42E93 /* UIImageView+KJ.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+KJ.m"; sourceTree = ""; }; + DD6A41D61ECAAB4C00D42E93 /* VPImageCropperViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VPImageCropperViewController.h; sourceTree = ""; }; + DD6A41D71ECAAB4C00D42E93 /* VPImageCropperViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VPImageCropperViewController.m; sourceTree = ""; }; + DD6A41D81ECAAB4C00D42E93 /* VPViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VPViewController.h; sourceTree = ""; }; + DD6A41D91ECAAB4C00D42E93 /* VPViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VPViewController.m; sourceTree = ""; }; + DD6A41DB1ECAAB4C00D42E93 /* ZoomImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZoomImage.h; sourceTree = ""; }; + DD6A41DC1ECAAB4C00D42E93 /* ZoomImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZoomImage.m; sourceTree = ""; }; + DDEE57211ED569C600F237C4 /* dailylog_fabulous_selected@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dailylog_fabulous_selected@2x.png"; sourceTree = ""; }; + DDEE57221ED569C600F237C4 /* dailylog_fabulous_selected@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dailylog_fabulous_selected@3x.png"; sourceTree = ""; }; + DDEE57231ED569C600F237C4 /* dailylog_fabulous@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dailylog_fabulous@2x.png"; sourceTree = ""; }; + DDEE57241ED569C600F237C4 /* dailylog_fabulous@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dailylog_fabulous@3x.png"; sourceTree = ""; }; + DDFC91C11ECC40A3002AFA6F /* UIImage+ResizeImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+ResizeImage.h"; sourceTree = ""; }; + DDFC91C21ECC40A3002AFA6F /* UIImage+ResizeImage.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ResizeImage.m"; sourceTree = ""; }; + DDFC91D91ECD29BE002AFA6F /* Common.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = ""; }; + DDFC91DB1ECD29BE002AFA6F /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; + DDFC91DC1ECD29BE002AFA6F /* Profile.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Profile.xcconfig; sourceTree = ""; }; + DDFC91DD1ECD29BE002AFA6F /* Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; + DDFC91DE1ECD29BE002AFA6F /* Test.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Test.xcconfig; sourceTree = ""; }; + DDFC91E01ECD29BE002AFA6F /* Application.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Application.xcconfig; sourceTree = ""; }; + DDFC91E11ECD29BE002AFA6F /* Framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Framework.xcconfig; sourceTree = ""; }; + DDFC91E21ECD29BE002AFA6F /* StaticLibrary.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = StaticLibrary.xcconfig; sourceTree = ""; }; + DDFC91E41ECD29BE002AFA6F /* iOS-Application.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "iOS-Application.xcconfig"; sourceTree = ""; }; + DDFC91E51ECD29BE002AFA6F /* iOS-Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "iOS-Base.xcconfig"; sourceTree = ""; }; + DDFC91E61ECD29BE002AFA6F /* iOS-Framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "iOS-Framework.xcconfig"; sourceTree = ""; }; + DDFC91E71ECD29BE002AFA6F /* iOS-StaticLibrary.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "iOS-StaticLibrary.xcconfig"; sourceTree = ""; }; DF7F520770069FF4390A5315 /* Pods-LJHY_User.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LJHY_User.release.xcconfig"; path = "Pods/Target Support Files/Pods-LJHY_User/Pods-LJHY_User.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -146,6 +323,8 @@ 1AEAF555072DE00A884FC0B2 /* Pods */ = { isa = PBXGroup; children = ( + DDFC91D81ECD29BE002AFA6F /* Base */, + DDFC91E31ECD29BE002AFA6F /* iOS */, C10F3C374053DBEB0C9EA65D /* Pods-LJHY_User.debug.xcconfig */, DF7F520770069FF4390A5315 /* Pods-LJHY_User.release.xcconfig */, 1BDB4114213BDAB4F574E70D /* Pods-LJHY_UserTests.debug.xcconfig */, @@ -166,16 +345,6 @@ name = Frameworks; sourceTree = ""; }; - DA0EA9391DFE7B8600E011B4 /* Category */ = { - isa = PBXGroup; - children = ( - 88E155741E45D31400DC334F /* Foundation+Log.m */, - DA0EA93A1DFE7BAC00E011B4 /* UIImage+LJColor.h */, - DA0EA93B1DFE7BAC00E011B4 /* UIImage+LJColor.m */, - ); - name = Category; - sourceTree = ""; - }; DA74C2161DFA53F700F6F28B = { isa = PBXGroup; children = ( @@ -191,7 +360,7 @@ DA74C2201DFA53F700F6F28B /* Products */ = { isa = PBXGroup; children = ( - DA74C21F1DFA53F700F6F28B /* LJHY_User.app */, + DA74C21F1DFA53F700F6F28B /* 模版app debug.app */, DA74C2381DFA53F700F6F28B /* LJHY_UserTests.xctest */, DA74C2431DFA53F700F6F28B /* LJHY_UserUITests.xctest */, ); @@ -201,32 +370,17 @@ DA74C2211DFA53F700F6F28B /* LJHY_User */ = { isa = PBXGroup; children = ( - DA0EA9391DFE7B8600E011B4 /* Category */, - DA74C2251DFA53F700F6F28B /* AppDelegate.h */, - DA74C2261DFA53F700F6F28B /* AppDelegate.m */, - DA74C2831DFA97F100F6F28B /* LJHYUser-Prefix.pch */, - DA74C2701DFA956E00F6F28B /* BaseController */, - DA74C2711DFA959100F6F28B /* BaseView */, - DA74C2721DFA95A100F6F28B /* Main */, - DA74C2731DFA95C400F6F28B /* Home */, - DA74C2741DFA95CE00F6F28B /* Doctor */, - DA74C2751DFA95E100F6F28B /* Service */, - DA74C2761DFA95EB00F6F28B /* Personal */, - DA74C22E1DFA53F700F6F28B /* Assets.xcassets */, - DA74C2331DFA53F700F6F28B /* Info.plist */, - DA74C2221DFA53F700F6F28B /* Supporting Files */, + DD2D00351ECAD69800C21A3C /* BaseControllers */, + DD2D003C1ECAD69800C21A3C /* BaseView */, + DD2D00471ECAD69800C21A3C /* Main */, + DD2D004C1ECAD69800C21A3C /* Others */, + DD2D00541ECAD69800C21A3C /* Submodule(业务) */, + DD6A41551ECAAB4C00D42E93 /* Utils */, + DD6A410D1ECAAA3400D42E93 /* Category */, ); path = LJHY_User; sourceTree = ""; }; - DA74C2221DFA53F700F6F28B /* Supporting Files */ = { - isa = PBXGroup; - children = ( - DA74C2231DFA53F700F6F28B /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; DA74C23B1DFA53F700F6F28B /* LJHY_UserTests */ = { isa = PBXGroup; children = ( @@ -245,87 +399,514 @@ path = LJHY_UserUITests; sourceTree = ""; }; - DA74C2701DFA956E00F6F28B /* BaseController */ = { + DD2D00351ECAD69800C21A3C /* BaseControllers */ = { + isa = PBXGroup; + children = ( + DD2D00361ECAD69800C21A3C /* LJBaseRootViewController.h */, + DD2D00371ECAD69800C21A3C /* LJBaseRootViewController.m */, + DD2D00381ECAD69800C21A3C /* LJBaseSubViewController.h */, + DD2D00391ECAD69800C21A3C /* LJBaseSubViewController.m */, + DD2D003A1ECAD69800C21A3C /* LJBaseViewController.h */, + DD2D003B1ECAD69800C21A3C /* LJBaseViewController.m */, + ); + path = BaseControllers; + sourceTree = ""; + }; + DD2D003C1ECAD69800C21A3C /* BaseView */ = { + isa = PBXGroup; + children = ( + DD2D003D1ECAD69800C21A3C /* LJButton.h */, + DD2D003E1ECAD69800C21A3C /* LJButton.m */, + DD2D003F1ECAD69800C21A3C /* LJImageView.h */, + DD2D00401ECAD69800C21A3C /* LJImageView.m */, + DD2D00411ECAD69800C21A3C /* LJLabel.h */, + DD2D00421ECAD69800C21A3C /* LJLabel.m */, + DD2D00431ECAD69800C21A3C /* LJTableViewCell.h */, + DD2D00441ECAD69800C21A3C /* LJTableViewCell.m */, + DD2D00451ECAD69800C21A3C /* LJView.h */, + DD2D00461ECAD69800C21A3C /* LJView.m */, + ); + path = BaseView; + sourceTree = ""; + }; + DD2D00471ECAD69800C21A3C /* Main */ = { + isa = PBXGroup; + children = ( + DD2D00481ECAD69800C21A3C /* LJNavigationController.h */, + DD2D00491ECAD69800C21A3C /* LJNavigationController.m */, + DD2D004A1ECAD69800C21A3C /* LJTabBarController.h */, + DD2D004B1ECAD69800C21A3C /* LJTabBarController.m */, + ); + path = Main; + sourceTree = ""; + }; + DD2D004C1ECAD69800C21A3C /* Others */ = { + isa = PBXGroup; + children = ( + DD2D004D1ECAD69800C21A3C /* AppDelegate.h */, + DD2D004E1ECAD69800C21A3C /* AppDelegate.m */, + DD2D004F1ECAD69800C21A3C /* Assets.xcassets */, + DD2D00501ECAD69800C21A3C /* Foundation+Log.m */, + DD2D00511ECAD69800C21A3C /* Info.plist */, + DD2D00521ECAD69800C21A3C /* LJHYUser-Prefix.pch */, + DD2D00531ECAD69800C21A3C /* main.m */, + ); + path = Others; + sourceTree = ""; + }; + DD2D00541ECAD69800C21A3C /* Submodule(业务) */ = { + isa = PBXGroup; + children = ( + DD2D00551ECAD69800C21A3C /* Doctor */, + DD2D00581ECAD69800C21A3C /* Home */, + DD2D00611ECAD69800C21A3C /* Personal */, + DD2D00641ECAD69800C21A3C /* Service */, + ); + name = "Submodule(业务)"; + path = Submodule; + sourceTree = ""; + }; + DD2D00551ECAD69800C21A3C /* Doctor */ = { + isa = PBXGroup; + children = ( + DD2D00561ECAD69800C21A3C /* LJDoctorViewController.h */, + DD2D00571ECAD69800C21A3C /* LJDoctorViewController.m */, + ); + path = Doctor; + sourceTree = ""; + }; + DD2D00581ECAD69800C21A3C /* Home */ = { + isa = PBXGroup; + children = ( + DD2D00591ECAD69800C21A3C /* CTMediator+LJMediatorHomeActions.h */, + DD2D005A1ECAD69800C21A3C /* CTMediator+LJMediatorHomeActions.m */, + DD2D005B1ECAD69800C21A3C /* LJDoctorRequest.h */, + DD2D005C1ECAD69800C21A3C /* LJDoctorRequest.m */, + DD2D005D1ECAD69800C21A3C /* LJHomeViewController.h */, + DD2D005E1ECAD69800C21A3C /* LJHomeViewController.m */, + DD2D005F1ECAD69800C21A3C /* Target_Home.h */, + DD2D00601ECAD69800C21A3C /* Target_Home.m */, + ); + path = Home; + sourceTree = ""; + }; + DD2D00611ECAD69800C21A3C /* Personal */ = { + isa = PBXGroup; + children = ( + DD2D00621ECAD69800C21A3C /* LJPersonalViewController.h */, + DD2D00631ECAD69800C21A3C /* LJPersonalViewController.m */, + ); + path = Personal; + sourceTree = ""; + }; + DD2D00641ECAD69800C21A3C /* Service */ = { + isa = PBXGroup; + children = ( + DD2D00651ECAD69800C21A3C /* LJServiceViewController.h */, + DD2D00661ECAD69800C21A3C /* LJServiceViewController.m */, + ); + path = Service; + sourceTree = ""; + }; + DD6A410D1ECAAA3400D42E93 /* Category */ = { + isa = PBXGroup; + children = ( + DDFC91C11ECC40A3002AFA6F /* UIImage+ResizeImage.h */, + DDFC91C21ECC40A3002AFA6F /* UIImage+ResizeImage.m */, + DD6A410E1ECAAA3400D42E93 /* NSArray+Log.h */, + DD6A410F1ECAAA3400D42E93 /* NSArray+Log.m */, + DD6A41101ECAAA3400D42E93 /* NSDate+Helper.h */, + DD6A41111ECAAA3400D42E93 /* NSDate+Helper.m */, + DD6A41121ECAAA3400D42E93 /* NSString+call.h */, + DD6A41131ECAAA3400D42E93 /* NSString+call.m */, + DD6A41141ECAAA3400D42E93 /* NSString+checkTeleNumber.h */, + DD6A41151ECAAA3400D42E93 /* NSString+checkTeleNumber.m */, + DD6A41161ECAAA3400D42E93 /* NSString+Hash.h */, + DD6A41171ECAAA3400D42E93 /* NSString+Hash.m */, + DD6A41181ECAAA3400D42E93 /* NSString+timeStamp.h */, + DD6A41191ECAAA3400D42E93 /* NSString+timeStamp.m */, + DD6A411A1ECAAA3400D42E93 /* NSString+Valid.h */, + DD6A411B1ECAAA3400D42E93 /* NSString+Valid.m */, + DD6A411C1ECAAA3400D42E93 /* UIImage+cutCircleImage.h */, + DD6A411D1ECAAA3400D42E93 /* UIImage+cutCircleImage.m */, + DD6A411E1ECAAA3400D42E93 /* UIImage+Help.h */, + DD6A411F1ECAAA3400D42E93 /* UIImage+Help.m */, + DD6A41201ECAAA3400D42E93 /* UIImage+ImageWithColor.h */, + DD6A41211ECAAA3400D42E93 /* UIImage+ImageWithColor.m */, + DD6A41221ECAAA3400D42E93 /* UIImage+LJColor.h */, + DD6A41231ECAAA3400D42E93 /* UIImage+LJColor.m */, + DD6A41241ECAAA3400D42E93 /* UIResponder+Router.h */, + DD6A41251ECAAA3400D42E93 /* UIResponder+Router.m */, + DD6A41261ECAAA3400D42E93 /* UIScrollView+UITouch.h */, + DD6A41271ECAAA3400D42E93 /* UIScrollView+UITouch.m */, + DD6A41281ECAAA3400D42E93 /* UIView+font.h */, + DD6A41291ECAAA3400D42E93 /* UIView+font.m */, + DD6A412A1ECAAA3400D42E93 /* UIView+ParentController.h */, + DD6A412B1ECAAA3400D42E93 /* UIView+ParentController.m */, + DD6A412C1ECAAA3400D42E93 /* UIViewController+CurrentVCLogging.h */, + ); + path = Category; + sourceTree = ""; + }; + DD6A41551ECAAB4C00D42E93 /* Utils */ = { + isa = PBXGroup; + children = ( + DD6A41561ECAAB4C00D42E93 /* AgreeButton */, + DD6A41571ECAAB4C00D42E93 /* BadgeBtn */, + DD6A41581ECAAB4C00D42E93 /* BadgeNumberView */, + DD6A415A1ECAAB4C00D42E93 /* CacheSize */, + DD6A415D1ECAAB4C00D42E93 /* ChoseAreaTool */, + DD6A41811ECAAB4C00D42E93 /* DBTool */, + DD6A41821ECAAB4C00D42E93 /* DLSlideView */, + DD6A41951ECAAB4C00D42E93 /* EMAlertView */, + DD6A41981ECAAB4C00D42E93 /* GetCurrentVC */, + DD6A419B1ECAAB4C00D42E93 /* KJAlerview */, + DD6A419C1ECAAB4C00D42E93 /* KJCountDown */, + DD6A419F1ECAAB4C00D42E93 /* KJFloatView */, + DD6A41A01ECAAB4C00D42E93 /* KJSlideView */, + DD6A41A11ECAAB4C00D42E93 /* kXMenu */, + DD6A41A41ECAAB4C00D42E93 /* LimitTextField */, + DD6A41A71ECAAB4C00D42E93 /* Masonry */, + DD6A41AA1ECAAB4C00D42E93 /* MutiPictUpload */, + DD6A41AB1ECAAB4C00D42E93 /* PJTernarySearchTree */, + DD6A41AE1ECAAB4C00D42E93 /* PlaceholderTextView */, + DD6A41BE1ECAAB4C00D42E93 /* STPickerView */, + DD6A41D11ECAAB4C00D42E93 /* VPImageCropper(头像工具) */, + DD6A41DA1ECAAB4C00D42E93 /* ZoomImage */, + ); + path = Utils; + sourceTree = ""; + }; + DD6A41561ECAAB4C00D42E93 /* AgreeButton */ = { + isa = PBXGroup; + children = ( + DDEE57211ED569C600F237C4 /* dailylog_fabulous_selected@2x.png */, + DDEE57221ED569C600F237C4 /* dailylog_fabulous_selected@3x.png */, + DDEE57231ED569C600F237C4 /* dailylog_fabulous@2x.png */, + DDEE57241ED569C600F237C4 /* dailylog_fabulous@3x.png */, + DD1E554D1ED431E1007DBBEF /* AgreeButton.h */, + DD1E554E1ED431E1007DBBEF /* AgreeButton.m */, + ); + path = AgreeButton; + sourceTree = ""; + }; + DD6A41571ECAAB4C00D42E93 /* BadgeBtn */ = { + isa = PBXGroup; + children = ( + ); + path = BadgeBtn; + sourceTree = ""; + }; + DD6A41581ECAAB4C00D42E93 /* BadgeNumberView */ = { + isa = PBXGroup; + children = ( + DD6A41591ECAAB4C00D42E93 /* Supporting Files */, + ); + path = BadgeNumberView; + sourceTree = ""; + }; + DD6A41591ECAAB4C00D42E93 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + ); + path = "Supporting Files"; + sourceTree = ""; + }; + DD6A415A1ECAAB4C00D42E93 /* CacheSize */ = { + isa = PBXGroup; + children = ( + DD6A415B1ECAAB4C00D42E93 /* ImageCacheSize.h */, + DD6A415C1ECAAB4C00D42E93 /* ImageCacheSize.m */, + ); + path = CacheSize; + sourceTree = ""; + }; + DD6A415D1ECAAB4C00D42E93 /* ChoseAreaTool */ = { + isa = PBXGroup; + children = ( + DD6A415E1ECAAB4C00D42E93 /* KZAreaM.h */, + DD6A415F1ECAAB4C00D42E93 /* KZAreaM.m */, + DD6A41601ECAAB4C00D42E93 /* KZAreaVC.h */, + DD6A41611ECAAB4C00D42E93 /* KZAreaVC.m */, + DD6A41621ECAAB4C00D42E93 /* KZChoseAreaTool.h */, + DD6A41631ECAAB4C00D42E93 /* KZChoseAreaTool.m */, + DD6A41641ECAAB4C00D42E93 /* zyb.db */, + ); + path = ChoseAreaTool; + sourceTree = ""; + }; + DD6A41811ECAAB4C00D42E93 /* DBTool */ = { + isa = PBXGroup; + children = ( + ); + path = DBTool; + sourceTree = ""; + }; + DD6A41821ECAAB4C00D42E93 /* DLSlideView */ = { + isa = PBXGroup; + children = ( + DD6A41831ECAAB4C00D42E93 /* DLCache */, + DD6A41871ECAAB4C00D42E93 /* DLCustomSlideView.h */, + DD6A41881ECAAB4C00D42E93 /* DLCustomSlideView.m */, + DD6A41891ECAAB4C00D42E93 /* DLSlideView.h */, + DD6A418A1ECAAB4C00D42E93 /* DLSlideView.m */, + DD6A418B1ECAAB4C00D42E93 /* DLTabbarView */, + DD6A41911ECAAB4C00D42E93 /* DlTabedSlideView.h */, + DD6A41921ECAAB4C00D42E93 /* DlTabedSlideView.m */, + DD6A41931ECAAB4C00D42E93 /* DLUtility.h */, + DD6A41941ECAAB4C00D42E93 /* DLUtility.m */, + ); + path = DLSlideView; + sourceTree = ""; + }; + DD6A41831ECAAB4C00D42E93 /* DLCache */ = { isa = PBXGroup; children = ( - DA74C25B1DFA55B600F6F28B /* LJBaseViewController.h */, - DA74C25C1DFA55B600F6F28B /* LJBaseViewController.m */, - DA74C26A1DFA950200F6F28B /* LJBaseRootViewController.h */, - DA74C26B1DFA950200F6F28B /* LJBaseRootViewController.m */, - DA74C26D1DFA951300F6F28B /* LJBaseSubViewController.h */, - DA74C26E1DFA951300F6F28B /* LJBaseSubViewController.m */, + DD6A41841ECAAB4C00D42E93 /* DLCacheProtocol.h */, + DD6A41851ECAAB4C00D42E93 /* DLLRUCache.h */, + DD6A41861ECAAB4C00D42E93 /* DLLRUCache.m */, ); - name = BaseController; + path = DLCache; sourceTree = ""; }; - DA74C2711DFA959100F6F28B /* BaseView */ = { + DD6A418B1ECAAB4C00D42E93 /* DLTabbarView */ = { isa = PBXGroup; children = ( - DA74C2771DFA96D700F6F28B /* LJView.h */, - DA74C2781DFA96D700F6F28B /* LJView.m */, - DA74C27A1DFA96E400F6F28B /* LJButton.h */, - DA74C27B1DFA96E400F6F28B /* LJButton.m */, - DA74C27D1DFA96F000F6F28B /* LJLabel.h */, - DA74C27E1DFA96F000F6F28B /* LJLabel.m */, - DA74C2801DFA970700F6F28B /* LJImageView.h */, - DA74C2811DFA970700F6F28B /* LJImageView.m */, - DA0EA93D1DFF90CC00E011B4 /* LJTableViewCell.h */, - DA0EA93E1DFF90CC00E011B4 /* LJTableViewCell.m */, + DD6A418C1ECAAB4C00D42E93 /* DLFixedTabbarView.h */, + DD6A418D1ECAAB4C00D42E93 /* DLFixedTabbarView.m */, + DD6A418E1ECAAB4C00D42E93 /* DLScrollTabbarView.h */, + DD6A418F1ECAAB4C00D42E93 /* DLScrollTabbarView.m */, + DD6A41901ECAAB4C00D42E93 /* DLSlideTabbarProtocol.h */, ); - name = BaseView; + path = DLTabbarView; sourceTree = ""; }; - DA74C2721DFA95A100F6F28B /* Main */ = { + DD6A41951ECAAB4C00D42E93 /* EMAlertView */ = { isa = PBXGroup; children = ( - DA74C2551DFA556400F6F28B /* LJNavigationController.h */, - DA74C2561DFA556400F6F28B /* LJNavigationController.m */, - DA74C2581DFA559600F6F28B /* LJTabBarController.h */, - DA74C2591DFA559600F6F28B /* LJTabBarController.m */, + DD6A41961ECAAB4C00D42E93 /* EMAlertView.h */, + DD6A41971ECAAB4C00D42E93 /* EMAlertView.m */, ); - name = Main; + path = EMAlertView; sourceTree = ""; }; - DA74C2731DFA95C400F6F28B /* Home */ = { + DD6A41981ECAAB4C00D42E93 /* GetCurrentVC */ = { isa = PBXGroup; children = ( - DA74C25E1DFA55C700F6F28B /* LJHomeViewController.h */, - DA74C25F1DFA55C700F6F28B /* LJHomeViewController.m */, - 88E155711E45CBAB00DC334F /* LJDoctorRequest.h */, - 88E155721E45CBAB00DC334F /* LJDoctorRequest.m */, - DA31C3FF1E14CAFA009A7116 /* CTMediator+LJMediatorHomeActions.h */, - DA31C4001E14CAFA009A7116 /* CTMediator+LJMediatorHomeActions.m */, - DA31C4021E14CCFE009A7116 /* Target_Home.h */, - DA31C4031E14CCFE009A7116 /* Target_Home.m */, + DD6A41991ECAAB4C00D42E93 /* AppCurrentControllerTool.h */, + DD6A419A1ECAAB4C00D42E93 /* AppCurrentControllerTool.m */, ); - name = Home; + path = GetCurrentVC; sourceTree = ""; }; - DA74C2741DFA95CE00F6F28B /* Doctor */ = { + DD6A419B1ECAAB4C00D42E93 /* KJAlerview */ = { isa = PBXGroup; children = ( - DA74C2611DFA603800F6F28B /* LJDoctorViewController.h */, - DA74C2621DFA603800F6F28B /* LJDoctorViewController.m */, ); - name = Doctor; + path = KJAlerview; sourceTree = ""; }; - DA74C2751DFA95E100F6F28B /* Service */ = { + DD6A419C1ECAAB4C00D42E93 /* KJCountDown */ = { isa = PBXGroup; children = ( - DA74C2641DFA604100F6F28B /* LJServiceViewController.h */, - DA74C2651DFA604100F6F28B /* LJServiceViewController.m */, + DD6A419D1ECAAB4C00D42E93 /* UIViewController+countDown.h */, + DD6A419E1ECAAB4C00D42E93 /* UIViewController+countDown.m */, ); - name = Service; + path = KJCountDown; sourceTree = ""; }; - DA74C2761DFA95EB00F6F28B /* Personal */ = { + DD6A419F1ECAAB4C00D42E93 /* KJFloatView */ = { isa = PBXGroup; children = ( - DA74C2671DFA605800F6F28B /* LJPersonalViewController.h */, - DA74C2681DFA605800F6F28B /* LJPersonalViewController.m */, ); - name = Personal; + path = KJFloatView; + sourceTree = ""; + }; + DD6A41A01ECAAB4C00D42E93 /* KJSlideView */ = { + isa = PBXGroup; + children = ( + ); + path = KJSlideView; + sourceTree = ""; + }; + DD6A41A11ECAAB4C00D42E93 /* kXMenu */ = { + isa = PBXGroup; + children = ( + DD6A41A21ECAAB4C00D42E93 /* KxMenu.h */, + DD6A41A31ECAAB4C00D42E93 /* KxMenu.m */, + ); + path = kXMenu; + sourceTree = ""; + }; + DD6A41A41ECAAB4C00D42E93 /* LimitTextField */ = { + isa = PBXGroup; + children = ( + DD6A41A51ECAAB4C00D42E93 /* LimitTextField.h */, + DD6A41A61ECAAB4C00D42E93 /* LimitTextField.m */, + ); + path = LimitTextField; + sourceTree = ""; + }; + DD6A41A71ECAAB4C00D42E93 /* Masonry */ = { + isa = PBXGroup; + children = ( + DD6A41A81ECAAB4C00D42E93 /* LIb */, + ); + path = Masonry; + sourceTree = ""; + }; + DD6A41A81ECAAB4C00D42E93 /* LIb */ = { + isa = PBXGroup; + children = ( + DD6A41A91ECAAB4C00D42E93 /* Masonry */, + ); + path = LIb; + sourceTree = ""; + }; + DD6A41A91ECAAB4C00D42E93 /* Masonry */ = { + isa = PBXGroup; + children = ( + ); + path = Masonry; + sourceTree = ""; + }; + DD6A41AA1ECAAB4C00D42E93 /* MutiPictUpload */ = { + isa = PBXGroup; + children = ( + ); + path = MutiPictUpload; + sourceTree = ""; + }; + DD6A41AB1ECAAB4C00D42E93 /* PJTernarySearchTree */ = { + isa = PBXGroup; + children = ( + DD6A41AC1ECAAB4C00D42E93 /* PJTernarySearchTree.h */, + DD6A41AD1ECAAB4C00D42E93 /* PJTernarySearchTree.m */, + ); + path = PJTernarySearchTree; + sourceTree = ""; + }; + DD6A41AE1ECAAB4C00D42E93 /* PlaceholderTextView */ = { + isa = PBXGroup; + children = ( + DD6A41AF1ECAAB4C00D42E93 /* PlaceholderTextView.h */, + DD6A41B01ECAAB4C00D42E93 /* PlaceholderTextView.m */, + ); + path = PlaceholderTextView; + sourceTree = ""; + }; + DD6A41BE1ECAAB4C00D42E93 /* STPickerView */ = { + isa = PBXGroup; + children = ( + DD6A41BF1ECAAB4C00D42E93 /* Date(日期) */, + DD6A41C41ECAAB4C00D42E93 /* Single(单数组) */, + DD6A41C71ECAAB4C00D42E93 /* STConfig */, + DD6A41CF1ECAAB4C00D42E93 /* STPickerView.h */, + DD6A41D01ECAAB4C00D42E93 /* STPickerView.m */, + ); + path = STPickerView; + sourceTree = ""; + }; + DD6A41BF1ECAAB4C00D42E93 /* Date(日期) */ = { + isa = PBXGroup; + children = ( + DD6A41C01ECAAB4C00D42E93 /* NSCalendar+ST.h */, + DD6A41C11ECAAB4C00D42E93 /* NSCalendar+ST.m */, + DD6A41C21ECAAB4C00D42E93 /* STPickerDate.h */, + DD6A41C31ECAAB4C00D42E93 /* STPickerDate.m */, + ); + path = "Date(日期)"; + sourceTree = ""; + }; + DD6A41C41ECAAB4C00D42E93 /* Single(单数组) */ = { + isa = PBXGroup; + children = ( + DD6A41C51ECAAB4C00D42E93 /* STPickerSingle.h */, + DD6A41C61ECAAB4C00D42E93 /* STPickerSingle.m */, + ); + path = "Single(单数组)"; + sourceTree = ""; + }; + DD6A41C71ECAAB4C00D42E93 /* STConfig */ = { + isa = PBXGroup; + children = ( + DD6A41C81ECAAB4C00D42E93 /* STConfig.h */, + DD6A41C91ECAAB4C00D42E93 /* STConst.h */, + DD6A41CA1ECAAB4C00D42E93 /* STConst.m */, + DD6A41CB1ECAAB4C00D42E93 /* STUI.h */, + DD6A41CC1ECAAB4C00D42E93 /* STUI.m */, + DD6A41CD1ECAAB4C00D42E93 /* UIView+ST.h */, + DD6A41CE1ECAAB4C00D42E93 /* UIView+ST.m */, + ); + path = STConfig; + sourceTree = ""; + }; + DD6A41D11ECAAB4C00D42E93 /* VPImageCropper(头像工具) */ = { + isa = PBXGroup; + children = ( + DD6A41D21ECAAB4C00D42E93 /* KZPortaitView.h */, + DD6A41D31ECAAB4C00D42E93 /* KZPortaitView.m */, + DD6A41D41ECAAB4C00D42E93 /* UIImageView+KJ.h */, + DD6A41D51ECAAB4C00D42E93 /* UIImageView+KJ.m */, + DD6A41D61ECAAB4C00D42E93 /* VPImageCropperViewController.h */, + DD6A41D71ECAAB4C00D42E93 /* VPImageCropperViewController.m */, + DD6A41D81ECAAB4C00D42E93 /* VPViewController.h */, + DD6A41D91ECAAB4C00D42E93 /* VPViewController.m */, + ); + path = "VPImageCropper(头像工具)"; + sourceTree = ""; + }; + DD6A41DA1ECAAB4C00D42E93 /* ZoomImage */ = { + isa = PBXGroup; + children = ( + DD6A41DB1ECAAB4C00D42E93 /* ZoomImage.h */, + DD6A41DC1ECAAB4C00D42E93 /* ZoomImage.m */, + ); + path = ZoomImage; + sourceTree = ""; + }; + DDFC91D81ECD29BE002AFA6F /* Base */ = { + isa = PBXGroup; + children = ( + DDFC91D91ECD29BE002AFA6F /* Common.xcconfig */, + DDFC91DA1ECD29BE002AFA6F /* Configurations */, + DDFC91DF1ECD29BE002AFA6F /* Targets */, + ); + name = Base; + path = "Pods/Target Support Files/Pods-LJHY_User/Base"; + sourceTree = ""; + }; + DDFC91DA1ECD29BE002AFA6F /* Configurations */ = { + isa = PBXGroup; + children = ( + DDFC91DB1ECD29BE002AFA6F /* Debug.xcconfig */, + DDFC91DC1ECD29BE002AFA6F /* Profile.xcconfig */, + DDFC91DD1ECD29BE002AFA6F /* Release.xcconfig */, + DDFC91DE1ECD29BE002AFA6F /* Test.xcconfig */, + ); + path = Configurations; + sourceTree = ""; + }; + DDFC91DF1ECD29BE002AFA6F /* Targets */ = { + isa = PBXGroup; + children = ( + DDFC91E01ECD29BE002AFA6F /* Application.xcconfig */, + DDFC91E11ECD29BE002AFA6F /* Framework.xcconfig */, + DDFC91E21ECD29BE002AFA6F /* StaticLibrary.xcconfig */, + ); + path = Targets; + sourceTree = ""; + }; + DDFC91E31ECD29BE002AFA6F /* iOS */ = { + isa = PBXGroup; + children = ( + DDFC91E41ECD29BE002AFA6F /* iOS-Application.xcconfig */, + DDFC91E51ECD29BE002AFA6F /* iOS-Base.xcconfig */, + DDFC91E61ECD29BE002AFA6F /* iOS-Framework.xcconfig */, + DDFC91E71ECD29BE002AFA6F /* iOS-StaticLibrary.xcconfig */, + ); + name = iOS; + path = "Pods/Target Support Files/Pods-LJHY_User/iOS"; sourceTree = ""; }; /* End PBXGroup section */ @@ -348,7 +929,7 @@ ); name = LJHY_User; productName = LJHY_User; - productReference = DA74C21F1DFA53F700F6F28B /* LJHY_User.app */; + productReference = DA74C21F1DFA53F700F6F28B /* 模版app debug.app */; productType = "com.apple.product-type.application"; }; DA74C2371DFA53F700F6F28B /* LJHY_UserTests */ = { @@ -405,7 +986,7 @@ TargetAttributes = { DA74C21E1DFA53F700F6F28B = { CreatedOnToolsVersion = 8.1; - ProvisioningStyle = Automatic; + ProvisioningStyle = Manual; }; DA74C2371DFA53F700F6F28B = { CreatedOnToolsVersion = 8.1; @@ -444,7 +1025,25 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - DA74C22F1DFA53F700F6F28B /* Assets.xcassets in Resources */, + DDFC91EA1ECD29BF002AFA6F /* Profile.xcconfig in Resources */, + DDEE57251ED569C600F237C4 /* dailylog_fabulous_selected@2x.png in Resources */, + DD2D00741ECAD69800C21A3C /* Info.plist in Resources */, + DDFC91ED1ECD29BF002AFA6F /* Application.xcconfig in Resources */, + DDFC91EF1ECD29BF002AFA6F /* StaticLibrary.xcconfig in Resources */, + DDEE57281ED569C600F237C4 /* dailylog_fabulous@3x.png in Resources */, + DD6A41E11ECAAB4C00D42E93 /* zyb.db in Resources */, + DD2D00721ECAD69800C21A3C /* Assets.xcassets in Resources */, + DDFC91EE1ECD29BF002AFA6F /* Framework.xcconfig in Resources */, + DDFC91EC1ECD29BF002AFA6F /* Test.xcconfig in Resources */, + DDFC91E91ECD29BF002AFA6F /* Debug.xcconfig in Resources */, + DDFC91F11ECD29BF002AFA6F /* iOS-Base.xcconfig in Resources */, + DDFC91EB1ECD29BF002AFA6F /* Release.xcconfig in Resources */, + DDEE57271ED569C600F237C4 /* dailylog_fabulous@2x.png in Resources */, + DDEE57261ED569C600F237C4 /* dailylog_fabulous_selected@3x.png in Resources */, + DDFC91F31ECD29BF002AFA6F /* iOS-StaticLibrary.xcconfig in Resources */, + DDFC91F21ECD29BF002AFA6F /* iOS-Framework.xcconfig in Resources */, + DDFC91E81ECD29BE002AFA6F /* Common.xcconfig in Resources */, + DDFC91F01ECD29BF002AFA6F /* iOS-Application.xcconfig in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -607,27 +1206,73 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DA74C25D1DFA55B600F6F28B /* LJBaseViewController.m in Sources */, - DA31C4041E14CCFE009A7116 /* Target_Home.m in Sources */, - DA74C2631DFA603800F6F28B /* LJDoctorViewController.m in Sources */, - DA74C2661DFA604100F6F28B /* LJServiceViewController.m in Sources */, - DA74C2691DFA605800F6F28B /* LJPersonalViewController.m in Sources */, - DA74C2271DFA53F700F6F28B /* AppDelegate.m in Sources */, - DA74C25A1DFA559600F6F28B /* LJTabBarController.m in Sources */, - DA74C27C1DFA96E400F6F28B /* LJButton.m in Sources */, - 88E155751E45D31400DC334F /* Foundation+Log.m in Sources */, - DA74C2601DFA55C700F6F28B /* LJHomeViewController.m in Sources */, - DA0EA93F1DFF90CC00E011B4 /* LJTableViewCell.m in Sources */, - 88E155731E45CBAB00DC334F /* LJDoctorRequest.m in Sources */, - DA74C2821DFA970700F6F28B /* LJImageView.m in Sources */, - DA0EA93C1DFE7BAC00E011B4 /* UIImage+LJColor.m in Sources */, - DA74C26F1DFA951300F6F28B /* LJBaseSubViewController.m in Sources */, - DA74C2791DFA96D700F6F28B /* LJView.m in Sources */, - DA74C27F1DFA96F000F6F28B /* LJLabel.m in Sources */, - DA74C2241DFA53F700F6F28B /* main.m in Sources */, - DA74C2571DFA556400F6F28B /* LJNavigationController.m in Sources */, - DA31C4011E14CAFA009A7116 /* CTMediator+LJMediatorHomeActions.m in Sources */, - DA74C26C1DFA950200F6F28B /* LJBaseRootViewController.m in Sources */, + DD6A41F51ECAAB4C00D42E93 /* UIViewController+countDown.m in Sources */, + DD6A41311ECAAA3400D42E93 /* NSString+Hash.m in Sources */, + DD6A412F1ECAAA3400D42E93 /* NSString+call.m in Sources */, + DD6A41F01ECAAB4C00D42E93 /* DLScrollTabbarView.m in Sources */, + DD2D006F1ECAD69800C21A3C /* LJNavigationController.m in Sources */, + DD2D00781ECAD69800C21A3C /* LJDoctorRequest.m in Sources */, + DD6A41391ECAAA3400D42E93 /* UIScrollView+UITouch.m in Sources */, + DD6A42001ECAAB4C00D42E93 /* NSCalendar+ST.m in Sources */, + DD6A412D1ECAAA3400D42E93 /* NSArray+Log.m in Sources */, + DD6A42061ECAAB4C00D42E93 /* STPickerView.m in Sources */, + DD6A413B1ECAAA3400D42E93 /* UIView+ParentController.m in Sources */, + DD2D007A1ECAD69800C21A3C /* Target_Home.m in Sources */, + DD6A41341ECAAA3400D42E93 /* UIImage+cutCircleImage.m in Sources */, + DD6A42091ECAAB4C00D42E93 /* VPImageCropperViewController.m in Sources */, + DD6A42051ECAAB4C00D42E93 /* UIView+ST.m in Sources */, + DD6A41DD1ECAAB4C00D42E93 /* ImageCacheSize.m in Sources */, + DD6A42021ECAAB4C00D42E93 /* STPickerSingle.m in Sources */, + DD2D006D1ECAD69800C21A3C /* LJTableViewCell.m in Sources */, + DD6A413A1ECAAA3400D42E93 /* UIView+font.m in Sources */, + DD6A41321ECAAA3400D42E93 /* NSString+timeStamp.m in Sources */, + DD6A41F61ECAAB4C00D42E93 /* KxMenu.m in Sources */, + DD6A42081ECAAB4C00D42E93 /* UIImageView+KJ.m in Sources */, + DD2D00731ECAD69800C21A3C /* Foundation+Log.m in Sources */, + DD2D007C1ECAD69800C21A3C /* LJServiceViewController.m in Sources */, + DD2D00791ECAD69800C21A3C /* LJHomeViewController.m in Sources */, + DD6A41301ECAAA3400D42E93 /* NSString+checkTeleNumber.m in Sources */, + DD6A41DE1ECAAB4C00D42E93 /* KZAreaM.m in Sources */, + DD2D00671ECAD69800C21A3C /* LJBaseRootViewController.m in Sources */, + DD2D00711ECAD69800C21A3C /* AppDelegate.m in Sources */, + DD6A42011ECAAB4C00D42E93 /* STPickerDate.m in Sources */, + DD6A412E1ECAAA3400D42E93 /* NSDate+Helper.m in Sources */, + DD6A41F91ECAAB4C00D42E93 /* PlaceholderTextView.m in Sources */, + DD6A41381ECAAA3400D42E93 /* UIResponder+Router.m in Sources */, + DD6A41E01ECAAB4C00D42E93 /* KZChoseAreaTool.m in Sources */, + DD6A41F41ECAAB4C00D42E93 /* AppCurrentControllerTool.m in Sources */, + DD6A41361ECAAA3400D42E93 /* UIImage+ImageWithColor.m in Sources */, + DD2D006C1ECAD69800C21A3C /* LJLabel.m in Sources */, + DD6A41F31ECAAB4C00D42E93 /* EMAlertView.m in Sources */, + DD6A41331ECAAA3400D42E93 /* NSString+Valid.m in Sources */, + DD6A41EF1ECAAB4C00D42E93 /* DLFixedTabbarView.m in Sources */, + DD6A420A1ECAAB4C00D42E93 /* VPViewController.m in Sources */, + DDFC91C31ECC40A3002AFA6F /* UIImage+ResizeImage.m in Sources */, + DD2D00771ECAD69800C21A3C /* CTMediator+LJMediatorHomeActions.m in Sources */, + DD6A41F21ECAAB4C00D42E93 /* DLUtility.m in Sources */, + DD6A41371ECAAA3400D42E93 /* UIImage+LJColor.m in Sources */, + DD6A42041ECAAB4C00D42E93 /* STUI.m in Sources */, + DD6A41F11ECAAB4C00D42E93 /* DlTabedSlideView.m in Sources */, + DD1E554F1ED431E1007DBBEF /* AgreeButton.m in Sources */, + DD6A42031ECAAB4C00D42E93 /* STConst.m in Sources */, + DD6A420B1ECAAB4C00D42E93 /* ZoomImage.m in Sources */, + DD6A41EE1ECAAB4C00D42E93 /* DLSlideView.m in Sources */, + DD6A42071ECAAB4C00D42E93 /* KZPortaitView.m in Sources */, + DD6A41F81ECAAB4C00D42E93 /* PJTernarySearchTree.m in Sources */, + DD2D00701ECAD69800C21A3C /* LJTabBarController.m in Sources */, + DD2D00681ECAD69800C21A3C /* LJBaseSubViewController.m in Sources */, + DD2D006A1ECAD69800C21A3C /* LJButton.m in Sources */, + DD6A41DF1ECAAB4C00D42E93 /* KZAreaVC.m in Sources */, + DD2D00751ECAD69800C21A3C /* main.m in Sources */, + DD2D00691ECAD69800C21A3C /* LJBaseViewController.m in Sources */, + DD2D00761ECAD69800C21A3C /* LJDoctorViewController.m in Sources */, + DD2D006E1ECAD69800C21A3C /* LJView.m in Sources */, + DD6A41F71ECAAB4C00D42E93 /* LimitTextField.m in Sources */, + DD2D007B1ECAD69800C21A3C /* LJPersonalViewController.m in Sources */, + DD6A41351ECAAA3400D42E93 /* UIImage+Help.m in Sources */, + DD6A41ED1ECAAB4C00D42E93 /* DLCustomSlideView.m in Sources */, + DD2D006B1ECAD69800C21A3C /* LJImageView.m in Sources */, + DD6A41EC1ECAAB4C00D42E93 /* DLLRUCache.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -761,12 +1406,13 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = ""; - GCC_PREFIX_HEADER = "$(SRCROOT)/LJHY_User/LJHYUser-Prefix.pch"; - INFOPLIST_FILE = LJHY_User/Info.plist; + GCC_PREFIX_HEADER = "/Users/ttkj/github/(myFrame)LJMainProject/LJHY_User/Others/LJHYUser-Prefix.pch"; + INFOPLIST_FILE = "$(SRCROOT)/LJHY_User/Others/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.linjiahaoyi.LJHY-User"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = "--APP-BUNDLEIDENTIFIER-"; + PRODUCT_NAME = "$(APP_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; }; @@ -778,12 +1424,13 @@ ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = ""; - GCC_PREFIX_HEADER = "$(SRCROOT)/LJHY_User/LJHYUser-Prefix.pch"; - INFOPLIST_FILE = LJHY_User/Info.plist; + GCC_PREFIX_HEADER = "/Users/ttkj/github/(myFrame)LJMainProject/LJHY_User/Others/LJHYUser-Prefix.pch"; + INFOPLIST_FILE = "$(SRCROOT)/LJHY_User/Others/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.linjiahaoyi.LJHY-User"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_BUNDLE_IDENTIFIER = "--APP-BUNDLEIDENTIFIER-"; + PRODUCT_NAME = "$(APP_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Release; }; diff --git a/LJHY_User/LJBaseRootViewController.h b/LJHY_User/BaseControllers/LJBaseRootViewController.h similarity index 100% rename from LJHY_User/LJBaseRootViewController.h rename to LJHY_User/BaseControllers/LJBaseRootViewController.h diff --git a/LJHY_User/LJBaseRootViewController.m b/LJHY_User/BaseControllers/LJBaseRootViewController.m similarity index 100% rename from LJHY_User/LJBaseRootViewController.m rename to LJHY_User/BaseControllers/LJBaseRootViewController.m diff --git a/LJHY_User/LJBaseSubViewController.h b/LJHY_User/BaseControllers/LJBaseSubViewController.h similarity index 100% rename from LJHY_User/LJBaseSubViewController.h rename to LJHY_User/BaseControllers/LJBaseSubViewController.h diff --git a/LJHY_User/LJBaseSubViewController.m b/LJHY_User/BaseControllers/LJBaseSubViewController.m similarity index 100% rename from LJHY_User/LJBaseSubViewController.m rename to LJHY_User/BaseControllers/LJBaseSubViewController.m diff --git a/LJHY_User/LJBaseViewController.h b/LJHY_User/BaseControllers/LJBaseViewController.h similarity index 100% rename from LJHY_User/LJBaseViewController.h rename to LJHY_User/BaseControllers/LJBaseViewController.h diff --git a/LJHY_User/LJBaseViewController.m b/LJHY_User/BaseControllers/LJBaseViewController.m similarity index 100% rename from LJHY_User/LJBaseViewController.m rename to LJHY_User/BaseControllers/LJBaseViewController.m diff --git a/LJHY_User/LJButton.h b/LJHY_User/BaseView/LJButton.h similarity index 100% rename from LJHY_User/LJButton.h rename to LJHY_User/BaseView/LJButton.h diff --git a/LJHY_User/LJButton.m b/LJHY_User/BaseView/LJButton.m similarity index 100% rename from LJHY_User/LJButton.m rename to LJHY_User/BaseView/LJButton.m diff --git a/LJHY_User/LJImageView.h b/LJHY_User/BaseView/LJImageView.h similarity index 100% rename from LJHY_User/LJImageView.h rename to LJHY_User/BaseView/LJImageView.h diff --git a/LJHY_User/LJImageView.m b/LJHY_User/BaseView/LJImageView.m similarity index 100% rename from LJHY_User/LJImageView.m rename to LJHY_User/BaseView/LJImageView.m diff --git a/LJHY_User/LJLabel.h b/LJHY_User/BaseView/LJLabel.h similarity index 100% rename from LJHY_User/LJLabel.h rename to LJHY_User/BaseView/LJLabel.h diff --git a/LJHY_User/LJLabel.m b/LJHY_User/BaseView/LJLabel.m similarity index 100% rename from LJHY_User/LJLabel.m rename to LJHY_User/BaseView/LJLabel.m diff --git a/LJHY_User/LJTableViewCell.h b/LJHY_User/BaseView/LJTableViewCell.h similarity index 100% rename from LJHY_User/LJTableViewCell.h rename to LJHY_User/BaseView/LJTableViewCell.h diff --git a/LJHY_User/LJTableViewCell.m b/LJHY_User/BaseView/LJTableViewCell.m similarity index 100% rename from LJHY_User/LJTableViewCell.m rename to LJHY_User/BaseView/LJTableViewCell.m diff --git a/LJHY_User/LJView.h b/LJHY_User/BaseView/LJView.h similarity index 100% rename from LJHY_User/LJView.h rename to LJHY_User/BaseView/LJView.h diff --git a/LJHY_User/LJView.m b/LJHY_User/BaseView/LJView.m similarity index 100% rename from LJHY_User/LJView.m rename to LJHY_User/BaseView/LJView.m diff --git a/LJHY_User/Category/NSArray+Log.h b/LJHY_User/Category/NSArray+Log.h new file mode 100755 index 0000000..19a5dc1 --- /dev/null +++ b/LJHY_User/Category/NSArray+Log.h @@ -0,0 +1,9 @@ +#import + +@interface NSArray (Log) + +@end + +@interface NSDictionary (Log) + +@end \ No newline at end of file diff --git a/LJHY_User/Category/NSArray+Log.m b/LJHY_User/Category/NSArray+Log.m new file mode 100755 index 0000000..751a006 --- /dev/null +++ b/LJHY_User/Category/NSArray+Log.m @@ -0,0 +1,37 @@ +#import "NSArray+Log.h" + +@implementation NSArray (Log) + +- (NSString *)descriptionWithLocale:(id)locale +{ + NSMutableString *strM = [NSMutableString stringWithString:@"(\n"]; + + [self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [strM appendFormat:@"\t%@,\n", obj]; + }]; + + [strM appendString:@")"]; + + return strM; +} + +@end + +@implementation NSDictionary (Log) + +- (NSString *)descriptionWithLocale:(id)locale +{ + NSMutableString *strM = [NSMutableString stringWithString:@"{\n"]; + + [self enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + [strM appendFormat:@"\t%@ = %@;\n", key, obj]; + }]; + + [strM appendString:@"}\n"]; + + return strM; +} + + + +@end diff --git a/LJHY_User/Category/NSDate+Helper.h b/LJHY_User/Category/NSDate+Helper.h new file mode 100755 index 0000000..c682d26 --- /dev/null +++ b/LJHY_User/Category/NSDate+Helper.h @@ -0,0 +1,67 @@ +// +// NSDate+Helper.h +// +// Created by Billy Gray on 2/26/09. +// Copyright (c) 2009, 2010, ZETETIC LLC +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of the ZETETIC LLC nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY ZETETIC LLC ''AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL ZETETIC LLC BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#import + +@interface NSDate (Helper) + ++ (void)initializeStatics; + ++ (NSCalendar *)sharedCalendar; ++ (NSDateFormatter *)sharedDateFormatter; +- (NSUInteger)daysAgo; +- (NSUInteger)daysAgoAgainstMidnight; +- (NSString *)stringDaysAgo; +- (NSString *)stringDaysAgoAgainstMidnight:(BOOL)flag; +- (NSUInteger)weekday; +- (NSUInteger)weekNumber; +- (NSUInteger)hour; +- (NSUInteger)minute; +- (NSUInteger)year; +- (long int)utcTimeStamp; //full seconds since ++ (NSDate *)dateFromString:(NSString *)string; ++ (NSDate *)dateFromString:(NSString *)string withFormat:(NSString *)format; ++ (NSString *)stringFromDate:(NSDate *)date withFormat:(NSString *)string; ++ (NSString *)stringFromDate:(NSDate *)date; ++ (NSString *)stringForDisplayFromDate:(NSDate *)date; ++ (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed; ++ (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed alwaysDisplayTime:(BOOL)displayTime; +- (NSString *)string; +- (NSString *)stringWithFormat:(NSString *)format; +- (NSString *)stringWithDateStyle:(NSDateFormatterStyle)dateStyle timeStyle:(NSDateFormatterStyle)timeStyle; +- (NSDate *)beginningOfWeek; +- (NSDate *)beginningOfDay; +- (NSDate *)endOfWeek; ++ (NSString *)dateFormatString; ++ (NSString *)timeFormatString; ++ (NSString *)timestampFormatString; ++ (NSString *)dbFormatString; + +@end diff --git a/LJHY_User/Category/NSDate+Helper.m b/LJHY_User/Category/NSDate+Helper.m new file mode 100755 index 0000000..2c46a3a --- /dev/null +++ b/LJHY_User/Category/NSDate+Helper.m @@ -0,0 +1,333 @@ +// +// NSDate+Helper.h +// +// Created by Billy Gray on 2/26/09. +// Copyright (c) 2009–2012, ZETETIC LLC +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// * Neither the name of the ZETETIC LLC nor the +// names of its contributors may be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY ZETETIC LLC ''AS IS'' AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL ZETETIC LLC BE LIABLE FOR ANY +// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// + +#import "NSDate+Helper.h" + +static NSString *kNSDateHelperFormatFullDateWithTime = @"MMM d, yyyy h:mm a"; +static NSString *kNSDateHelperFormatFullDate = @"MMM d, yyyy"; +static NSString *kNSDateHelperFormatShortDateWithTime = @"MMM d h:mm a"; +static NSString *kNSDateHelperFormatShortDate = @"MMM d"; +static NSString *kNSDateHelperFormatWeekday = @"EEEE"; +static NSString *kNSDateHelperFormatWeekdayWithTime = @"EEEE h:mm a"; +static NSString *kNSDateHelperFormatTime = @"h:mm a"; +static NSString *kNSDateHelperFormatTimeWithPrefix = @"'at' h:mm a"; +static NSString *kNSDateHelperFormatSQLDate = @"yyyy-MM-dd"; +static NSString *kNSDateHelperFormatSQLTime = @"HH:mm:ss"; +static NSString *kNSDateHelperFormatSQLDateWithTime = @"yyyy-MM-dd HH:mm:ss"; + +@implementation NSDate (Helper) + +static NSCalendar *_calendar = nil; +static NSDateFormatter *_displayFormatter = nil; + ++ (void)initializeStatics { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + @autoreleasepool { + if (_calendar == nil) { +#if __has_feature(objc_arc) + _calendar = [NSCalendar currentCalendar]; +#else + _calendar = [[NSCalendar currentCalendar] retain]; +#endif + } + if (_displayFormatter == nil) { + _displayFormatter = [[NSDateFormatter alloc] init]; + } + } + }); +} + ++ (NSCalendar *)sharedCalendar { + [self initializeStatics]; + return _calendar; +} + ++ (NSDateFormatter *)sharedDateFormatter { + [self initializeStatics]; + return _displayFormatter; +} + +/* + * This guy can be a little unreliable and produce unexpected results, + * you're better off using daysAgoAgainstMidnight + */ +- (NSUInteger)daysAgo { + NSCalendar *calendar = [[self class] sharedCalendar]; + NSDateComponents *components = [calendar components:(NSDayCalendarUnit) + fromDate:self + toDate:[NSDate date] + options:0]; + return [components day]; +} + +- (NSUInteger)daysAgoAgainstMidnight { + // get a midnight version of ourself: + NSDateFormatter *mdf = [[self class] sharedDateFormatter]; + [mdf setDateFormat:@"yyyy-MM-dd"]; + NSDate *midnight = [mdf dateFromString:[mdf stringFromDate:self]]; + return (int)[midnight timeIntervalSinceNow] / (60*60*24) *-1; +} + +- (NSString *)stringDaysAgo { + return [self stringDaysAgoAgainstMidnight:YES]; +} + +- (NSString *)stringDaysAgoAgainstMidnight:(BOOL)flag { + NSUInteger daysAgo = (flag) ? [self daysAgoAgainstMidnight] : [self daysAgo]; + NSString *text = nil; + switch (daysAgo) { + case 0: + text = NSLocalizedString(@"今天", nil); + break; + case 1: + text = NSLocalizedString(@"昨天", nil); + break; + default: + text = [NSString stringWithFormat:@"%ld天前", (long)daysAgo]; + } + return text; +} + +- (NSUInteger)hour { + NSCalendar *calendar = [[self class] sharedCalendar]; + NSDateComponents *weekdayComponents = [calendar components:(NSHourCalendarUnit) fromDate:self]; + return [weekdayComponents hour]; +} + +- (NSUInteger)minute { + NSCalendar *calendar = [[self class] sharedCalendar]; + NSDateComponents *weekdayComponents = [calendar components:(NSMinuteCalendarUnit) fromDate:self]; + return [weekdayComponents minute]; +} + +- (NSUInteger)year { + NSCalendar *calendar = [[self class] sharedCalendar]; + NSDateComponents *weekdayComponents = [calendar components:(NSYearCalendarUnit) fromDate:self]; + return [weekdayComponents year]; +} + +- (long int)utcTimeStamp{ + return lround(floor([self timeIntervalSince1970])); +} + +- (NSUInteger)weekday { + NSDateComponents *weekdayComponents = [[[self class] sharedCalendar] components:(NSWeekdayCalendarUnit) fromDate:self]; + return [weekdayComponents weekday]; +} + +- (NSUInteger)weekNumber { + NSCalendar *calendar = [[self class] sharedCalendar]; + NSDateComponents *dateComponents = [calendar components:(NSWeekCalendarUnit) fromDate:self]; + return [dateComponents weekOfYear]; +} + ++ (NSDate *)dateFromString:(NSString *)string { + return [NSDate dateFromString:string withFormat:[NSDate dbFormatString]]; +} + ++ (NSDate *)dateFromString:(NSString *)string withFormat:(NSString *)format { + NSDateFormatter *formatter = [self sharedDateFormatter]; + [formatter setDateFormat:format]; + NSDate *date = [formatter dateFromString:string]; + return date; +} + ++ (NSString *)stringFromDate:(NSDate *)date withFormat:(NSString *)format { + return [date stringWithFormat:format]; +} + ++ (NSString *)stringFromDate:(NSDate *)date { + return [date string]; +} + ++ (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed alwaysDisplayTime:(BOOL)displayTime { + /* + * if the date is in today, display 12-hour time with meridian, + * if it is within the last 7 days, display weekday name (Friday) + * if within the calendar year, display as Jan 23 + * else display as Nov 11, 2008 + */ + NSDate *today = [NSDate date]; + NSDateComponents *offsetComponents = [[self sharedCalendar] components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) + fromDate:today]; + NSDate *midnight = [[self sharedCalendar] dateFromComponents:offsetComponents]; + NSString *displayString = nil; + // comparing against midnight + NSComparisonResult midnight_result = [date compare:midnight]; + if (midnight_result == NSOrderedDescending) { + if (prefixed) { + [[self sharedDateFormatter] setDateFormat:kNSDateHelperFormatTimeWithPrefix]; // at 11:30 am + } else { + [[self sharedDateFormatter] setDateFormat:kNSDateHelperFormatTime]; // 11:30 am + } + } else { + // check if date is within last 7 days + NSDateComponents *componentsToSubtract = [[NSDateComponents alloc] init]; + [componentsToSubtract setDay:-7]; + NSDate *lastweek = [[self sharedCalendar] dateByAddingComponents:componentsToSubtract toDate:today options:0]; +#if !__has_feature(objc_arc) + [componentsToSubtract release]; +#endif + NSComparisonResult lastweek_result = [date compare:lastweek]; + if (lastweek_result == NSOrderedDescending) { + if (displayTime) { + [[self sharedDateFormatter] setDateFormat:kNSDateHelperFormatWeekdayWithTime]; + } else { + [[self sharedDateFormatter] setDateFormat:kNSDateHelperFormatWeekday]; // Tuesday + } + } else { + // check if same calendar year + NSInteger thisYear = [offsetComponents year]; + NSDateComponents *dateComponents = [[self sharedCalendar] components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) + fromDate:date]; + NSInteger thatYear = [dateComponents year]; + if (thatYear >= thisYear) { + if (displayTime) { + [[self sharedDateFormatter] setDateFormat:kNSDateHelperFormatShortDateWithTime]; + } + else { + [[self sharedDateFormatter] setDateFormat:kNSDateHelperFormatShortDate]; + } + } else { + if (displayTime) { + [[self sharedDateFormatter] setDateFormat:kNSDateHelperFormatFullDateWithTime]; + } + else { + [[self sharedDateFormatter] setDateFormat:kNSDateHelperFormatFullDate]; + } + } + } + if (prefixed) { + NSString *dateFormat = [[self sharedDateFormatter] dateFormat]; + NSString *prefix = @"'on' "; + [[self sharedDateFormatter] setDateFormat:[prefix stringByAppendingString:dateFormat]]; + } + } + // use display formatter to return formatted date string + displayString = [[self sharedDateFormatter] stringFromDate:date]; + return displayString; +} + ++ (NSString *)stringForDisplayFromDate:(NSDate *)date prefixed:(BOOL)prefixed { + return [[self class] stringForDisplayFromDate:date prefixed:prefixed alwaysDisplayTime:NO]; +} + ++ (NSString *)stringForDisplayFromDate:(NSDate *)date { + return [self stringForDisplayFromDate:date prefixed:NO]; +} + +- (NSString *)stringWithFormat:(NSString *)format { + [[[self class] sharedDateFormatter] setDateFormat:format]; + NSString *timestamp_str = [[[self class] sharedDateFormatter] stringFromDate:self]; + return timestamp_str; +} + +- (NSString *)string { + return [self stringWithFormat:[NSDate dbFormatString]]; +} + +- (NSString *)stringWithDateStyle:(NSDateFormatterStyle)dateStyle timeStyle:(NSDateFormatterStyle)timeStyle { + [[[self class] sharedDateFormatter] setDateStyle:dateStyle]; + [[[self class] sharedDateFormatter] setTimeStyle:timeStyle]; + NSString *outputString = [[[self class] sharedDateFormatter] stringFromDate:self]; + return outputString; +} + +- (NSDate *)beginningOfWeek { + // largely borrowed from "Date and Time Programming Guide for Cocoa" + // we'll use the default calendar and hope for the best + NSCalendar *calendar = [[self class] sharedCalendar]; + NSDate *beginningOfWeek = nil; + BOOL ok = [calendar rangeOfUnit:NSWeekCalendarUnit startDate:&beginningOfWeek + interval:NULL forDate:self]; + if (ok) { + return beginningOfWeek; + } + // couldn't calc via range, so try to grab Sunday, assuming gregorian style + // Get the weekday component of the current date + NSDateComponents *weekdayComponents = [calendar components:NSWeekdayCalendarUnit fromDate:self]; + /* + Create a date components to represent the number of days to subtract from the current date. + The weekday value for Sunday in the Gregorian calendar is 1, so subtract 1 from the number of days to subtract from the date in question. (If today's Sunday, subtract 0 days.) + */ + NSDateComponents *componentsToSubtract = [[NSDateComponents alloc] init]; + [componentsToSubtract setDay: 0 - ([weekdayComponents weekday] - 1)]; + beginningOfWeek = nil; + beginningOfWeek = [calendar dateByAddingComponents:componentsToSubtract toDate:self options:0]; +#if !__has_feature(objc_arc) + [componentsToSubtract release]; +#endif + //normalize to midnight, extract the year, month, and day components and create a new date from those components. + NSDateComponents *components = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) + fromDate:beginningOfWeek]; + return [calendar dateFromComponents:components]; +} + +- (NSDate *)beginningOfDay { + NSCalendar *calendar = [[self class] sharedCalendar]; + // Get the weekday component of the current date + NSDateComponents *components = [calendar components:(NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit) + fromDate:self]; + return [calendar dateFromComponents:components]; +} + +- (NSDate *)endOfWeek { + NSCalendar *calendar = [[self class] sharedCalendar]; + // Get the weekday component of the current date + NSDateComponents *weekdayComponents = [calendar components:NSWeekdayCalendarUnit fromDate:self]; + NSDateComponents *componentsToAdd = [[NSDateComponents alloc] init]; + // to get the end of week for a particular date, add (7 - weekday) days + [componentsToAdd setDay:(7 - [weekdayComponents weekday])]; + NSDate *endOfWeek = [calendar dateByAddingComponents:componentsToAdd toDate:self options:0]; +#if !__has_feature(objc_arc) + [componentsToAdd release]; +#endif + return endOfWeek; +} + ++ (NSString *)dateFormatString { + return kNSDateHelperFormatSQLDate; +} + ++ (NSString *)timeFormatString { + return kNSDateHelperFormatSQLTime; +} + ++ (NSString *)timestampFormatString { + return kNSDateHelperFormatSQLDateWithTime; +} + +// preserving for compatibility ++ (NSString *)dbFormatString { + return [NSDate timestampFormatString]; +} + +@end diff --git a/LJHY_User/Category/NSString+Hash.h b/LJHY_User/Category/NSString+Hash.h new file mode 100755 index 0000000..6a7b8ab --- /dev/null +++ b/LJHY_User/Category/NSString+Hash.h @@ -0,0 +1,24 @@ +// +// NSString+Hash.h +// +// Created by Tom Corwine on 5/30/12.. +// + +#import + +@interface NSString (Hash) + + + + +@property (readonly)NSString * md5_32Bit; +@property (readonly) NSString *md5String; +@property (readonly) NSString *sha1String; +@property (readonly) NSString *sha256String; +@property (readonly) NSString *sha512String; + +- (NSString *)hmacSHA1StringWithKey:(NSString *)key; +- (NSString *)hmacSHA256StringWithKey:(NSString *)key; +- (NSString *)hmacSHA512StringWithKey:(NSString *)key; + +@end diff --git a/LJHY_User/Category/NSString+Hash.m b/LJHY_User/Category/NSString+Hash.m new file mode 100755 index 0000000..00a8cce --- /dev/null +++ b/LJHY_User/Category/NSString+Hash.m @@ -0,0 +1,102 @@ +// +// NSString+Hash.m +// +// Created by Tom Corwine on 5/30/12. +// + +#import "NSString+hash.h" + +#import +#import + +@implementation NSString (Hash) + + + + +- (NSString *)md5_32Bit { + const char *cStr = [self UTF8String]; + unsigned char digest[CC_MD5_DIGEST_LENGTH]; + CC_MD5( cStr, self.length, digest ); + NSMutableString *result = [NSMutableString stringWithCapacity:CC_MD5_DIGEST_LENGTH * 2]; + for(int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) + [result appendFormat:@"%02x", digest[i]]; + return result; +} + + + +- (NSString *)md5String +{ + const char *string = self.UTF8String; + int length = (int)strlen(string); + unsigned char bytes[CC_MD5_DIGEST_LENGTH]; + CC_MD5(string, length, bytes); + return [self stringFromBytes:bytes length:CC_MD5_DIGEST_LENGTH]; +} + +- (NSString *)sha1String +{ + const char *string = self.UTF8String; + int length = (int)strlen(string); + unsigned char bytes[CC_SHA1_DIGEST_LENGTH]; + CC_SHA1(string, length, bytes); + return [self stringFromBytes:bytes length:CC_SHA1_DIGEST_LENGTH]; +} + +- (NSString *)sha256String +{ + const char *string = self.UTF8String; + int length = (int)strlen(string); + unsigned char bytes[CC_SHA256_DIGEST_LENGTH]; + CC_SHA256(string, length, bytes); + return [self stringFromBytes:bytes length:CC_SHA256_DIGEST_LENGTH]; +} + +- (NSString *)sha512String +{ + const char *string = self.UTF8String; + int length = (int)strlen(string); + unsigned char bytes[CC_SHA512_DIGEST_LENGTH]; + CC_SHA512(string, length, bytes); + return [self stringFromBytes:bytes length:CC_SHA512_DIGEST_LENGTH]; +} + +- (NSString *)hmacSHA1StringWithKey:(NSString *)key +{ + NSData *keyData = [key dataUsingEncoding:NSUTF8StringEncoding]; + NSData *messageData = [self dataUsingEncoding:NSUTF8StringEncoding]; + NSMutableData *mutableData = [NSMutableData dataWithLength:CC_SHA1_DIGEST_LENGTH]; + CCHmac(kCCHmacAlgSHA1, keyData.bytes, keyData.length, messageData.bytes, messageData.length, mutableData.mutableBytes); + return [self stringFromBytes:(unsigned char *)mutableData.bytes length:mutableData.length]; +} + +- (NSString *)hmacSHA256StringWithKey:(NSString *)key +{ + NSData *keyData = [key dataUsingEncoding:NSUTF8StringEncoding]; + NSData *messageData = [self dataUsingEncoding:NSUTF8StringEncoding]; + NSMutableData *mutableData = [NSMutableData dataWithLength:CC_SHA256_DIGEST_LENGTH]; + CCHmac(kCCHmacAlgSHA256, keyData.bytes, keyData.length, messageData.bytes, messageData.length, mutableData.mutableBytes); + return [self stringFromBytes:(unsigned char *)mutableData.bytes length:mutableData.length]; +} + +- (NSString *)hmacSHA512StringWithKey:(NSString *)key +{ + NSData *keyData = [key dataUsingEncoding:NSUTF8StringEncoding]; + NSData *messageData = [self dataUsingEncoding:NSUTF8StringEncoding]; + NSMutableData *mutableData = [NSMutableData dataWithLength:CC_SHA512_DIGEST_LENGTH]; + CCHmac(kCCHmacAlgSHA512, keyData.bytes, keyData.length, messageData.bytes, messageData.length, mutableData.mutableBytes); + return [self stringFromBytes:(unsigned char *)mutableData.bytes length:mutableData.length]; +} + +#pragma mark - Helpers + +- (NSString *)stringFromBytes:(unsigned char *)bytes length:(int)length +{ + NSMutableString *mutableString = @"".mutableCopy; + for (int i = 0; i < length; i++) + [mutableString appendFormat:@"%02x", bytes[i]]; + return [NSString stringWithString:mutableString]; +} + +@end diff --git a/LJHY_User/Category/NSString+Valid.h b/LJHY_User/Category/NSString+Valid.h new file mode 100644 index 0000000..07c9c1c --- /dev/null +++ b/LJHY_User/Category/NSString+Valid.h @@ -0,0 +1,21 @@ +/************************************************************ + * * EaseMob CONFIDENTIAL + * __________________ + * Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of EaseMob Technologies. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from EaseMob Technologies. + */ + +#import + +@interface NSString (Valid) +-(BOOL)isChinese; + + +- (BOOL)isUrl; + +@end diff --git a/LJHY_User/Category/NSString+Valid.m b/LJHY_User/Category/NSString+Valid.m new file mode 100644 index 0000000..957c61b --- /dev/null +++ b/LJHY_User/Category/NSString+Valid.m @@ -0,0 +1,40 @@ +/************************************************************ + * * EaseMob CONFIDENTIAL + * __________________ + * Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of EaseMob Technologies. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from EaseMob Technologies. + */ + +#import "NSString+Valid.h" + +@implementation NSString (Valid) +-(BOOL)isChinese{ + NSString *match=@"(^[\u4e00-\u9fa5]+$)"; + NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF matches %@", match]; + return [predicate evaluateWithObject:self]; +} + +- (BOOL)isUrl +{ + if(self == nil) + return NO; + NSString *url; + if (self.length>4 && [[self substringToIndex:4] isEqualToString:@"www."]) { + url = [NSString stringWithFormat:@"http://%@",self]; + }else{ + url = self; + } + + NSString *urlRegex1 = @"((http|Http|ftp|https|Https)://)(([a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,6})|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,4})*(/[a-zA-Z0-9\\&%_\\./-~-]*)?"; + +// NSString *urlRegex = @"(Http|Https|https|http|ftp|rtsp|igmp|file|rtspt|rtspu)://((((25[0-5]|2[0-4]\\d|1?\\d?\\d)\\.){3}(25[0-5]|2[0-4]\\d|1?\\d?\\d))|([0-9a-z_!~*'()-]*\\.?))([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\\.([a-z]{2,6})(:[0-9]{1,4})?([a-zA-Z/?_=]*)\\.\\w{1,5}"; + NSPredicate* urlTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", urlRegex1]; + return [urlTest evaluateWithObject:url]; +} + +@end diff --git a/LJHY_User/Category/NSString+call.h b/LJHY_User/Category/NSString+call.h new file mode 100644 index 0000000..7ab0609 --- /dev/null +++ b/LJHY_User/Category/NSString+call.h @@ -0,0 +1,16 @@ +// +// NSString+call.h +// kangzhipifuyisheng +// +// Created by 唐开江 on 15/6/4. +// Copyright (c) 2015年 KangZhi. All rights reserved. +// + +#import + +@interface NSString (call) +//--- ----------------打电话------ + ++ (void)callTeleWithPhoneNumber:(NSString *)phone; + +@end diff --git a/LJHY_User/Category/NSString+call.m b/LJHY_User/Category/NSString+call.m new file mode 100644 index 0000000..e8fd57a --- /dev/null +++ b/LJHY_User/Category/NSString+call.m @@ -0,0 +1,31 @@ +// +// NSString+call.m +// kangzhipifuyisheng +// Created by 唐开江 on 15/6/4. +// Copyright (c) 2015年 KangZhi. All rights reserved. +// + +// +#import "NSString+call.h" + +@implementation NSString (call) +//--- ----------------打电话------ + ++ (void)callTeleWithPhoneNumber:(NSString *)phone +{ +//NSLog(@"打电话"); +//NSString *phone = self.orderInformationModel.userTel; + if (phone != nil) { + + NSString *telUrl = [NSString stringWithFormat:@"telprompt:%@",phone]; + + NSURL *url = [[NSURL alloc] initWithString:telUrl]; + + [[UIApplication sharedApplication] openURL:url]; + + } + + +} + +@end diff --git a/LJHY_User/Category/NSString+checkTeleNumber.h b/LJHY_User/Category/NSString+checkTeleNumber.h new file mode 100644 index 0000000..52c27b9 --- /dev/null +++ b/LJHY_User/Category/NSString+checkTeleNumber.h @@ -0,0 +1,15 @@ +// +// NSString+checkTeleNumber.h +// kangzhipifuyisheng +// +// Created by 唐开江 on 15/7/11. +// Copyright (c) 2015年 KangZhi. All rights reserved. +// 检查电话是否正确 + +#import + +@interface NSString (checkTeleNumber) +//- (BOOL)checkTel:(NSString *)str; ++ (BOOL)isMobileNumber:(NSString *)mobileNum; + +@end diff --git a/LJHY_User/Category/NSString+checkTeleNumber.m b/LJHY_User/Category/NSString+checkTeleNumber.m new file mode 100644 index 0000000..dc0a339 --- /dev/null +++ b/LJHY_User/Category/NSString+checkTeleNumber.m @@ -0,0 +1,91 @@ +// +// NSString+checkTeleNumber.m +// kangzhipifuyisheng +// +// Created by 唐开江 on 15/7/11. +// Copyright (c) 2015年 KangZhi. All rights reserved. +// + +#import "NSString+checkTeleNumber.h" + +@implementation NSString (checkTeleNumber) +/* +- (BOOL)checkTel:(NSString *)str + +{ + + if ([str length] == 0) { + return NO; + } + + //1[0-9]{10} + + //^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$ + + // NSString *regex = @"[0-9]{11}"; + + NSString *regex = @"^((13[0-9])|(147)|(15[^4,\\D])|(18[0,5-9]))\\d{8}$"; + + NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; + + BOOL isMatch = [pred evaluateWithObject:str]; + + if (!isMatch) { + return NO; + } + + return YES; + +} +*/ ++ (BOOL)isMobileNumber:(NSString *)mobileNum +{ + /** + * 手机号码 + * 移动:134[0-8],135,136,137,138,139,150,151,157,158,159,182,187,188 + * 联通:130,131,132,152,155,156,185,186 + * 电信:133,1349,153,180,189 + */ + NSString * MOBILE = @"^1(3[0-9]|5[0-35-9]|8[0235-9])\\d{8}$"; + /** + 10 * 中国移动:China Mobile + 11 * 134[0-8],135,136,137,138,139,150,151,157,158,159,182,183,187,188 + 12 */ + NSString * CM = @"^1(34[0-8]|(3[5-9]|5[017-9]|8[278])\\d)\\d{7}$"; + /** + 15 * 中国联通:China Unicom + 16 * 130,131,132,152,155,156,185,186 + 17 */ + NSString * CU = @"^1(3[0-2]|5[256]|8[56])\\d{8}$"; + /** + 20 * 中国电信:China Telecom + 21 * 133,1349,153,180,189 + 22 */ + NSString * CT = @"^1((33|53|8[09])[0-9]|349)\\d{7}$"; + /** + 25 * 大陆地区固话及小灵通 + 26 * 区号:010,020,021,022,023,024,025,027,028,029 + 27 * 号码:七位或八位 + 28 */ + // NSString * PHS = @"^0(10|2[0-5789]|\\d{3})\\d{7,8}$"; + + NSPredicate *regextestmobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", MOBILE]; + NSPredicate *regextestcm = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CM]; + NSPredicate *regextestcu = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CU]; + NSPredicate *regextestct = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CT]; + + if (([regextestmobile evaluateWithObject:mobileNum] == YES) + || ([regextestcm evaluateWithObject:mobileNum] == YES) + || ([regextestct evaluateWithObject:mobileNum] == YES) + || ([regextestcu evaluateWithObject:mobileNum] == YES)) + { + return YES; + } + else + { + return NO; + } +} + + +@end diff --git a/LJHY_User/Category/NSString+timeStamp.h b/LJHY_User/Category/NSString+timeStamp.h new file mode 100644 index 0000000..63ca66b --- /dev/null +++ b/LJHY_User/Category/NSString+timeStamp.h @@ -0,0 +1,71 @@ +// +// NSString+timeStamp.h +// kangzhipifuyisheng +// +// Created by 唐开江 on 15/6/3. +// Copyright (c) 2015年 KangZhi. All rights reserved. +// + +#import + +@interface NSString (timeStamp) + +//--------------------处理时间 (将时间戳转成字符串)-------------------- ++ (NSString *)dealWithTimestamp:(NSString *)timeStamp; + +//--------------------处理时间 (将时间戳转成字符串,自定义时间格式)-------------------- ++ (NSString *)dealWithTimestamp:(NSString *)timeStamp withFormaterStr:(NSString *)formatter; + + +//根据时间戳获取星期几(新方法) ++ (NSString *)getWeekDayFordate:(double)data; + +//--------------------给予时间戳返回星期几------- ++ (NSString *)switchToWeekWithTimeStamp:(NSTimeInterval )timeStamp; + +//----------将时间戳转成年月日(麻烦)--------------- ++ (NSDateComponents *)switchToDateComponentsWithTimeStamp:(NSString *)timeStamp; +//----------------------nsstring 转 nsdate---- +//输入的日期字符串形如:@"1992-05-21 13:08:08" ++ (NSDate *)dateFromString:(NSString *)dateString; + +//输入的日期字符串形 如:@"1992-05-21 13:08:08",带一个format 参数 ++ (NSDate *)dateFromString:(NSString *)dateString andFormat:(NSString *)format; + + +//------------------时间转时间戳------------ + ++ (NSString *)switchToTimeStampWithTimeStr:(NSString *)timeStr; +//------------------判断时间是上午下午------ ++ (NSString *)switchTimeToNoon:(NSString *)timeStr; + + + +//------------------根据时间戳返回 x分钟前/x小时前/昨天/x天前/x个月前/x年前----- ++ (NSString *)timeInfoWithDateString2:(NSString *)dateString; + + +//--------------- 第二种 -根据时间戳返回 x分钟前/x小时前/昨天/x天前/x个月前/x年 前----- +- (NSString *)getUTCFormateDate:(NSString *)newsDate; + + +//获得当前时间戳 ++ (NSString *)getCurrentTimeStamp; + +//获得当天0点,时间戳 ++ (NSString *)getTodayZeroClickTimeStamp; + +//传入某天返回某天0点时间戳 ++ (NSString *)getZeroClickTime:(NSString *)timeStamp; + +//nsDate 转成时间戳 ++ (NSString *)DateToStringWithDate:(NSDate *)date; + +//时间转成时间戳 @"YYYY-MM-dd" ++ (NSString *)switchToTimeStampWithTimeStr:(NSString *)timeStr withFormat:(NSString *)format; + + + + + +@end diff --git a/LJHY_User/Category/NSString+timeStamp.m b/LJHY_User/Category/NSString+timeStamp.m new file mode 100644 index 0000000..c0216a2 --- /dev/null +++ b/LJHY_User/Category/NSString+timeStamp.m @@ -0,0 +1,460 @@ +// +// NSString+timeStamp.m +// kangzhipifuyisheng +// +// Created by 唐开江 on 15/6/3. +// Copyright (c) 2015年 KangZhi. All rights reserved. +// + +#import "NSString+timeStamp.h" +//#import "NSDate+divisionTime.h" + +#define KTimeFormart @"YYYY-MM-dd hh:mm:ss" + + +@implementation NSString (timeStamp) + + ++ (NSString *)dealWithTimestamp:(NSString *)timeStamp withFormaterStr:(NSString *)formatter +{ + + + NSDateFormatter* formatter1 = [[NSDateFormatter alloc] init]; +// [formatter1 setDateStyle:NSDateFormatterMediumStyle]; +// [formatter1 setTimeStyle:NSDateFormatterShortStyle]; + [formatter1 setDateFormat:formatter]; +// NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"]; +// [formatter1 setTimeZone:timeZone]; + +// NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:[timeStamp integerValue]]; + + NSTimeInterval time = [timeStamp integerValue] ; + NSDate * date = [NSDate dateWithTimeIntervalSince1970:time]; + NSString *timeStr = [formatter1 stringFromDate:date]; + + return timeStr; + + +} + + +//--------------------处理时间 (将时间戳转成字符串)-------------------- ++ (NSString *)dealWithTimestamp:(NSString *)timeStamp +{ + + NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; + [formatter setDateStyle:NSDateFormatterMediumStyle]; + [formatter setTimeStyle:NSDateFormatterShortStyle]; + [formatter setDateFormat:KTimeFormart]; + NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"]; + [formatter setTimeZone:timeZone]; + NSDate *confromTimesp = [NSDate dateWithTimeIntervalSince1970:[timeStamp integerValue]]; + + NSString *timeStr = [formatter stringFromDate:confromTimesp]; + return timeStr; + +} + + +//--------------------给予时间戳返回星期几------- ++ (NSString *)switchToWeekWithTimeStamp:(NSTimeInterval )timeStamp +{ + + NSDateFormatter* formatter = [[NSDateFormatter alloc] init]; + [formatter setDateStyle:NSDateFormatterMediumStyle]; + [formatter setTimeStyle:NSDateFormatterShortStyle]; + [formatter setDateFormat:@"YYYY-MM-dd"]; + NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"]; + [formatter setTimeZone:timeZone]; + NSDate *now = [NSDate dateWithTimeIntervalSince1970:timeStamp]; + + + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; + // NSDate *now = [NSDate dateWithTimeIntervalSinceNow:timeStamp];; + + NSDateComponents *comps = [[NSDateComponents alloc] init]; + NSInteger unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSWeekdayCalendarUnit | + NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit; + + comps = [calendar components:unitFlags fromDate:now]; + NSInteger week = [comps weekOfMonth]; + + if(week==1) + { + return @"周日"; + }else if(week==2){ + return @"周一"; + + }else if(week==3){ + return @"周二"; + + }else if(week==4){ + return @"周三"; + + }else if(week==5){ + return @"周四"; + + }else if(week==6){ + return @"周五"; + + }else { + return @"周二"; + + } + +} +//----------将时间戳转成年月日(麻烦)--------------- + ++ (NSDateComponents *)switchToDateComponentsWithTimeStamp:(NSString *)timeStamp +{ + + NSString * timeStr = [NSString dealWithTimestamp:timeStamp]; + NSDate * datenow = [NSString dateFromString:timeStr]; +// NSDate *datenow = [NSDate date]; + NSCalendar *calendar = [NSCalendar currentCalendar]; + int unit = NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour|NSCalendarUnitMinute; + NSDateComponents *cmps = [calendar components:unit fromDate:datenow]; +// NSLog(@"%d-%d-%d",cmps.year,cmps.month,cmps.day); + return cmps; +} + + + +//根据时间戳获取星期几(新方法) ++ (NSString *)getWeekDayFordate:(double)data +{ + NSArray *weekday = [NSArray arrayWithObjects: [NSNull null], @"周日", @"周一", @"周二", @"周三", @"周四", @"周五", @"周六", nil]; + + NSDate *newDate = [NSDate dateWithTimeIntervalSince1970:data]; + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; + NSDateComponents *components = [calendar components:NSWeekdayCalendarUnit fromDate:newDate]; + + NSString *weekStr = [weekday objectAtIndex:components.weekday]; + return weekStr; +} + + +//----------------------nsstring 转 nsdate +//输入的日期字符串形如:@"1992-05-21 13:08:08" ++ (NSDate *)dateFromString:(NSString *)dateString{ + NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat: KTimeFormart]; + NSDate *firstDay= [dateFormatter dateFromString:dateString]; + + return firstDay; +} + ++ (NSDate *)dateFromString:(NSString *)dateString andFormat:(NSString *)format +{ + + //设置时区,系统默认的是utc + NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"]; + + NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat: format]; + + //设置中文 + dateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; + +// NSTimeZone *localTimeZone = [NSTimeZone localTimeZone]; + [dateFormatter setTimeZone:timeZone]; + NSDate *firstDay= [dateFormatter dateFromString:dateString]; + return firstDay; + +} + + + + + +//------------------时间转时间戳------------ + ++ (NSString *)switchToTimeStampWithTimeStr:(NSString *)timeStr +{ +// NSString* timeStr = fileModel.rightContentStr; + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateStyle:NSDateFormatterMediumStyle]; + [formatter setTimeStyle:NSDateFormatterShortStyle]; + [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; // ----------设置你想要的格式,hh与HH的区别:分别表示12小时制,24小时制 + + NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"]; + [formatter setTimeZone:timeZone]; + + NSDate* date = [formatter dateFromString:timeStr]; //------------将字符串按formatter转成nsdate + + NSDate *datenow = [NSDate date];//现在时间,你可以输出来看下是什么格式 + + + //时间转时间戳的方法:(时间差) + NSString * timeSp = [NSString stringWithFormat:@"%ld", (long)[[[NSDate alloc]init] timeIntervalSinceDate:date]- (long)[datenow timeIntervalSince1970]]; + + return timeSp; + +} + +// 判断是上午还是下午 + ++ (NSString *)switchTimeToNoon:(NSString *)timeStr +{ + NSDateFormatter * dateFormatter = [[NSDateFormatter alloc] init]; +// NSDate *firstDay= [dateFormatter dateFromString:timeStr]; + [dateFormatter setDateFormat:@"HH"]; + NSString *str = [dateFormatter stringFromDate:[NSDate date]]; + int time = [str intValue]; + if (time>=0||time<=12) { + return @"上午"; + } + else{ + return @"下午午"; + } + + +} + + + +/** + * Retain a formated string with a real date string + * + * @param dateString a real date string, which can be converted to a NSDate object + * + * @return a string that will be x分钟前/x小时前/昨天/x天前/x个月前/x年前 + */ ++ (NSString *)timeInfoWithDateString2:(NSString *)dateString { + + + /* + // 把日期字符串格式化为日期对象 + + NSString * newTimeStr = [self dealWithTimestamp:dateString]; + NSDate *date = [NSDate dateFromString:newTimeStr withFormat:KTimeFormart];//@"yyyy-MM-dd HH:mm:ss" + + NSDate *curDate = [NSDate date]; + NSTimeInterval time = -[date timeIntervalSinceDate:curDate]; + + int month = (int)([curDate getMonth] - [date getMonth]); + int year = (int)([curDate getYear] - [date getYear]); + int day = (int)([curDate getDay] - [date getDay]); + + NSTimeInterval retTime = 1.0; + // 小于一小时 + if (time < 3600) { + retTime = time / 60; + retTime = retTime <= 0.0 ? 1.0 : retTime; + return [NSString stringWithFormat:@"%.0f分钟前", retTime]; + } + // 小于一天,也就是今天 + else if (time < 33600 * 24) { + retTime = time / 3600; + retTime = retTime <= 0.0 ? 1.0 : retTime; + return [NSString stringWithFormat:@"%.0f小时前", retTime]; + } + // 昨天 + else if (time < 33600 * 224 * 2) { + return @"昨天"; + } + // 第一个条件是同年,且相隔时间在一个月内 + // 第二个条件是隔年,对于隔年,只能是去年12月与今年1月这种情况 + else if ((abs(year) == 0 && abs(month) <= 1) + || (abs(year) == 1 && [curDate getMonth] == 1 && [date getMonth] == 12)) { + int retDay = 0; + // 同年 + if (year == 0) { + // 同月 + if (month == 0) { + retDay = day; + } + } + + if (retDay <= 0) { + // 这里按月最大值来计算 + // 获取发布日期中,该月总共有多少天 + int totalDays = [NSDate daysInMonth:(int)[date getMonth] year:(int)[date getYear]]; + // 当前天数 + (发布日期月中的总天数-发布日期月中发布日,即等于距离今天的天数) + retDay = (int)[curDate getDay] + (totalDays - (int)[date getDay]); + + if (retDay >= totalDays) { + return [NSString stringWithFormat:@"%d个月前", (abs)(MAX(retDay / 31, 1))]; + } + } + + return [NSString stringWithFormat:@"%d天前", (abs)(retDay)]; + } else { + if (abs(year) <= 1) { + if (year == 0) { // 同年 + return [NSString stringWithFormat:@"%d个月前", abs(month)]; + } + + // 相差一年 + int month = (int)[curDate getMonth]; + int preMonth = (int)[date getMonth]; + + // 隔年,但同月,就作为满一年来计算 + if (month == 12 && preMonth == 12) { + return @"1年前"; + } + + // 也不看,但非同月 + return [NSString stringWithFormat:@"%d个月前", (abs)(12 - preMonth + month)]; + } + + return [NSString stringWithFormat:@"%d年前", abs(year)]; + } + + return @"1小时前"; + + + */ + + + NSString * newTimeStr = [self dealWithTimestamp:dateString]; + + return [[[self alloc]init] getUTCFormateDate:newTimeStr]; +} + + +-(NSString *)getUTCFormateDate:(NSString *)newsDate +{ + //    newsDate = @"2013-08-09 17:01"; + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; + [dateFormatter setDateFormat:KTimeFormart];//@"yyyy-MM-dd HH:mm" + + // NSLog(@"newsDate = %@",newsDate); + NSDate *newsDateFormatted = [dateFormatter dateFromString:newsDate]; +// NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"]; + NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"]; + + [dateFormatter setTimeZone:timeZone]; + + NSDate* current_date = [[NSDate alloc] init]; + NSString *currentTime = [dateFormatter stringFromDate:current_date]; + NSDate* current_date0 = [NSString dateFromString:currentTime]; + + + NSTimeInterval time0=[current_date0 timeIntervalSinceDate:newsDateFormatted];//间隔的秒数 + NSTimeInterval time = fabs(time0); +// int toalTime = (int)time; + + int month=((int)time)/(3600*24*30); + int days=((int)time)/(3600*24); + int hours=((int)time)%(3600*24)/3600; + int minute=((int)time)%(3600*24)/60; + // NSLog(@"time=%f",(double)time); + + NSString *dateContent; + + if(month!=0){ + + dateContent = [NSString stringWithFormat:@"%@%i%@",@"",month,@"个月前"]; + + }else if(days!=0){ + + dateContent = [NSString stringWithFormat:@"%@%i%@",@"",days,@"天前"]; + }else if(hours!=0){ + + dateContent = [NSString stringWithFormat:@"%@%i%@",@"",hours,@"小时前"]; + }else { + + dateContent = [NSString stringWithFormat:@"%@%i%@",@"",minute,@"分钟前"]; + } + + //    NSString *dateContent=[[NSString alloc] initWithFormat:@"%i天%i小时",days,hours]; + + return dateContent; +} + +/* + 1. + + NSDate *localDate = [NSDate date]; //获取当前时间 + NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)[localDate timeIntervalSince1970]]; //转化为UNIX时间戳 + NSLog(@"timeSp:%@",timeSp); //时间戳的值 + + 2. + + NSDate* dat = [NSDate dateWithTimeIntervalSinceNow:0]; + NSTimeInterval a=[dat timeIntervalSince1970]*1000; // *1000 是精确到毫秒,不乘就是精确到秒 + NSString *timeString = [NSString stringWithFormat:@"%f", a]; //转为字符型 + + 3. + + NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)[[NSDate date] timeIntervalSince1970]]; + + 4. + + NSLog(@"%ld", time(NULL)); // 这句也可以获得时间戳,跟上面一样,精确到秒 + +*/ +//获取当前时间戳 ++ (NSString *)getCurrentTimeStamp +{ + NSDate *localDate = [NSDate date]; //获取当前时间 + NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)[localDate timeIntervalSince1970]]; + return timeSp; +} + ++ (NSString *)DateToStringWithDate:(NSDate *)date +{ + + //时间转时间戳的方法:(时间差) + NSString * timeSp = [NSString stringWithFormat:@"%ld", (long)[date timeIntervalSince1970]]; + return timeSp; + + +} + + + + ++ (NSString *)switchToTimeStampWithTimeStr:(NSString *)timeStr withFormat:(NSString *)format; +{ + + NSDate * date =[NSString dateFromString:timeStr andFormat:format]; + + NSString *dateString = [self DateToStringWithDate:date]; + + return dateString; +} + + + ++ (NSString *)getTodayZeroClickTimeStamp +{ + + + NSInteger today = [[NSString getCurrentTimeStamp] integerValue]; + +#warning --这里的时间没有到0点,减去8个小时 + NSInteger time = today-(today%86400)-8*60*60; + NSString * str = [NSString stringWithFormat:@"%zd",time]; + + return str; + +} + + ++ (NSString *)getZeroClickTime:(NSString *)timeStamp +{ + + NSInteger time =[timeStamp integerValue]; + NSInteger zeroTime = time-(time%86400)-8*60*60; + NSString * zeroTimeStr = [NSString stringWithFormat:@"%zd",zeroTime]; + + return zeroTimeStr; +} + +//----------另一种获取当前当前年月日(麻烦)--------------- +//NSDate * current = [NSDate date]; +//NSString *currentDateSTr = [formatter stringFromDate:current]; +//// NSArray * birthGroup = [currentDateSTr componentsSeparatedByString:@"-"]; +// +//int year = [[currentDateSTr substringToIndex:4] intValue]; +// +//NSRange range = {5,2}; +//int month =[[currentDateSTr substringWithRange:range] intValue]; +// +//NSRange range1 = {8,2}; +//int day = [[currentDateSTr substringWithRange:range1] intValue]; + + +@end diff --git a/LJHY_User/Category/UIImage+Help.h b/LJHY_User/Category/UIImage+Help.h new file mode 100644 index 0000000..fb1a1c3 --- /dev/null +++ b/LJHY_User/Category/UIImage+Help.h @@ -0,0 +1,18 @@ +// +// UIImage+Help.h +// 03-QQ聊天 +// +// Created by apple on 14-7-27. +// Copyright (c) 2014年 itcast. All rights reserved. +// + +#import + +@interface UIImage (Help) + +/** + * 返回一个可以随意拉伸的不变形的图片 + */ ++ (UIImage *)resizableImage:(NSString *)name; + +@end diff --git a/LJHY_User/Category/UIImage+Help.m b/LJHY_User/Category/UIImage+Help.m new file mode 100644 index 0000000..f3dafc5 --- /dev/null +++ b/LJHY_User/Category/UIImage+Help.m @@ -0,0 +1,25 @@ +// +// UIImage+Help.m +// 03-QQ聊天 +// +// Created by apple on 14-7-27. +// Copyright (c) 2014年 itcast. All rights reserved. +// + +#import "UIImage+Help.h" + +@implementation UIImage (Help) ++ (UIImage *)resizableImage:(NSString *)name +{ + // 想把图片的拉伸这个功能封装起来 + UIImage *normal = [UIImage imageNamed:name]; + CGFloat w = normal.size.width * 0.5; + CGFloat h = normal.size.height * 0.5; + + return [normal resizableImageWithCapInsets:UIEdgeInsetsMake(h, w, h, w)]; + + + +} + +@end diff --git a/LJHY_User/Category/UIImage+ImageWithColor.h b/LJHY_User/Category/UIImage+ImageWithColor.h new file mode 100755 index 0000000..f6bdd65 --- /dev/null +++ b/LJHY_User/Category/UIImage+ImageWithColor.h @@ -0,0 +1,36 @@ +//mxclmade + +#import + + +@interface UIImage (WithColor) + +/** + Returns a 1x1 image with the single pixel set to the specified color. + + Usage Note: almost all of UIKit will stretch this UIImage when you set + it as, eg. backgroundImage, hence you often don’t need the size variant. + */ ++ (UIImage * _Nonnull)imageWithColor:(UIColor * _Nonnull)color; + +/** + Returns an image of the requested size filled with the provided color. + */ ++ (UIImage * _Nonnull)imageWithColor:(UIColor * _Nonnull)color size:(CGSize)size; + +/** + Returns a (minimal) resizable image with the requested corner radius and + filled with the provided color. + */ ++ (UIImage * _Nonnull)resizableImageWithColor:(UIColor * _Nonnull)color cornerRadius:(CGFloat)cornerRadius NS_SWIFT_NAME(init(color:cornerRadius:)); + + +//+ (UIImage *_Nonnull)resizableImageWithColor:(UIColor *_Nonnull)color borderColor:(UIColor *_Nonnull)bdColor cornerRadius:(CGFloat)cornerRadius; + +/** + 画出一个随意拉伸的边框,lineWidth: 等于零,没有边框,cornerRadius:圆角半径 + */ ++ (UIImage *_Nonnull)resizableImageWithColor:(UIColor *_Nonnull)color width:(CGFloat)width lineWidth:(CGFloat)lineWidth borderColor:(UIColor *_Nonnull)bdColor cornerRadius:(CGFloat)cornerRadius; + + +@end diff --git a/LJHY_User/Category/UIImage+ImageWithColor.m b/LJHY_User/Category/UIImage+ImageWithColor.m new file mode 100755 index 0000000..053b7bf --- /dev/null +++ b/LJHY_User/Category/UIImage+ImageWithColor.m @@ -0,0 +1,115 @@ +//mxclmade + +#import "UIImage+ImageWithColor.h" + +static NSCache *imageCache; + +@implementation UIImage (WithColor) + ++ (UIImage *)imageWithColor:(UIColor *)color { + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + imageCache = [[NSCache alloc] init]; + }); + + UIImage *image = [imageCache objectForKey:color]; + if (image) { + return image; + } + + image = [self imageWithColor:color size:CGSizeMake(1,1)]; + [imageCache setObject:image forKey:color]; + + return image; +} + ++ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size { + CGRect rect = CGRectMake(0, 0, size.width, size.height); + UIGraphicsBeginImageContext(rect.size); + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextSetFillColorWithColor(context, [color CGColor]); + CGContextFillRect(context, rect); + + UIImage *img = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return img; +} + ++ (UIImage *)resizableImageWithColor:(UIColor *)color cornerRadius:(CGFloat)cornerRadius { + CGFloat minEdgeSize = cornerRadius * 2 + 1; + CGRect rect = CGRectMake(0, 0, minEdgeSize, minEdgeSize); + UIBezierPath *roundedRect = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius]; + roundedRect.lineWidth = 0; + + UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0.0f); + [color setFill]; + [roundedRect fill]; + [roundedRect stroke]; + [roundedRect addClip]; + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return [image resizableImageWithCapInsets:UIEdgeInsetsMake(cornerRadius, cornerRadius, cornerRadius, cornerRadius)]; +} + + ++ (UIImage *)resizableImageWithColor:(UIColor *)color borderColor:(UIColor *)bdColor cornerRadius:(CGFloat)cornerRadius { + CGFloat minEdgeSize = cornerRadius * 2 + 1; + CGRect rect = CGRectMake(0, 0, minEdgeSize, minEdgeSize); + UIBezierPath *roundedRect = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:cornerRadius]; + roundedRect.lineWidth = 0.7; + + UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0.0f); + [bdColor setStroke]; + + [color setFill]; + [roundedRect fill]; + [roundedRect stroke]; + [roundedRect addClip]; + [bdColor setStroke]; + + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return [image resizableImageWithCapInsets:UIEdgeInsetsMake(cornerRadius, cornerRadius, cornerRadius, cornerRadius) resizingMode:UIImageResizingModeStretch]; + +} + + ++ (UIImage *)resizableImageWithColor:(UIColor *)color width:(CGFloat)width lineWidth:(CGFloat)lineWidth borderColor:(UIColor *)bdColor cornerRadius:(CGFloat)cornerRadius { + + if (width == 0) + width = 2; + + + if (width - cornerRadius * 2 <= 0) + { + width = cornerRadius * 2 + 1; + } + + + CGRect rect = CGRectMake(0, 0, width, width); + UIBezierPath *roundedRect = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(cornerRadius, cornerRadius, width - cornerRadius * 2, width - cornerRadius * 2) byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(cornerRadius , cornerRadius)]; + +// if (lineWidth == 0) +// lineWidth = 0.7; + + roundedRect.lineWidth = lineWidth; + roundedRect.lineJoinStyle = kCGLineJoinRound; + roundedRect.lineCapStyle = kCGLineCapRound; + roundedRect.miterLimit = 1; + UIGraphicsBeginImageContextWithOptions(rect.size, NO, 0.0f); + [bdColor setStroke]; + [color setFill]; + [roundedRect fill]; + [roundedRect stroke]; + [roundedRect addClip]; + + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return [image resizableImageWithCapInsets:UIEdgeInsetsMake(width * 0.5, width * 0.5, width * 0.5, width * 0.5) resizingMode:UIImageResizingModeStretch]; +} + +@end diff --git a/LJHY_User/UIImage+LJColor.h b/LJHY_User/Category/UIImage+LJColor.h similarity index 100% rename from LJHY_User/UIImage+LJColor.h rename to LJHY_User/Category/UIImage+LJColor.h diff --git a/LJHY_User/UIImage+LJColor.m b/LJHY_User/Category/UIImage+LJColor.m similarity index 100% rename from LJHY_User/UIImage+LJColor.m rename to LJHY_User/Category/UIImage+LJColor.m diff --git a/LJHY_User/Category/UIImage+ResizeImage.h b/LJHY_User/Category/UIImage+ResizeImage.h new file mode 100644 index 0000000..5c48fae --- /dev/null +++ b/LJHY_User/Category/UIImage+ResizeImage.h @@ -0,0 +1,14 @@ +// +// UIImage+ResizeImage.h +// JDMEForIphone +// +// Created by ttkj on 2017/5/17. +// Copyright © 2017年 jd.com. All rights reserved. +// + +#import + +@interface UIImage (ResizeImage) +- (UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize; + +@end diff --git a/LJHY_User/Category/UIImage+ResizeImage.m b/LJHY_User/Category/UIImage+ResizeImage.m new file mode 100644 index 0000000..abb4f87 --- /dev/null +++ b/LJHY_User/Category/UIImage+ResizeImage.m @@ -0,0 +1,70 @@ +// +// UIImage+ResizeImage.m +// JDMEForIphone +// +// Created by ttkj on 2017/5/17. +// Copyright © 2017年 jd.com. All rights reserved. +// + +#import "UIImage+ResizeImage.h" + +@implementation UIImage (ResizeImage) + + +//图片压缩到指定大小 +- (UIImage*)imageByScalingAndCroppingForSize:(CGSize)targetSize +{ + UIImage *sourceImage = self; + UIImage *newImage = nil; + CGSize imageSize = sourceImage.size; + CGFloat width = imageSize.width; + CGFloat height = imageSize.height; + CGFloat targetWidth = targetSize.width; + CGFloat targetHeight = targetSize.height; + CGFloat scaleFactor = 0.0; + CGFloat scaledWidth = targetWidth; + CGFloat scaledHeight = targetHeight; + CGPoint thumbnailPoint = CGPointMake(0.0,0.0); + + if (CGSizeEqualToSize(imageSize, targetSize) == NO) + { + CGFloat widthFactor = targetWidth / width; + CGFloat heightFactor = targetHeight / height; + + if (widthFactor > heightFactor) + scaleFactor = widthFactor; // scale to fit height + else + scaleFactor = heightFactor; // scale to fit width + scaledWidth= width * scaleFactor; + scaledHeight = height * scaleFactor; + + // center the image + if (widthFactor > heightFactor) + { + thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5; + } + else if (widthFactor < heightFactor) + { + thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5; + } + } + + UIGraphicsBeginImageContext(targetSize); // this will crop + + CGRect thumbnailRect = CGRectZero; + thumbnailRect.origin = thumbnailPoint; + thumbnailRect.size.width= scaledWidth; + thumbnailRect.size.height = scaledHeight; + + [sourceImage drawInRect:thumbnailRect]; + + newImage = UIGraphicsGetImageFromCurrentImageContext(); + if(newImage == nil) + NSLog(@"could not scale image"); + + //pop the context to get back to the default + UIGraphicsEndImageContext(); + return newImage; +} + +@end diff --git a/LJHY_User/Category/UIImage+cutCircleImage.h b/LJHY_User/Category/UIImage+cutCircleImage.h new file mode 100644 index 0000000..3fb0704 --- /dev/null +++ b/LJHY_User/Category/UIImage+cutCircleImage.h @@ -0,0 +1,17 @@ +// +// UIImage_cutCircleImage.h +// yiliaotoutiao +// +// Created by Jason T on 16/9/27. +// Copyright © 2016年 YLTT. All rights reserved. +// + +#import + +@interface UIImage (cutCircleImage) + +- (UIImage *)cutCircleImage; +- (UIImage *)setImageSize:(CGSize)size; +@end + + diff --git a/LJHY_User/Category/UIImage+cutCircleImage.m b/LJHY_User/Category/UIImage+cutCircleImage.m new file mode 100644 index 0000000..8b84e78 --- /dev/null +++ b/LJHY_User/Category/UIImage+cutCircleImage.m @@ -0,0 +1,48 @@ +// +// fd.m +// yiliaotoutiao +// +// Created by Jason T on 16/9/27. +// Copyright © 2016年 YLTT. All rights reserved. +// + +#import "UIImage+cutCircleImage.h" + +@implementation UIImage(cutCircleImage) + +//在此之后建议大家尽量不要这么设置, 因为使用图层过量会有卡顿现象, 特别是弄圆角或者阴影会很卡, 如果设置图片圆角我们一般用绘图来做: +/** 设置圆形图片(放到分类中使用) */ +- (UIImage *)cutCircleImage { + UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0); + // 获取上下文 + CGContextRef ctr = UIGraphicsGetCurrentContext(); + // 设置圆形 + CGRect rect = CGRectMake(0, 0, self.size.width, self.size.height); + CGContextAddEllipseInRect(ctr, rect); + // 裁剪 + CGContextClip(ctr); + // 将图片画上去 + [self drawInRect:rect]; + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return image; +} + +- (UIImage *)setImageSize:(CGSize)size { + UIGraphicsBeginImageContextWithOptions(size, NO, 0.0); + // 获取上下文 + CGContextRef ctr = UIGraphicsGetCurrentContext(); + // 设置圆形 + CGRect rect = CGRectMake(0, 0, size.width, size.height); + CGContextAddEllipseInRect(ctr, rect); + // 裁剪 +// CGContextClip(ctr); + // 将图片画上去 + [self drawInRect:rect]; + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return image; +} + + +@end diff --git a/LJHY_User/Category/UIResponder+Router.h b/LJHY_User/Category/UIResponder+Router.h new file mode 100644 index 0000000..78cf20d --- /dev/null +++ b/LJHY_User/Category/UIResponder+Router.h @@ -0,0 +1,26 @@ +/************************************************************ + * * EaseMob CONFIDENTIAL + * __________________ + * Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of EaseMob Technologies. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from EaseMob Technologies. + */ + +#import + +@interface UIResponder (Router) + +/** + * 发送一个路由器消息, 对eventName感兴趣的 UIResponsder 可以对消息进行处理 + * + * @param eventName 发生的事件名称 + * @param userInfo 传递消息时, 携带的数据, 数据传递过程中, 会有新的数据添加 + * + */ +- (void)routerEventWithName:(NSString *)eventName userInfo:(NSDictionary *)userInfo; + +@end diff --git a/LJHY_User/Category/UIResponder+Router.m b/LJHY_User/Category/UIResponder+Router.m new file mode 100644 index 0000000..41eba22 --- /dev/null +++ b/LJHY_User/Category/UIResponder+Router.m @@ -0,0 +1,22 @@ +/************************************************************ + * * EaseMob CONFIDENTIAL + * __________________ + * Copyright (C) 2013-2014 EaseMob Technologies. All rights reserved. + * + * NOTICE: All information contained herein is, and remains + * the property of EaseMob Technologies. + * Dissemination of this information or reproduction of this material + * is strictly forbidden unless prior written permission is obtained + * from EaseMob Technologies. + */ + +#import "UIResponder+Router.h" + +@implementation UIResponder (Router) + +- (void)routerEventWithName:(NSString *)eventName userInfo:(NSDictionary *)userInfo +{ + [[self nextResponder] routerEventWithName:eventName userInfo:userInfo]; +} + +@end diff --git a/LJHY_User/Category/UIScrollView+UITouch.h b/LJHY_User/Category/UIScrollView+UITouch.h new file mode 100644 index 0000000..454d0c7 --- /dev/null +++ b/LJHY_User/Category/UIScrollView+UITouch.h @@ -0,0 +1,13 @@ +// +// UIScrollView+UITouch.h +// kangzhipifuyisheng +// +// Created by 唐开江 on 15/7/1. +// Copyright (c) 2015年 KangZhi. All rights reserved. +// 该分类防止scrollview不能响应点击事件 + +#import + +@interface UIScrollView (UITouch) + +@end diff --git a/LJHY_User/Category/UIScrollView+UITouch.m b/LJHY_User/Category/UIScrollView+UITouch.m new file mode 100644 index 0000000..a9d4ba5 --- /dev/null +++ b/LJHY_User/Category/UIScrollView+UITouch.m @@ -0,0 +1,59 @@ +// +// UIScrollView+UITouch.m +// kangzhipifuyisheng +// +// Created by 唐开江 on 15/7/1. +// Copyright (c) 2015年 KangZhi. All rights reserved. +// + +#import "UIScrollView+UITouch.h" + +@implementation UIScrollView (UITouch) + +/* +//------------在UIScrollview 中重写下面三种方法中的一种,会导致崩溃bug(-[UIKBBlurredKeyView candidateList]) : unrecognized selector sent to instance 0x13617e3d0 +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { + [[self nextResponder] touchesBegan:touches withEvent:event]; + [super touchesBegan:touches withEvent:event]; +} + +-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { + [[self nextResponder] touchesMoved:touches withEvent:event]; + [super touchesMoved:touches withEvent:event]; +} + +- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { + [[self nextResponder] touchesEnded:touches withEvent:event]; + [super touchesEnded:touches withEvent:event]; +} + + +*/ + + +//用以下方法代替 +- (void)awakeFromNib +{ + [super awakeFromNib]; +// UIView * backView = [[UIView alloc]initWithFrame:self.bounds]; + + // 此方法会引起键盘不能正常弹出 + +// UITapGestureRecognizer *tapGr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideKeyboard:)]; +// tapGr.cancelsTouchesInView = NO; +// [self addGestureRecognizer:tapGr]; + + +// [backView addGestureRecognizer:tapGr]; + +// [self addSubview:backView]; +} +// +//- (void)hideKeyboard:(UITapGestureRecognizer *)tapGure +//{ +// [self endEditing:YES]; +//} + + + +@end diff --git a/LJHY_User/Category/UIView+ParentController.h b/LJHY_User/Category/UIView+ParentController.h new file mode 100644 index 0000000..df2b16e --- /dev/null +++ b/LJHY_User/Category/UIView+ParentController.h @@ -0,0 +1,15 @@ +// +// UIView+presentViewController.h +// yiliaotoutiao +// +// Created by Jason T on 16/3/4. +// Copyright © 2016年 YXH. All rights reserved. +// 该分类用于获取当前的控制器 + +#import + +#import +@interface UIView (ParentController) + +-(UIViewController*)parentController; +@end diff --git a/LJHY_User/Category/UIView+ParentController.m b/LJHY_User/Category/UIView+ParentController.m new file mode 100644 index 0000000..37a9486 --- /dev/null +++ b/LJHY_User/Category/UIView+ParentController.m @@ -0,0 +1,25 @@ +// +// UIView+presentViewController.m +// yiliaotoutiao +// +// Created by Jason T on 16/3/4. +// Copyright © 2016年 YXH. All rights reserved. +// + +#import "UIView+ParentController.h" + +@implementation UIView (ParentController) + +-(UIViewController*)parentController { + UIResponder *responder = [self nextResponder]; + while (responder) { + if ([responder isKindOfClass:[UIViewController class]]) { + return (UIViewController*)responder; + } + responder = [responder nextResponder]; + } + return nil; +} + + +@end diff --git a/LJHY_User/Category/UIView+font.h b/LJHY_User/Category/UIView+font.h new file mode 100644 index 0000000..2e52296 --- /dev/null +++ b/LJHY_User/Category/UIView+font.h @@ -0,0 +1,23 @@ +// +// UIView+font.h +// yiliaotoutiao +// +// Created by Jason T on 16/5/17. +// Copyright © 2016年 YLTT. All rights reserved. +// + +#import + +@interface UIView (font) + +@end + + +@interface UIButton (myFont) +@end +@interface UILabel (myFont) +@end + +//@interface UIFont (myfont) +// +//@end \ No newline at end of file diff --git a/LJHY_User/Category/UIView+font.m b/LJHY_User/Category/UIView+font.m new file mode 100644 index 0000000..530b769 --- /dev/null +++ b/LJHY_User/Category/UIView+font.m @@ -0,0 +1,78 @@ +// +// UIView+font.m +// yiliaotoutiao +// +// Created by Jason T on 16/5/17. +// Copyright © 2016年 YLTT. All rights reserved. +// + +#import "UIView+font.h" +#import +#import + + +#define kCustomeSize [UIFont systemFontOfSize: [UIScreen mainScreen].bounds.size.width /400.0 * fontSize] + +@implementation UIView (font) + +@end + + + +@implementation UIButton (myFont) + ++ (void)load +{ + Method imp = class_getInstanceMethod([self class], @selector(initWithCoder:)); + Method myImp = class_getInstanceMethod([self class], @selector(myInitWithCoder:)); + method_exchangeImplementations(imp, myImp); +} + +- (id)myInitWithCoder:(NSCoder*)aDecode +{ + [self myInitWithCoder:aDecode]; + if (self) { + CGFloat fontSize = self.titleLabel.font.pointSize; + self.titleLabel.font = kCustomeSize; + } + return self; +} + +@end + +@implementation UILabel (myFont) + ++ (void)load +{ + Method imp = class_getInstanceMethod([self class], @selector(initWithCoder:)); + Method myImp = class_getInstanceMethod([self class], @selector(myInitWithCoder:)); + method_exchangeImplementations(imp, myImp); +} + +- (id)myInitWithCoder:(NSCoder*)aDecode +{ + [self myInitWithCoder:aDecode]; + if (self) { + CGFloat fontSize = self.font.pointSize; + self.font = kCustomeSize; + + + } + return self; +} + + +@end + + +//@implementation UIFont (myFont) +// +//+ (UIFont *)systemFontOfSize:(CGFloat)fontSize +//{ +// +//// UIFont * font = [UIFont systemFontOfSize: [UIScreen mainScreen].bounds.size.width /400.0 * fontSize]; +// return [UIFont systemFontOfSize: [UIScreen mainScreen].bounds.size.width /400.0 * fontSize]; +// +//} +// +//@end \ No newline at end of file diff --git a/LJHY_User/Category/UIViewController+CurrentVCLogging.h b/LJHY_User/Category/UIViewController+CurrentVCLogging.h new file mode 100644 index 0000000..7652451 --- /dev/null +++ b/LJHY_User/Category/UIViewController+CurrentVCLogging.h @@ -0,0 +1,13 @@ +// +// UIViewController+CurrentVCLogging.h +// zhuyuanbao +// +// Created by Jason T on 16/11/8. +// Copyright © 2016年 KangZhi. All rights reserved. +// + +#import + +@interface UIViewController (CurrentVCLogging) + +@end diff --git a/LJHY_User/LJNavigationController.h b/LJHY_User/Main/LJNavigationController.h similarity index 100% rename from LJHY_User/LJNavigationController.h rename to LJHY_User/Main/LJNavigationController.h diff --git a/LJHY_User/LJNavigationController.m b/LJHY_User/Main/LJNavigationController.m similarity index 100% rename from LJHY_User/LJNavigationController.m rename to LJHY_User/Main/LJNavigationController.m diff --git a/LJHY_User/LJTabBarController.h b/LJHY_User/Main/LJTabBarController.h similarity index 100% rename from LJHY_User/LJTabBarController.h rename to LJHY_User/Main/LJTabBarController.h diff --git a/LJHY_User/LJTabBarController.m b/LJHY_User/Main/LJTabBarController.m similarity index 100% rename from LJHY_User/LJTabBarController.m rename to LJHY_User/Main/LJTabBarController.m diff --git a/LJHY_User/AppDelegate.h b/LJHY_User/Others/AppDelegate.h similarity index 100% rename from LJHY_User/AppDelegate.h rename to LJHY_User/Others/AppDelegate.h diff --git a/LJHY_User/AppDelegate.m b/LJHY_User/Others/AppDelegate.m similarity index 100% rename from LJHY_User/AppDelegate.m rename to LJHY_User/Others/AppDelegate.m diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Contents.json b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Contents.json rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from LJHY_User/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to LJHY_User/Others/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/LJHY_User/Assets.xcassets/Contents.json b/LJHY_User/Others/Assets.xcassets/Contents.json similarity index 100% rename from LJHY_User/Assets.xcassets/Contents.json rename to LJHY_User/Others/Assets.xcassets/Contents.json diff --git a/LJHY_User/Assets.xcassets/LaunchImage.launchimage/Contents.json b/LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Contents.json similarity index 100% rename from LJHY_User/Assets.xcassets/LaunchImage.launchimage/Contents.json rename to LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Contents.json diff --git a/LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png b/LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png similarity index 100% rename from LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png rename to LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-568h@2x.png diff --git a/LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Land-hd55.png b/LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Land-hd55.png similarity index 100% rename from LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Land-hd55.png rename to LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Land-hd55.png diff --git a/LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-ns.png b/LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-ns.png similarity index 100% rename from LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-ns.png rename to LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-ns.png diff --git a/LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-ns@2x.png b/LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-ns@2x.png similarity index 100% rename from LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-ns@2x.png rename to LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Landscape-ns@2x.png diff --git a/LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Port-hd47.png b/LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Port-hd47.png similarity index 100% rename from LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Port-hd47.png rename to LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Port-hd47.png diff --git a/LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Port-hd55.png b/LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Port-hd55.png similarity index 100% rename from LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Port-hd55.png rename to LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Port-hd55.png diff --git a/LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-ns-1.png b/LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-ns-1.png similarity index 100% rename from LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-ns-1.png rename to LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-ns-1.png diff --git a/LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-ns@2x-1.png b/LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-ns@2x-1.png similarity index 100% rename from LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-ns@2x-1.png rename to LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default-Portrait-ns@2x-1.png diff --git a/LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default@2x.png b/LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default@2x.png similarity index 100% rename from LJHY_User/Assets.xcassets/LaunchImage.launchimage/Default@2x.png rename to LJHY_User/Others/Assets.xcassets/LaunchImage.launchimage/Default@2x.png diff --git a/LJHY_User/Assets.xcassets/my_list_back.imageset/Contents.json b/LJHY_User/Others/Assets.xcassets/my_list_back.imageset/Contents.json similarity index 100% rename from LJHY_User/Assets.xcassets/my_list_back.imageset/Contents.json rename to LJHY_User/Others/Assets.xcassets/my_list_back.imageset/Contents.json diff --git a/LJHY_User/Assets.xcassets/my_list_back.imageset/my_list_back@2x.png b/LJHY_User/Others/Assets.xcassets/my_list_back.imageset/my_list_back@2x.png similarity index 100% rename from LJHY_User/Assets.xcassets/my_list_back.imageset/my_list_back@2x.png rename to LJHY_User/Others/Assets.xcassets/my_list_back.imageset/my_list_back@2x.png diff --git a/LJHY_User/Assets.xcassets/my_list_back.imageset/my_list_back@3x.png b/LJHY_User/Others/Assets.xcassets/my_list_back.imageset/my_list_back@3x.png similarity index 100% rename from LJHY_User/Assets.xcassets/my_list_back.imageset/my_list_back@3x.png rename to LJHY_User/Others/Assets.xcassets/my_list_back.imageset/my_list_back@3x.png diff --git a/LJHY_User/Foundation+Log.m b/LJHY_User/Others/Foundation+Log.m similarity index 100% rename from LJHY_User/Foundation+Log.m rename to LJHY_User/Others/Foundation+Log.m diff --git a/LJHY_User/Info.plist b/LJHY_User/Others/Info.plist similarity index 89% rename from LJHY_User/Info.plist rename to LJHY_User/Others/Info.plist index 0f2c6da..8a0546f 100644 --- a/LJHY_User/Info.plist +++ b/LJHY_User/Others/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion en CFBundleDisplayName - 邻家好医 + $(APP_NAME) CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -17,9 +17,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + $(APP_VERSION) CFBundleVersion - 1 + $(APP_BUILD_VERSION) LSRequiresIPhoneOS UIRequiredDeviceCapabilities diff --git a/LJHY_User/LJHYUser-Prefix.pch b/LJHY_User/Others/LJHYUser-Prefix.pch similarity index 100% rename from LJHY_User/LJHYUser-Prefix.pch rename to LJHY_User/Others/LJHYUser-Prefix.pch diff --git a/LJHY_User/main.m b/LJHY_User/Others/main.m similarity index 100% rename from LJHY_User/main.m rename to LJHY_User/Others/main.m diff --git a/LJHY_User/LJDoctorViewController.h b/LJHY_User/Submodule/Doctor/LJDoctorViewController.h similarity index 100% rename from LJHY_User/LJDoctorViewController.h rename to LJHY_User/Submodule/Doctor/LJDoctorViewController.h diff --git a/LJHY_User/LJDoctorViewController.m b/LJHY_User/Submodule/Doctor/LJDoctorViewController.m similarity index 100% rename from LJHY_User/LJDoctorViewController.m rename to LJHY_User/Submodule/Doctor/LJDoctorViewController.m diff --git a/LJHY_User/CTMediator+LJMediatorHomeActions.h b/LJHY_User/Submodule/Home/CTMediator+LJMediatorHomeActions.h similarity index 100% rename from LJHY_User/CTMediator+LJMediatorHomeActions.h rename to LJHY_User/Submodule/Home/CTMediator+LJMediatorHomeActions.h diff --git a/LJHY_User/CTMediator+LJMediatorHomeActions.m b/LJHY_User/Submodule/Home/CTMediator+LJMediatorHomeActions.m similarity index 100% rename from LJHY_User/CTMediator+LJMediatorHomeActions.m rename to LJHY_User/Submodule/Home/CTMediator+LJMediatorHomeActions.m diff --git a/LJHY_User/LJDoctorRequest.h b/LJHY_User/Submodule/Home/LJDoctorRequest.h similarity index 100% rename from LJHY_User/LJDoctorRequest.h rename to LJHY_User/Submodule/Home/LJDoctorRequest.h diff --git a/LJHY_User/LJDoctorRequest.m b/LJHY_User/Submodule/Home/LJDoctorRequest.m similarity index 100% rename from LJHY_User/LJDoctorRequest.m rename to LJHY_User/Submodule/Home/LJDoctorRequest.m diff --git a/LJHY_User/LJHomeViewController.h b/LJHY_User/Submodule/Home/LJHomeViewController.h similarity index 100% rename from LJHY_User/LJHomeViewController.h rename to LJHY_User/Submodule/Home/LJHomeViewController.h diff --git a/LJHY_User/LJHomeViewController.m b/LJHY_User/Submodule/Home/LJHomeViewController.m similarity index 100% rename from LJHY_User/LJHomeViewController.m rename to LJHY_User/Submodule/Home/LJHomeViewController.m diff --git a/LJHY_User/Target_Home.h b/LJHY_User/Submodule/Home/Target_Home.h similarity index 100% rename from LJHY_User/Target_Home.h rename to LJHY_User/Submodule/Home/Target_Home.h diff --git a/LJHY_User/Target_Home.m b/LJHY_User/Submodule/Home/Target_Home.m similarity index 100% rename from LJHY_User/Target_Home.m rename to LJHY_User/Submodule/Home/Target_Home.m diff --git a/LJHY_User/LJPersonalViewController.h b/LJHY_User/Submodule/Personal/LJPersonalViewController.h similarity index 100% rename from LJHY_User/LJPersonalViewController.h rename to LJHY_User/Submodule/Personal/LJPersonalViewController.h diff --git a/LJHY_User/LJPersonalViewController.m b/LJHY_User/Submodule/Personal/LJPersonalViewController.m similarity index 100% rename from LJHY_User/LJPersonalViewController.m rename to LJHY_User/Submodule/Personal/LJPersonalViewController.m diff --git a/LJHY_User/LJServiceViewController.h b/LJHY_User/Submodule/Service/LJServiceViewController.h similarity index 100% rename from LJHY_User/LJServiceViewController.h rename to LJHY_User/Submodule/Service/LJServiceViewController.h diff --git a/LJHY_User/LJServiceViewController.m b/LJHY_User/Submodule/Service/LJServiceViewController.m similarity index 100% rename from LJHY_User/LJServiceViewController.m rename to LJHY_User/Submodule/Service/LJServiceViewController.m diff --git a/LJHY_User/Utils/AgreeButton/AgreeButton.h b/LJHY_User/Utils/AgreeButton/AgreeButton.h new file mode 100644 index 0000000..3b20811 --- /dev/null +++ b/LJHY_User/Utils/AgreeButton/AgreeButton.h @@ -0,0 +1,16 @@ +// +// AgreeButton.h +// JDMEForIphone +// +// Created by ttkj on 2017/5/23. +// Copyright © 2017年 jd.com. All rights reserved. +// + +#import + +@interface AgreeButton : UIButton + + +@property (nonatomic,assign)BOOL isAgree; + +@end diff --git a/LJHY_User/Utils/AgreeButton/AgreeButton.m b/LJHY_User/Utils/AgreeButton/AgreeButton.m new file mode 100644 index 0000000..c165617 --- /dev/null +++ b/LJHY_User/Utils/AgreeButton/AgreeButton.m @@ -0,0 +1,62 @@ +// +// AgreeButton.m +// JDMEForIphone +// +// Created by ttkj on 2017/5/23. +// Copyright © 2017年 jd.com. All rights reserved. +// + +#import "AgreeButton.h" + + +@interface AgreeButton () + +@end +@implementation AgreeButton + +/* + // Only override drawRect: if you perform custom drawing. + // An empty implementation adversely affects performance during animation. + - (void)drawRect:(CGRect)rect { + // Drawing code + } + */ + +- (instancetype)initWithFrame:(CGRect)frame +{ + + if ([super initWithFrame:frame]){ + + + } + + return self; +} + +- (void)setIsAgree:(BOOL)isAgree +{ + _isAgree =isAgree; + + [self setImage:[UIImage imageNamed:(_isAgree)?@"dailylog_fabulous_selected":@"dailylog_fabulous"] forState:UIControlStateNormal]; + + + + if (isAgree){ + CAKeyframeAnimation *k = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; + k.values = @[@(0.1),@(1.5),@(1.0)]; + k.keyTimes = @[@(0.0),@(0.5),@(0.8),@(1.0)]; + k.calculationMode = kCAAnimationLinear; + + + [self.layer addAnimation:k forKey:@"SHOW"]; + + } + + +} + + + + + +@end diff --git a/LJHY_User/Utils/AgreeButton/dailylog_fabulous@2x.png b/LJHY_User/Utils/AgreeButton/dailylog_fabulous@2x.png new file mode 100644 index 0000000..f6beb01 Binary files /dev/null and b/LJHY_User/Utils/AgreeButton/dailylog_fabulous@2x.png differ diff --git a/LJHY_User/Utils/AgreeButton/dailylog_fabulous@3x.png b/LJHY_User/Utils/AgreeButton/dailylog_fabulous@3x.png new file mode 100644 index 0000000..0711e74 Binary files /dev/null and b/LJHY_User/Utils/AgreeButton/dailylog_fabulous@3x.png differ diff --git a/LJHY_User/Utils/AgreeButton/dailylog_fabulous_selected@2x.png b/LJHY_User/Utils/AgreeButton/dailylog_fabulous_selected@2x.png new file mode 100644 index 0000000..ef6c0f2 Binary files /dev/null and b/LJHY_User/Utils/AgreeButton/dailylog_fabulous_selected@2x.png differ diff --git a/LJHY_User/Utils/AgreeButton/dailylog_fabulous_selected@3x.png b/LJHY_User/Utils/AgreeButton/dailylog_fabulous_selected@3x.png new file mode 100644 index 0000000..0725653 Binary files /dev/null and b/LJHY_User/Utils/AgreeButton/dailylog_fabulous_selected@3x.png differ diff --git a/LJHY_User/Utils/CacheSize/ImageCacheSize.h b/LJHY_User/Utils/CacheSize/ImageCacheSize.h new file mode 100644 index 0000000..af1b195 --- /dev/null +++ b/LJHY_User/Utils/CacheSize/ImageCacheSize.h @@ -0,0 +1,13 @@ +// +// ImageCacheSize.h +// yiliaotoutiao +// +// Created by Jason T on 2016/12/12. +// Copyright © 2016年 YLTT. All rights reserved. +// + +#import + +@interface ImageCacheSize : NSObject +- (NSString *)fileSizeWithInterge:(NSInteger)size; +@end diff --git a/LJHY_User/Utils/CacheSize/ImageCacheSize.m b/LJHY_User/Utils/CacheSize/ImageCacheSize.m new file mode 100644 index 0000000..6f29944 --- /dev/null +++ b/LJHY_User/Utils/CacheSize/ImageCacheSize.m @@ -0,0 +1,38 @@ + + +// +// ImageCacheSize.m +// yiliaotoutiao +// +// Created by Jason T on 2016/12/12. +// Copyright © 2016年 YLTT. All rights reserved. +// + +#import "ImageCacheSize.h" + +@implementation ImageCacheSize + + +////获取缓存的大小 +// +//NSUInteger intg = [[SDImageCache sharedImageCache] getSize]; +//// +//NSString * currentVolum = [NSString stringWithFormat:@"%@",[self fileSizeWithInterge:intg]]; + +//计算出大小 +- (NSString *)fileSizeWithInterge:(NSInteger)size{ + // 1k = 1024, 1m = 1024k + if (size < 1024) {// 小于1k + return [NSString stringWithFormat:@"%ldB",(long)size]; + }else if (size < 1024 * 1024){// 小于1m + CGFloat aFloat = size/1024; + return [NSString stringWithFormat:@"%.0fK",aFloat]; + }else if (size < 1024 * 1024 * 1024){// 小于1G + CGFloat aFloat = size/(1024 * 1024); + return [NSString stringWithFormat:@"%.1fM",aFloat]; + }else{ + CGFloat aFloat = size/(1024*1024*1024); + return [NSString stringWithFormat:@"%.1fG",aFloat]; + } +} +@end diff --git a/LJHY_User/Utils/ChoseAreaTool/KZAreaM.h b/LJHY_User/Utils/ChoseAreaTool/KZAreaM.h new file mode 100644 index 0000000..ab3be1c --- /dev/null +++ b/LJHY_User/Utils/ChoseAreaTool/KZAreaM.h @@ -0,0 +1,18 @@ +// +// KZAreaM.h +// zhuyuanbao +// +// Created by Jason T on 15/11/4. +// Copyright © 2015年 KangZhi. All rights reserved. +// + +#import + +@interface KZAreaM : NSObject +@property (nonatomic,assign)int region_id; +@property (nonatomic,copy)NSString * parent_id; +@property (nonatomic,copy)NSString * region_name; + + +@end + diff --git a/LJHY_User/Utils/ChoseAreaTool/KZAreaM.m b/LJHY_User/Utils/ChoseAreaTool/KZAreaM.m new file mode 100644 index 0000000..e0b92b0 --- /dev/null +++ b/LJHY_User/Utils/ChoseAreaTool/KZAreaM.m @@ -0,0 +1,13 @@ +// +// KZAreaM.m +// zhuyuanbao +// +// Created by Jason T on 15/11/4. +// Copyright © 2015年 KangZhi. All rights reserved. +// + +#import "KZAreaM.h" + +@implementation KZAreaM + +@end diff --git a/LJHY_User/Utils/ChoseAreaTool/KZAreaVC.h b/LJHY_User/Utils/ChoseAreaTool/KZAreaVC.h new file mode 100644 index 0000000..00957d7 --- /dev/null +++ b/LJHY_User/Utils/ChoseAreaTool/KZAreaVC.h @@ -0,0 +1,26 @@ +// +// KZAreaVC.h +// zhuyuanbao +// +// Created by Jason T on 15/10/21. +// Copyright © 2015年 KangZhi. All rights reserved. +// + +//#import "KZBaseVC.h" +//#import "KZFileVC.h" + + +// 选择完毕 +#define kChoseAreaDoneNote @"choseAreaDoneNote" + +@interface KZAreaVC : UIViewController + + +/** + * 要返回的控制器 + */ +@property (nonatomic,strong)UIViewController * rootVC; +@property (nonatomic,copy)NSString * parentId; +@property (nonatomic,strong)NSMutableArray * addAreaArray; + +@end diff --git a/LJHY_User/Utils/ChoseAreaTool/KZAreaVC.m b/LJHY_User/Utils/ChoseAreaTool/KZAreaVC.m new file mode 100644 index 0000000..42f914b --- /dev/null +++ b/LJHY_User/Utils/ChoseAreaTool/KZAreaVC.m @@ -0,0 +1,186 @@ +//// +//// KZAreaVC.m +//// zhuyuanbao +//// +//// Created by Jason T on 15/10/21. +//// Copyright © 2015年 KangZhi. All rights reserved. +//// +// +//#import "KZAreaVC.h" +////#import "FMDB.h" +//#import "FMDatabaseAdditions.h" +//#import "KZAreaM.h" +//#import "KZChoseAreaTool.h" +// +//#define DBNAME @"zyb.db" +//#define TABLENAME @"app_city" +// +//#define REGION_ID @"region_id" +//#define PARENT_ID @"parent_id" +//#define REGION_NAME @"region_name" +//#define REGION_TYPE @"region_type" +// +// +// +//@interface KZAreaVC () +//@property (nonatomic,strong)UITableView *tableView; +////@property (nonatomic,strong) FMDatabase *db; +////@property (nonatomic,copy) NSString *database_path; +//@property (nonatomic,strong)NSMutableArray * provinceArray; +//@property (nonatomic,strong)NSMutableArray * areaArray; +// +//@end +// +//@implementation KZAreaVC +// +// +// +//- (void)viewDidLoad { +// [super viewDidLoad]; +// +// +// self.title = @"地区"; +// self.tableView = ({ +// UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, ([UIScreen mainScreen].bounds.size.width), [UIScreen mainScreen].bounds.size.height)]; +// tableView.backgroundColor = [UIColor colorWithRed:241/255.0 green:241/255.0 blue:241/255.0 alpha:1]; +// tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; +// tableView.contentInset = UIEdgeInsetsMake(0, 0, 20, 0); +// tableView.dataSource = self; +// tableView.delegate = self; +// tableView.rowHeight = 44; +// [self.view addSubview:tableView]; +// tableView.tableFooterView = [[UIView alloc]init]; +// tableView; +// }); +// self.tableView.separatorInset = UIEdgeInsetsZero; +//// if (iOS8) { +// [self.tableView setLayoutMargins:UIEdgeInsetsZero]; +//// } +// +// +// if (self.parentId) { +// //第二次进来就选择上次传递过来的 +// +// self.areaArray = [KZChoseAreaTool choseAreaWithParentId:self.parentId]; +// +// }else +// { +// //一进来 就选择省 +// +// self.areaArray = [KZChoseAreaTool choseAreaWithParentId:@"1"]; +// +// } +// +// +// [self.tableView reloadData]; +// +// self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:@selector(returnBack)]; +// +// +// +//} +//- (void)returnBack +//{ +// [self.navigationController popViewControllerAnimated:YES]; +//} +// +// +//- (void)dealloc +//{ +// [[NSNotificationCenter defaultCenter]removeObserver:self]; +// +// +//} +// +// +//#pragma mark --dataSource +//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section +//{ +// return self.areaArray.count; +//} +// +//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath +//{ +// +// static NSString * ID = @"area"; +// UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:ID]; +// if (cell == nil) { +// cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID]; +// } +// cell.accessoryType =UITableViewCellAccessoryDisclosureIndicator; +// cell.selectionStyle = UITableViewCellSelectionStyleNone; +// KZAreaM * areaM = self.areaArray[indexPath.row]; +// cell.textLabel.text = areaM.region_name; +// return cell; +// +//} +// +//#pragma mark --Delegate +//- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +//{ +// KZAreaM * areaM = self.areaArray[indexPath.row]; +// [self.addAreaArray addObject:areaM]; +// +// NSMutableArray * nextGroup = [KZChoseAreaTool choseAreaWithParentId:[NSString stringWithFormat:@"%d",areaM.region_id]]; +// KZAreaVC * cityVC = [[KZAreaVC alloc]init]; +// cityVC.parentId = [NSString stringWithFormat:@"%d",areaM.region_id]; +// +// //没有下一级 +// if (nextGroup.count==0) { +// +//// UIViewController * VC = self.navigationController.viewControllers[1]; +// if (self.rootVC != nil) { +// +// [self.navigationController popToViewController:self.rootVC animated:YES]; +// } +// +// //选择完毕 +// [[NSNotificationCenter defaultCenter]postNotificationName:kChoseAreaDoneNote object:nil]; +// }else +// { //有下一级 +// +// cityVC.addAreaArray = self.addAreaArray; +// cityVC.rootVC = self.rootVC ; +// [self.navigationController pushViewController:cityVC animated:YES]; +// +// +// +// } +// +//// if (self.navigationController.viewControllers.count<5) { +//// [self.navigationController jumpToController:cityVC]; +//// }else +//// { +//// UIViewController * VC = self.navigationController.viewControllers[1]; +//// [self.navigationController popToViewController:VC animated:YES]; +//// } +// +// +//} +// +// +////代理方法: +// +//- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath +// +//{ +// +// if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { +// +// [cell setSeparatorInset:UIEdgeInsetsZero]; +// +// } +// +// if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { +// +// [cell setLayoutMargins:UIEdgeInsetsZero]; +// +// } +// +//} +// +// +// +// +// +//@end diff --git a/LJHY_User/Utils/ChoseAreaTool/KZChoseAreaTool.h b/LJHY_User/Utils/ChoseAreaTool/KZChoseAreaTool.h new file mode 100644 index 0000000..d15eb6a --- /dev/null +++ b/LJHY_User/Utils/ChoseAreaTool/KZChoseAreaTool.h @@ -0,0 +1,36 @@ +// +// KZChoseAreaTool.h +// zhuyuanbao +// +// Created by Jason T on 15/11/4. +// Copyright © 2015年 KangZhi. All rights reserved. +// + +#import +#import "KZAreaM.h" + +@class KZAreaM; +@interface KZChoseAreaTool : NSObject + ++ (NSMutableArray *)choseAreaWithParentId:(NSString *)parentId; + + +//省 ++ (NSMutableArray *)choseDistrctWithParentId:(NSString *)parentId; +//市 ++ (NSMutableArray *)choseCityWithParentId:(NSString *)parentId; +//区 ++ (NSMutableArray *)choseProvinceWithParentId:(NSString *)parentId; + + + +//regionId 查询 返回 ++ (KZAreaM *)choseAreaWithRegionId:(NSString *)regionId; + + +//传入(省,市,区 的id)数组, 返回一个不重复省市区 ++ (NSString *)dealWithRepeatArea:(NSArray *)addAreaArray; + + + +@end diff --git a/LJHY_User/Utils/ChoseAreaTool/KZChoseAreaTool.m b/LJHY_User/Utils/ChoseAreaTool/KZChoseAreaTool.m new file mode 100644 index 0000000..787231a --- /dev/null +++ b/LJHY_User/Utils/ChoseAreaTool/KZChoseAreaTool.m @@ -0,0 +1,123 @@ +//// +//// KZChoseAreaTool.m +//// zhuyuanbao +//// +//// Created by Jason T on 15/11/4. +//// Copyright © 2015年 KangZhi. All rights reserved. +//// +// +//#import "KZChoseAreaTool.h" +//#import "FMDB.h" +//#import "KZAreaM.h" +// +// +//#define DBNAME @"zyb.db" +//#define TABLENAME @"app_city" +//#define REGION_ID @"region_id" +//#define PARENT_ID @"parent_id" +//#define REGION_NAME @"region_name" +//#define REGION_TYPE @"region_type" +// +//@implementation KZChoseAreaTool +// +// +// +//+ (NSString *)dealWithRepeatArea:(NSArray *)addAreaArray{ +// +// +// NSMutableString * address = [NSMutableString string]; +// +// int idex =0; +// KZAreaM * lastOneArea = nil; +// for (KZAreaM * areaM in addAreaArray) { +// +// if([lastOneArea.region_name isEqualToString:areaM.region_name] ){ +// +// lastOneArea = areaM; +// continue; +// }else +// { +// +// [address appendFormat:@" %@",areaM.region_name]; +// } +// +// lastOneArea = areaM; +// +// +// idex++; +// } +// +// +// return address; +//} +// +// +// +// +//+ (NSMutableArray *)choseDistrctWithParentId:(NSString *)parentId +//{ +// +// return [self choseAreaWithParentId:parentId]; +// +//} +// +//+ (NSMutableArray *)choseCityWithParentId:(NSString *)parentId +//{ +// return [self choseAreaWithParentId:parentId]; +// +//} +// +//+ (NSMutableArray *)choseProvinceWithParentId:(NSString *)parentId +//{ +// return [self choseAreaWithParentId:parentId]; +//} +// +//+ (KZAreaM *)choseAreaWithRegionId:(NSString *)regionId +//{ +// NSMutableArray * areaArray = [self choseAreaWithId:regionId andColumn:REGION_ID]; +// return areaArray.firstObject; +//} +// +//+ (NSMutableArray *)choseAreaWithParentId:(NSString *)parentId +//{ +// return [self choseAreaWithId:parentId andColumn:PARENT_ID]; +//} +// +// +//+ (NSMutableArray *)choseAreaWithId:(NSString *)Id andColumn:(NSString *)columnStr +//{ +//// NSSearchPathForDirectoriesInDomains(NSHomeDirectory(), NSUserDomainMask, YES); +//// NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); +//// NSString *documents = [paths objectAtIndex:0]; +//// NSString * database_path = [documents stringByAppendingPathComponent:DBNAME]; +// +// NSString *database_path = [[NSBundle mainBundle] pathForResource: DBNAME ofType:nil]; +// +// FMDatabase *db = [FMDatabase databaseWithPath:database_path]; +// +// NSMutableArray * areaArray = [NSMutableArray array]; +// //sql 语句 +// if ([db open]) { +// +// NSString * sql =[NSString stringWithFormat:@"SELECT * FROM app_city WHERE %@ = %@",columnStr,Id]; +// FMResultSet * rs = [db executeQuery:sql]; +// while ([rs next]) { +// int regionId = [rs intForColumn:REGION_ID]; +// NSString * regionName = [rs stringForColumn:REGION_NAME]; +// NSString * parentId = [rs stringForColumn:PARENT_ID]; +// //NSLog(@"id = %d, name = %@, age = %@", regionId, regionName, parentId); +// KZAreaM * areaM = [[KZAreaM alloc]init]; +// areaM.region_id = regionId; +// areaM.parent_id = parentId; +// areaM.region_name = regionName; +// [areaArray addObject:areaM]; +// } +// +// [db close]; +// } +// +// return areaArray; +//} +// +// +//@end diff --git a/LJHY_User/Utils/ChoseAreaTool/zyb.db b/LJHY_User/Utils/ChoseAreaTool/zyb.db new file mode 100644 index 0000000..70d9e38 Binary files /dev/null and b/LJHY_User/Utils/ChoseAreaTool/zyb.db differ diff --git a/LJHY_User/Utils/DLSlideView/DLCache/DLCacheProtocol.h b/LJHY_User/Utils/DLSlideView/DLCache/DLCacheProtocol.h new file mode 100644 index 0000000..146d60b --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLCache/DLCacheProtocol.h @@ -0,0 +1,18 @@ +// +// DLCacheProtocol.h +// DLSlideViewDemo +// +// Created by Dongle Su on 15-2-13. +// Copyright (c) 2015年 dongle. All rights reserved. +// + +#ifndef DLSlideViewDemo_DLCacheProtocol_h +#define DLSlideViewDemo_DLCacheProtocol_h +#import + +@protocol DLCacheProtocol +- (void)setObject:(id)object forKey:(NSString *)key; +- (id)objectForKey:(NSString *)key; +@end + +#endif diff --git a/LJHY_User/Utils/DLSlideView/DLCache/DLLRUCache.h b/LJHY_User/Utils/DLSlideView/DLCache/DLLRUCache.h new file mode 100644 index 0000000..d3d8592 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLCache/DLLRUCache.h @@ -0,0 +1,18 @@ +// +// DLFIFOCache.h +// DLSlideViewDemo +// +// Created by Dongle Su on 14-12-13. +// Copyright (c) 2014年 dongle. All rights reserved. +// + +#import +#import "DLCacheProtocol.h" + +@interface DLLRUCache : NSObject + +- (id)initWithCount:(NSInteger)count; + +- (void)setObject:(id)object forKey:(NSString *)key; +- (id)objectForKey:(NSString *)key; +@end diff --git a/LJHY_User/Utils/DLSlideView/DLCache/DLLRUCache.m b/LJHY_User/Utils/DLSlideView/DLCache/DLLRUCache.m new file mode 100644 index 0000000..90b3756 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLCache/DLLRUCache.m @@ -0,0 +1,60 @@ +// +// DLFIFOCache.m +// DLSlideViewDemo +// +// Created by Dongle Su on 14-12-13. +// Copyright (c) 2014年 dongle. All rights reserved. +// + +#import "DLLRUCache.h" + +@implementation DLLRUCache{ + NSMutableDictionary *dic_; + NSMutableArray *lruKeyList_; + NSInteger capacity_; +} + +- (id)initWithCount:(NSInteger)count{ + if (self = [super init]) { + capacity_ = count; + dic_ = [NSMutableDictionary dictionaryWithCapacity:capacity_]; + lruKeyList_ = [NSMutableArray arrayWithCapacity:capacity_]; + } + + return self; +} + +- (void)setObject:(id)object forKey:(NSString *)key{ + if (![lruKeyList_ containsObject:key]) { + if (lruKeyList_.count < capacity_) { + [dic_ setValue:object forKey:key]; + [lruKeyList_ addObject:key]; + } + else{ + NSString *longTimeUnusedKey = [lruKeyList_ firstObject]; + [dic_ setValue:nil forKey:longTimeUnusedKey]; + [lruKeyList_ removeObjectAtIndex:0]; + + [dic_ setValue:object forKey:key]; + [lruKeyList_ addObject:key]; + } + } + else{ + [dic_ setValue:object forKey:key]; + [lruKeyList_ removeObject:key]; + [lruKeyList_ addObject:key]; + } +} + +- (id)objectForKey:(NSString *)key{ + if ([lruKeyList_ containsObject:key]) { + [lruKeyList_ removeObject:key]; + [lruKeyList_ addObject:key]; + + return [dic_ objectForKey:key]; + } + else{ + return nil; + } +} +@end diff --git a/LJHY_User/Utils/DLSlideView/DLCustomSlideView.h b/LJHY_User/Utils/DLSlideView/DLCustomSlideView.h new file mode 100644 index 0000000..8ef2222 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLCustomSlideView.h @@ -0,0 +1,45 @@ +// +// DLCustomSlideView.h +// DLSlideViewDemo +// +// Created by Dongle Su on 15-2-12. +// Copyright (c) 2015年 dongle. All rights reserved. +// + +#import + +#import "DLSlideTabbarProtocol.h" +#import "DLSlideView.h" +#import "DLTabedSlideView.h" +#import "DLCacheProtocol.h" + + +@class DLCustomSlideView; + +@protocol DLCustomSlideViewDelegate +- (NSInteger)numberOfTabsInDLCustomSlideView:(DLCustomSlideView *)sender; +- (UIViewController *)DLCustomSlideView:(DLCustomSlideView *)sender controllerAt:(NSInteger)index; +@optional +- (void)DLCustomSlideView:(DLCustomSlideView *)sender didSelectedAt:(NSInteger)index; +@end + + + +@interface DLCustomSlideView : UIView +@property(nonatomic, weak) UIViewController *baseViewController; +@property(nonatomic, assign) NSInteger selectedIndex; + +// tabbar +@property(nonatomic, strong) UIView *tabbar; +@property(nonatomic, assign) float tabbarBottomSpacing; + +// cache properties +@property(nonatomic, strong) id cache; + +// delegate +@property(nonatomic, weak)IBOutlet iddelegate; + +// init method. 初始分方法 +- (void)setup; + +@end diff --git a/LJHY_User/Utils/DLSlideView/DLCustomSlideView.m b/LJHY_User/Utils/DLSlideView/DLCustomSlideView.m new file mode 100644 index 0000000..3b798fe --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLCustomSlideView.m @@ -0,0 +1,101 @@ +// +// DLCustomSlideView.m +// DLSlideViewDemo +// +// Created by Dongle Su on 15-2-12. +// Copyright (c) 2015年 dongle. All rights reserved. +// + +#import "DLCustomSlideView.h" + +#define kDefaultTabbarBottomSpacing 0 +#define kDefaultCacheCount 4 + +@implementation DLCustomSlideView{ + DLSlideView *slideView_; +} + +- (void)commonInit{ + self.tabbarBottomSpacing = kDefaultTabbarBottomSpacing; +} + +- (id)initWithCoder:(NSCoder *)aDecoder{ + if (self = [super initWithCoder:aDecoder]) { + [self commonInit]; + } + return self; +} +- (id)initWithFrame:(CGRect)frame{ + if (self = [super initWithFrame:frame]) { + [self commonInit]; + } + return self; +} + +- (void)setup{ + self.tabbar.delegate = self; + [self addSubview:self.tabbar]; + + slideView_ = [[DLSlideView alloc] initWithFrame:CGRectMake(0, self.tabbar.frame.size.height+self.tabbarBottomSpacing, self.bounds.size.width, self.bounds.size.height-self.tabbar.frame.size.height-self.tabbarBottomSpacing)]; + slideView_.delegate = self; + slideView_.dataSource = self; + slideView_.baseViewController = self.baseViewController; + [self addSubview:slideView_]; +} +- (void)layoutSubviews{ + [super layoutSubviews]; + + [self layoutBarAndSlide]; +} + +- (void)layoutBarAndSlide{ + self.tabbar.frame = CGRectMake(0, 0, CGRectGetWidth(self.tabbar.bounds), self.tabbar.frame.size.height); + slideView_.frame = CGRectMake(0, self.tabbar.frame.size.height+self.tabbarBottomSpacing, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)-self.tabbar.frame.size.height-self.tabbarBottomSpacing); +} + +- (void)setBaseViewController:(UIViewController *)baseViewController{ + slideView_.baseViewController = baseViewController; + _baseViewController = baseViewController; +} + +- (void)setSelectedIndex:(NSInteger)selectedIndex{ + _selectedIndex = selectedIndex; + [slideView_ setSelectedIndex:selectedIndex]; + [self.tabbar setSelectedIndex:selectedIndex]; +} + +- (void)DLSlideTabbar:(id)sender selectAt:(NSInteger)index{ + [slideView_ setSelectedIndex:index]; +} + +- (NSInteger)numberOfControllersInDLSlideView:(DLSlideView *)sender{ + return [self.delegate numberOfTabsInDLCustomSlideView:self]; +} + +- (UIViewController *)DLSlideView:(DLSlideView *)sender controllerAt:(NSInteger)index{ + NSString *key = [NSString stringWithFormat:@"%ld", (long)index]; + if ([self.cache objectForKey:key]) { + return [self.cache objectForKey:key]; + } + else{ + UIViewController *ctrl = [self.delegate DLCustomSlideView:self controllerAt:index]; + [self.cache setObject:ctrl forKey:key]; + return ctrl; + } +} + +- (void)DLSlideView:(DLSlideView *)slide switchingFrom:(NSInteger)oldIndex to:(NSInteger)toIndex percent:(float)percent{ + [self.tabbar switchingFrom:oldIndex to:toIndex percent:percent]; +} +- (void)DLSlideView:(DLSlideView *)slide didSwitchTo:(NSInteger)index{ + [self.tabbar setSelectedIndex:index]; + if (self.delegate && [self.delegate respondsToSelector:@selector(DLTabedSlideView:didSelectedAt:)]) { + [self.delegate DLCustomSlideView:self didSelectedAt:index]; + } +} +- (void)DLSlideView:(DLSlideView *)slide switchCanceled:(NSInteger)oldIndex{ + [self.tabbar setSelectedIndex:oldIndex]; +} + + +@end diff --git a/LJHY_User/Utils/DLSlideView/DLSlideView.h b/LJHY_User/Utils/DLSlideView/DLSlideView.h new file mode 100644 index 0000000..db67985 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLSlideView.h @@ -0,0 +1,33 @@ +// +// DLSlideView.h +// DLSlideController +// +// Created by Dongle Su on 14-12-7. +// Copyright (c) 2014年 dongle. All rights reserved. +// + +#import + +@class DLSlideView; + +@protocol DLSlideViewDataSource +- (NSInteger)numberOfControllersInDLSlideView:(DLSlideView *)sender; +- (UIViewController *)DLSlideView:(DLSlideView *)sender controllerAt:(NSInteger)index; +@end + +@protocol DLSlideViewDelegate +@optional +- (void)DLSlideView:(DLSlideView *)slide switchingFrom:(NSInteger)oldIndex to:(NSInteger)toIndex percent:(float)percent; +- (void)DLSlideView:(DLSlideView *)slide didSwitchTo:(NSInteger)index; +- (void)DLSlideView:(DLSlideView *)slide switchCanceled:(NSInteger)oldIndex; +@end + +@interface DLSlideView : UIView +//@property(nonatomic, strong) NSArray *viewControllers; +@property(nonatomic, assign) NSInteger selectedIndex; +@property(nonatomic, weak) UIViewController *baseViewController; +@property(nonatomic, weak) iddelegate; +@property(nonatomic, weak) iddataSource; +- (void)switchTo:(NSInteger)index; + +@end diff --git a/LJHY_User/Utils/DLSlideView/DLSlideView.m b/LJHY_User/Utils/DLSlideView/DLSlideView.m new file mode 100644 index 0000000..b1e02df --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLSlideView.m @@ -0,0 +1,336 @@ +// +// DLSlideView.m +// DLSlideController +// +// Created by Dongle Su on 14-12-7. +// Copyright (c) 2014年 dongle. All rights reserved. +// + +#import "DLSlideView.h" + +#define kPanSwitchOffsetThreshold 50.0f + +@implementation DLSlideView{ + NSInteger oldIndex_; + NSInteger panToIndex_; + UIPanGestureRecognizer *pan_; + CGPoint panStartPoint_; + + UIViewController *oldCtrl_; + UIViewController *willCtrl_; + + BOOL isSwitching_; +} + +- (void)commonInit{ + oldIndex_ = -1; + isSwitching_ = NO; + + pan_ = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panHandler:)]; + [self addGestureRecognizer:pan_]; +} + +- (id)initWithCoder:(NSCoder *)aDecoder{ + if (self = [super initWithCoder:aDecoder]) { + [self commonInit]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame{ + if (self = [super initWithFrame:frame]) { + [self commonInit]; + } + return self; +} + +- (NSInteger)selectedIndex{ + return oldIndex_; +} +- (void)setSelectedIndex:(NSInteger)selectedIndex{ + if (selectedIndex != oldIndex_) { + [self switchTo:selectedIndex]; + } +} +//- (void)setViewControllers:(NSArray *)vcs{ +// _viewControllers = vcs; +//} + +- (void)removeOld{ + [self removeCtrl:oldCtrl_]; + [oldCtrl_ endAppearanceTransition]; + oldCtrl_ = nil; + oldIndex_ = -1; +} +- (void)removeWill{ + [willCtrl_ beginAppearanceTransition:NO animated:NO]; + [self removeCtrl:willCtrl_]; + [willCtrl_ endAppearanceTransition]; + willCtrl_ = nil; + panToIndex_ = -1; +} +- (void)showAt:(NSInteger)index{ + if (oldIndex_ != index) { + //[self removeAt:oldIndex_]; + [self removeOld]; + + UIViewController *vc = [self.dataSource DLSlideView:self controllerAt:index]; + [self.baseViewController addChildViewController:vc]; + vc.view.frame = self.bounds; + [self addSubview:vc.view]; + [vc didMoveToParentViewController:self.baseViewController]; + oldIndex_ = index; + oldCtrl_ = vc; + + if (self.delegate && [self.delegate respondsToSelector:@selector(DLSlideView:didSwitchTo:)]) { + [self.delegate DLSlideView:self didSwitchTo:index]; + } + } +} + +- (void)removeCtrl:(UIViewController *)ctrl{ + UIViewController *vc = ctrl; + [vc willMoveToParentViewController:nil]; + [vc.view removeFromSuperview]; + [vc removeFromParentViewController]; +} + +//- (void)removeAt:(int)index{ +// if (oldIndex_ == index) { +// oldIndex_ = -1; +// } +// +// if (index >= 0 && index <= [self.dataSource numberOfControllersInDLSlideView:self]) { +// UIViewController *vc = [self.dataSource DLSlideView:self controllerAt:index]; +// [vc willMoveToParentViewController:nil]; +// [vc.view removeFromSuperview]; +// [vc removeFromParentViewController]; +// } +//} +- (void)switchTo:(NSInteger)index{ + if (index == oldIndex_) { + return; + } + if (isSwitching_) { + return; + } + + if (oldCtrl_ != nil && oldCtrl_.parentViewController == self.baseViewController) { + isSwitching_ = YES; + //UIViewController *oldvc = [self.dataSource DLSlideView:self controllerAt:oldIndex_];; + UIViewController *oldvc = oldCtrl_; + UIViewController *newvc = [self.dataSource DLSlideView:self controllerAt:index]; + + [oldvc willMoveToParentViewController:nil]; + [self.baseViewController addChildViewController:newvc]; + + CGRect nowRect = oldvc.view.frame; + CGRect leftRect = CGRectMake(nowRect.origin.x-nowRect.size.width, nowRect.origin.y, nowRect.size.width, nowRect.size.height); + CGRect rightRect = CGRectMake(nowRect.origin.x+nowRect.size.width, nowRect.origin.y, nowRect.size.width, nowRect.size.height); + + CGRect newStartRect; + CGRect oldEndRect; + if (index > oldIndex_) { + newStartRect = rightRect; + oldEndRect = leftRect; + } + else{ + newStartRect = leftRect; + oldEndRect = rightRect; + } + + newvc.view.frame = newStartRect; + [newvc willMoveToParentViewController:self.baseViewController]; + + [self.baseViewController transitionFromViewController:oldvc toViewController:newvc duration:0.4 options:0 animations:^{ + newvc.view.frame = nowRect; + oldvc.view.frame = oldEndRect; + } completion:^(BOOL finished) { + [oldvc removeFromParentViewController]; + [newvc didMoveToParentViewController:self.baseViewController]; + + if (self.delegate && [self.delegate respondsToSelector:@selector(DLSlideView:didSwitchTo:)]) { + [self.delegate DLSlideView:self didSwitchTo:index]; + } + + isSwitching_ = NO; + }]; + + oldIndex_ = index; + oldCtrl_ = newvc; + } + else{ + [self showAt:index]; + } + + willCtrl_ = nil; + panToIndex_ = -1; +} + +- (void)repositionForOffsetX:(CGFloat)offsetx{ + float x = 0.0f; + + if (panToIndex_ < oldIndex_) { + x = self.bounds.origin.x - self.bounds.size.width + offsetx; + } + else if(panToIndex_ > oldIndex_){ + x = self.bounds.origin.x + self.bounds.size.width + offsetx; + } + + //UIViewController *oldvc = [self.dataSource DLSlideView:self controllerAt:oldIndex_]; + UIViewController *oldvc = oldCtrl_; + oldvc.view.frame = CGRectMake(self.bounds.origin.x + offsetx, self.bounds.origin.y, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); + + if (panToIndex_ >= 0 && panToIndex_ < [self.dataSource numberOfControllersInDLSlideView:self]) { + //UIViewController *vc = [self.dataSource DLSlideView:self controllerAt:panToIndex_]; + UIViewController *vc = willCtrl_; + vc.view.frame = CGRectMake(x, self.bounds.origin.y, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); +// if (vc.parentViewController == nil) { +// +// [self.baseViewController addChildViewController:vc]; +// [vc willMoveToParentViewController:self.baseViewController]; +// [vc beginAppearanceTransition:YES animated:YES]; +// [self addSubview:vc.view]; +// //[vc didMoveToParentViewController:self.baseViewController]; +// } + } + + if (self.delegate && [self.delegate respondsToSelector:@selector(DLSlideView:switchingFrom:to:percent:)]) { + [self.delegate DLSlideView:self switchingFrom:oldIndex_ to:panToIndex_ percent:fabs(offsetx)/self.bounds.size.width]; + } +} + +- (void)backToOldWithOffset:(CGFloat)offsetx{ + NSTimeInterval animatedTime = 0; + animatedTime = 0.3; + + //animatedTime = fabs(self.frame.size.width - fabs(offsetx)) / self.frame.size.width * 0.35; + [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; + [UIView animateWithDuration:animatedTime animations:^{ + [self repositionForOffsetX:0]; + } completion:^(BOOL finished) { + if (panToIndex_ >= 0 && panToIndex_ < [self.dataSource numberOfControllersInDLSlideView:self] && panToIndex_ != oldIndex_) { + //[self removeAt:panToIndex_]; + [oldCtrl_ beginAppearanceTransition:YES animated:NO]; + [self removeWill]; + [oldCtrl_ endAppearanceTransition]; + } + if (self.delegate && [self.delegate respondsToSelector:@selector(DLSlideView:switchCanceled:)]) { + [self.delegate DLSlideView:self switchCanceled:oldIndex_]; + } + }]; + +// [UIView animateWithDuration:animatedTime delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{ +// float pantox = 0.0f; +// if (offsetx > 0) { +// pantox = -self.bounds.size.width; +// } +// else{ +// pantox = self.bounds.size.width; +// } +// +// //UIViewController *oldvc = [self.dataSource DLSlideView:self controllerAt:oldIndex_];; +// UIViewController *oldvc = oldCtrl_; +// oldvc.view.frame = CGRectMake(0, self.bounds.origin.y, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); +// if (panToIndex_ >= 0 && panToIndex_ < [self.dataSource numberOfControllersInDLSlideView:self]) { +// //UIViewController *vc = [self.dataSource DLSlideView:self controllerAt:panToIndex_]; +// UIViewController *vc = willCtrl_; +// vc.view.frame = CGRectMake(pantox, self.bounds.origin.y, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)); +// } +// } completion:^(BOOL finished) { +// if (panToIndex_ >= 0 && panToIndex_ < [self.dataSource numberOfControllersInDLSlideView:self] && panToIndex_ != oldIndex_) { +// //[self removeAt:panToIndex_]; +// [self removeWill]; +// } +// }]; + +} +- (void)panHandler:(UIPanGestureRecognizer *)pan{ + if (oldIndex_ < 0) { + return; + } + + CGPoint point = [pan translationInView:self]; + + if (pan.state == UIGestureRecognizerStateBegan) { + panStartPoint_ = point; + //[oldCtrl_ willMoveToParentViewController:nil]; + [oldCtrl_ beginAppearanceTransition:NO animated:YES]; + } + else if (pan.state == UIGestureRecognizerStateChanged){ + NSInteger panToIndex = -1; + float offsetx = point.x - panStartPoint_.x; + + if (offsetx > 0) { + panToIndex = oldIndex_ - 1; + } + else if(offsetx < 0){ + panToIndex = oldIndex_ + 1; + } + + // fix bug #5 + if (panToIndex != panToIndex_) { + if (willCtrl_) { + [self removeWill]; + } + } + + if (panToIndex < 0 || panToIndex >= [self.dataSource numberOfControllersInDLSlideView:self]) { + panToIndex_ = panToIndex; + [self repositionForOffsetX:offsetx/2.0f]; + } + else{ + if (panToIndex != panToIndex_) { + //fix bug #5 +// if (willCtrl_) { +// [self removeWill]; +// } + willCtrl_ = [self.dataSource DLSlideView:self controllerAt:panToIndex]; + [self.baseViewController addChildViewController:willCtrl_]; + [willCtrl_ willMoveToParentViewController:self.baseViewController]; + [willCtrl_ beginAppearanceTransition:YES animated:YES]; + [self addSubview:willCtrl_.view]; + + panToIndex_ = panToIndex; + } + [self repositionForOffsetX:offsetx]; + } + } + else if (pan.state == UIGestureRecognizerStateEnded){ + float offsetx = point.x - panStartPoint_.x; + + if (panToIndex_ >= 0 && panToIndex_ < [self.dataSource numberOfControllersInDLSlideView:self] && panToIndex_ != oldIndex_) { + if (fabs(offsetx) > kPanSwitchOffsetThreshold) { + NSTimeInterval animatedTime = 0; + animatedTime = fabs(self.frame.size.width - fabs(offsetx)) / self.frame.size.width * 0.4; + [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; + [UIView animateWithDuration:animatedTime animations:^{ + [self repositionForOffsetX:offsetx > 0 ? self.bounds.size.width : -self.bounds.size.width]; + } completion:^(BOOL finished) { + //[self removeAt:oldIndex_]; + [self removeOld]; + + if (panToIndex_ >= 0 && panToIndex_ < [self.dataSource numberOfControllersInDLSlideView:self]) { + [willCtrl_ endAppearanceTransition]; + [willCtrl_ didMoveToParentViewController:self.baseViewController]; + oldIndex_ = panToIndex_; + oldCtrl_ = willCtrl_; + willCtrl_ = nil; + panToIndex_ = -1; + } + if (self.delegate && [self.delegate respondsToSelector:@selector(DLSlideView:didSwitchTo:)]) { + [self.delegate DLSlideView:self didSwitchTo:oldIndex_]; + } + }]; + } + else{ + [self backToOldWithOffset:offsetx]; + } + } + else{ + [self backToOldWithOffset:offsetx]; + } + } +} + +@end diff --git a/LJHY_User/Utils/DLSlideView/DLTabbarView/DLFixedTabbarView.h b/LJHY_User/Utils/DLSlideView/DLTabbarView/DLFixedTabbarView.h new file mode 100644 index 0000000..1d3e875 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLTabbarView/DLFixedTabbarView.h @@ -0,0 +1,31 @@ +// +// DLFixedTabbarView.h +// DLSlideController +// +// Created by Dongle Su on 14-12-8. +// Copyright (c) 2014年 dongle. All rights reserved. +// + +#import +#import "DLSlideTabbarProtocol.h" + +@interface DLFixedTabbarViewTabItem : NSObject +@property(nonatomic, strong) NSString *title; +@property(nonatomic, strong) UIImage *image; +@property(nonatomic, strong) UIImage *selectedImage; +@property(nonatomic, strong) UIColor *titleColor; +@property(nonatomic, strong) UIColor *selectedTitleColor; +@end + +@interface DLFixedTabbarView : UIView +@property(nonatomic, strong) UIImage *backgroundImage; +@property(nonatomic, strong) UIColor *trackColor; +@property(nonatomic, strong) NSArray *tabbarItems; +//- (void)addBarItemWithTitle:(NSString *)title titleColor:(UIColor *)titleColor image:(UIImage *)image selectedImage:(UIImage *)selectedImage; + +@property(nonatomic, assign) NSInteger selectedIndex; +@property(nonatomic, readonly) NSInteger tabbarCount; +@property(nonatomic, weak) id delegate; +- (void)switchingFrom:(NSInteger)fromIndex to:(NSInteger)toIndex percent:(float)percent; + +@end diff --git a/LJHY_User/Utils/DLSlideView/DLTabbarView/DLFixedTabbarView.m b/LJHY_User/Utils/DLSlideView/DLTabbarView/DLFixedTabbarView.m new file mode 100644 index 0000000..ee99f42 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLTabbarView/DLFixedTabbarView.m @@ -0,0 +1,206 @@ +// +// DLFixedTabbarView.m +// DLSlideController +// +// Created by Dongle Su on 14-12-8. +// Copyright (c) 2014年 dongle. All rights reserved. +// + +#import "DLFixedTabbarView.h" +#import "DLUtility.h" + +#define kTrackViewHeight 2 +#define kImageSpacingX 3.0f + +#define kLabelTagBase 1000 +#define kImageTagBase 2000 +#define kSelectedImageTagBase 3000 + +@implementation DLFixedTabbarViewTabItem +@end + +@implementation DLFixedTabbarView{ + UIScrollView *scrollView_; + UIImageView *backgroudView_; + UIImageView *trackView_; +} + +- (void)commonInit{ + _selectedIndex = -1; + + backgroudView_ = [[UIImageView alloc] initWithFrame:self.bounds]; + [self addSubview:backgroudView_]; + + scrollView_ = [[UIScrollView alloc] initWithFrame:self.bounds]; + [self addSubview:scrollView_]; + + trackView_ = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height-kTrackViewHeight-1, self.bounds.size.width, kTrackViewHeight)]; + [self addSubview:trackView_]; + trackView_.layer.cornerRadius = 2.0f; + + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)]; + [scrollView_ addGestureRecognizer:tap]; +} + +- (id)initWithCoder:(NSCoder *)aDecoder{ + if (self = [super initWithCoder:aDecoder]) { + [self commonInit]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame{ + if (self = [super initWithFrame:frame]) { + [self commonInit]; + } + return self; +} + +- (void)setBackgroundImage:(UIImage *)backgroundImage{ + backgroudView_.image = backgroundImage; +} + +- (void)setTrackColor:(UIColor *)trackColor{ + trackView_.backgroundColor = trackColor; +} + +- (void)setTabbarItems:(NSArray *)tabbarItems{ + if (_tabbarItems != tabbarItems) { + _tabbarItems = tabbarItems; + + assert(tabbarItems.count <= 4); + + float width = self.bounds.size.width/tabbarItems.count; + float height = self.bounds.size.height; + float x = 0.0f; + NSInteger i=0; + for (DLFixedTabbarViewTabItem *item in tabbarItems) { + UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(x, 0, width, height)]; + label.text = item.title; + label.font = [UIFont systemFontOfSize:15]; + label.backgroundColor = [UIColor clearColor]; + label.textColor = item.titleColor; + [label sizeToFit]; + label.tag = kLabelTagBase+i; + + UIImageView *imageView = [[UIImageView alloc] initWithImage:item.image]; + [imageView sizeToFit]; + imageView.tag = kImageTagBase+i; + + UIImageView *selectedImageView = [[UIImageView alloc] initWithImage:item.selectedImage]; + [selectedImageView sizeToFit]; + selectedImageView.alpha = 0.0f; + selectedImageView.tag = kSelectedImageTagBase+i; + + [scrollView_ addSubview:label]; + [scrollView_ addSubview:imageView]; + [scrollView_ addSubview:selectedImageView]; + i++; + } + + [self layoutTabbar]; + } +} + +- (void)layoutSubviews{ + [super layoutSubviews]; + + backgroudView_.frame = self.bounds; + scrollView_.frame = self.bounds; + [self layoutTabbar]; +} + +- (void)layoutTabbar{ + float width = self.bounds.size.width/self.tabbarItems.count; + float height = self.bounds.size.height; + float x = 0.0f; + for (NSInteger i=0; i= 0 && toIndex < [self tabbarCount]) { + DLFixedTabbarViewTabItem *toItem = [self.tabbarItems objectAtIndex:toIndex]; + UILabel *toLabel = (UILabel *)[scrollView_ viewWithTag:kLabelTagBase+toIndex]; + UIImageView *toIamge = (UIImageView *)[scrollView_ viewWithTag:kImageTagBase+toIndex]; + UIImageView *toSelectedIamge = (UIImageView *)[scrollView_ viewWithTag:kSelectedImageTagBase+toIndex]; + toLabel.textColor = [DLUtility getColorOfPercent:percent between:toItem.selectedTitleColor and:toItem.titleColor]; + toIamge.alpha = (1-percent); + toSelectedIamge.alpha = percent; + } + + float width = self.bounds.size.width/self.tabbarItems.count; + float trackX; + if (toIndex > fromIndex) { + trackX = width*fromIndex + width*percent; + } + else{ + trackX = width*fromIndex - width*percent; + } + + trackView_.frame = CGRectMake(trackX, trackView_.frame.origin.y, CGRectGetWidth(trackView_.bounds), CGRectGetHeight(trackView_.bounds)); +} + +- (void)setSelectedIndex:(NSInteger)selectedIndex{ + if (_selectedIndex != selectedIndex) { + if (_selectedIndex >= 0) { + DLFixedTabbarViewTabItem *fromItem = [self.tabbarItems objectAtIndex:_selectedIndex]; + UILabel *fromLabel = (UILabel *)[scrollView_ viewWithTag:kLabelTagBase+_selectedIndex]; + UIImageView *fromIamge = (UIImageView *)[scrollView_ viewWithTag:kImageTagBase+_selectedIndex]; + UIImageView *fromSelectedIamge = (UIImageView *)[scrollView_ viewWithTag:kSelectedImageTagBase+_selectedIndex]; + fromLabel.textColor = fromItem.titleColor; + fromIamge.alpha = 1.0f; + fromSelectedIamge.alpha = 0.0f; + } + + if (selectedIndex >= 0 && selectedIndex < [self tabbarCount]) { + DLFixedTabbarViewTabItem *toItem = [self.tabbarItems objectAtIndex:selectedIndex]; + UILabel *toLabel = (UILabel *)[scrollView_ viewWithTag:kLabelTagBase+selectedIndex]; + UIImageView *toIamge = (UIImageView *)[scrollView_ viewWithTag:kImageTagBase+selectedIndex]; + UIImageView *toSelectedIamge = (UIImageView *)[scrollView_ viewWithTag:kSelectedImageTagBase+selectedIndex]; + toLabel.textColor = toItem.selectedTitleColor; + toIamge.alpha = 0.0f; + toSelectedIamge.alpha = 1.0f; + } + + float width = self.bounds.size.width/self.tabbarItems.count; + float trackX = width*selectedIndex; + trackView_.frame = CGRectMake(trackX, trackView_.frame.origin.y, CGRectGetWidth(trackView_.bounds), CGRectGetHeight(trackView_.bounds)); + + _selectedIndex = selectedIndex; + } +} + +- (void)tapAction:(UITapGestureRecognizer *)tap{ + float width = self.bounds.size.width/self.tabbarItems.count; + + CGPoint point = [tap locationInView:scrollView_]; + NSInteger i = point.x/width; + self.selectedIndex = i; + if (self.delegate) { + [self.delegate DLSlideTabbar:self selectAt:i]; + } +} +@end diff --git a/LJHY_User/Utils/DLSlideView/DLTabbarView/DLScrollTabbarView.h b/LJHY_User/Utils/DLSlideView/DLTabbarView/DLScrollTabbarView.h new file mode 100644 index 0000000..c2e1035 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLTabbarView/DLScrollTabbarView.h @@ -0,0 +1,34 @@ +// +// DLScrollTabbarView.h +// DLSlideViewDemo +// +// Created by Dongle Su on 15-2-12. +// Copyright (c) 2015年 dongle. All rights reserved. +// + +#import +#import "DLSlideTabbarProtocol.h" + +@interface DLScrollTabbarItem : NSObject +@property(nonatomic, strong) NSString *title; +@property(nonatomic, assign) CGFloat widths; ++ (DLScrollTabbarItem *)itemWithTitle:(NSString *)title width:(CGFloat)width; +@end + +@interface DLScrollTabbarView : UIView +@property(nonatomic, strong) UIView *backgroundView; + +// tabbar属性 +@property (nonatomic, strong) UIColor *tabItemNormalColor UI_APPEARANCE_SELECTOR; +@property (nonatomic, strong) UIColor *tabItemSelectedColor UI_APPEARANCE_SELECTOR; +@property (nonatomic, assign) CGFloat tabItemNormalFontSize; +@property(nonatomic, strong) UIColor *trackColor UI_APPEARANCE_SELECTOR; +@property(nonatomic, strong) NSArray *tabbarItems; + +// DLSlideTabbarProtocol +@property(nonatomic, assign) NSInteger selectedIndex; +@property(nonatomic, readonly) NSInteger tabbarCount; +@property(nonatomic, weak) id delegate; +- (void)switchingFrom:(NSInteger)fromIndex to:(NSInteger)toIndex percent:(float)percent; + +@end diff --git a/LJHY_User/Utils/DLSlideView/DLTabbarView/DLScrollTabbarView.m b/LJHY_User/Utils/DLSlideView/DLTabbarView/DLScrollTabbarView.m new file mode 100644 index 0000000..1263a1c --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLTabbarView/DLScrollTabbarView.m @@ -0,0 +1,248 @@ +// +// DLScrollTabbarView.m +// DLSlideViewDemo +// +// Created by Dongle Su on 15-2-12. +// Copyright (c) 2015年 dongle. All rights reserved. +// + +#import "DLScrollTabbarView.h" +#import "DLUtility.h" + +#define kTrackViewHeight 2 +#define kImageSpacingX 3.0f + +#define kLabelTagBase 1000 +#define kImageTagBase 2000 +#define kSelectedImageTagBase 3000 +#define kViewTagBase 4000 + +@implementation DLScrollTabbarItem ++ (DLScrollTabbarItem *)itemWithTitle:(NSString *)title width:(CGFloat)width{ + DLScrollTabbarItem *item = [[DLScrollTabbarItem alloc] init]; + item.title = title; + item.widths = width; + return item; +} +@end + + +@implementation DLScrollTabbarView{ + UIScrollView *scrollView_; + UIImageView *trackView_; +} + +- (void)commonInit{ + _selectedIndex = -1; + + scrollView_ = [[UIScrollView alloc] initWithFrame:self.bounds]; + scrollView_.showsHorizontalScrollIndicator = NO; + [self addSubview:scrollView_]; + + trackView_ = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.bounds.size.height-kTrackViewHeight-1, self.bounds.size.width, kTrackViewHeight)]; + [scrollView_ addSubview:trackView_]; +// trackView_.layer.cornerRadius = 2.0f; + +} + +- (id)initWithCoder:(NSCoder *)aDecoder{ + if (self = [super initWithCoder:aDecoder]) { + [self commonInit]; + } + return self; +} + +- (id)initWithFrame:(CGRect)frame{ + if (self = [super initWithFrame:frame]) { + [self commonInit]; + } + return self; +} + +- (void)setBackgroundView:(UIView *)backgroundView{ + if (_backgroundView != backgroundView) { + [_backgroundView removeFromSuperview]; + [self insertSubview:backgroundView atIndex:0]; + _backgroundView = backgroundView; + } +} + +- (void)setTabItemNormalColor:(UIColor *)tabItemNormalColor{ + _tabItemNormalColor = tabItemNormalColor; + + for (int i=0; i<[self tabbarCount]; i++) { + if (i == self.selectedIndex) { + continue; + } + UILabel *label = (UILabel *)[scrollView_ viewWithTag:kLabelTagBase+i]; + label.textColor = tabItemNormalColor; + } +} + +- (void)setTabItemSelectedColor:(UIColor *)tabItemSelectedColor{ + _tabItemSelectedColor = tabItemSelectedColor; + + UILabel *label = (UILabel *)[scrollView_ viewWithTag:kLabelTagBase+self.selectedIndex]; + label.textColor = tabItemSelectedColor; +} + +- (void)setTrackColor:(UIColor *)trackColor{ + _trackColor = trackColor; + trackView_.backgroundColor = trackColor; +} + +- (void)setTabbarItems:(NSArray *)tabbarItems{ + if (_tabbarItems != tabbarItems) { + _tabbarItems = tabbarItems; + + float height = self.bounds.size.height; + float x = 0.0f; + NSInteger i=0; + for (DLScrollTabbarItem *item in tabbarItems) { + UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(x, 0, item.widths, height)]; + backView.backgroundColor = [UIColor clearColor]; + backView.tag = kViewTagBase + i; + UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, item.widths, height)]; + label.text = item.title; +// label.font = [UIFont systemFontOfSize:self.tabItemNormalFontSize]; + label.font = [UIFont systemFontOfSize:self.tabItemNormalFontSize]; + label.backgroundColor = [UIColor clearColor]; + label.textColor = self.tabItemNormalColor; + [label sizeToFit]; + label.tag = kLabelTagBase+i; + + label.frame = CGRectMake((item.widths-label.bounds.size.width)/2.0f, (height-label.bounds.size.height)/2.0f, CGRectGetWidth(label.bounds), CGRectGetHeight(label.bounds)); + [backView addSubview:label]; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)]; + [backView addGestureRecognizer:tap]; + + [scrollView_ addSubview:backView]; + x += item.widths; + i++; + } + scrollView_.contentSize = CGSizeMake(x, height); + + [self layoutTabbar]; + } +} + +- (void)layoutSubviews{ + [super layoutSubviews]; + + self.backgroundView.frame = self.bounds; + scrollView_.frame = self.bounds; + [self layoutTabbar]; +} + +- (void)layoutTabbar{ +// float width = self.bounds.size.width/self.tabbarItems.count; +// float height = self.bounds.size.height; +// float x = 0.0f; +// for (NSInteger i=0; i= 0 && toIndex < [self tabbarCount]) { + //DLScrollTabbarItem *toItem = [self.tabbarItems objectAtIndex:toIndex]; + toLabel = (UILabel *)[scrollView_ viewWithTag:kLabelTagBase+toIndex]; + toLabel.textColor = [DLUtility getColorOfPercent:percent between:self.tabItemSelectedColor and:self.tabItemNormalColor]; + } + + // 计算track view位置和宽度 + CGRect fromRc = [scrollView_ convertRect:fromLabel.bounds fromView:fromLabel]; + CGFloat fromWidth = fromLabel.frame.size.width; + CGFloat fromX = fromRc.origin.x; + CGFloat toX; + CGFloat toWidth; + if (toLabel) { + CGRect toRc = [scrollView_ convertRect:toLabel.bounds fromView:toLabel]; + toWidth = toRc.size.width; + toX = toRc.origin.x; + } + else{ + toWidth = fromWidth; + if (toIndex > fromIndex) { + toX = fromX + fromWidth; + } + else{ + toX = fromX - fromWidth; + } + } + + CGFloat width = toWidth * percent + fromWidth*(1-percent); + CGFloat x = fromX + (toX - fromX)*percent; + trackView_.frame = CGRectMake(x, trackView_.frame.origin.y, width, CGRectGetHeight(trackView_.bounds)); +} + +- (void)setSelectedIndex:(NSInteger)selectedIndex{ + if (_selectedIndex != selectedIndex) { + if (_selectedIndex >= 0) { + //DLScrollTabbarItem *fromItem = [self.tabbarItems objectAtIndex:_selectedIndex]; + UILabel *fromLabel = (UILabel *)[scrollView_ viewWithTag:kLabelTagBase+_selectedIndex]; + fromLabel.textColor = self.tabItemNormalColor; + } + + if (selectedIndex >= 0 && selectedIndex < [self tabbarCount]) { + //DLScrollTabbarItem *toItem = [self.tabbarItems objectAtIndex:selectedIndex]; + UILabel *toLabel = (UILabel *)[scrollView_ viewWithTag:kLabelTagBase+selectedIndex]; + toLabel.textColor = self.tabItemSelectedColor; + + UIView *selectedView = [scrollView_ viewWithTag:kViewTagBase+selectedIndex]; + //CGRect selectedRect = selectedView.frame; + CGRect rc = selectedView.frame; + //选中的居中显示 + rc = CGRectMake(CGRectGetMidX(rc) - scrollView_.bounds.size.width/2.0f, rc.origin.y, scrollView_.bounds.size.width, rc.size.height); +// 滚动左右两格到可见位置 +// if (selectedIndex > 0) { +// UIView *leftView = [scrollView_ viewWithTag:kViewTagBase+selectedIndex-1]; +// rc = CGRectUnion(rc, leftView.frame); +// } +// if (selectedIndex < [self tabbarCount]-1) { +// UIView *rightView = [scrollView_ viewWithTag:kViewTagBase+selectedIndex+1]; +// rc = CGRectUnion(rc, rightView.frame); +// } + [scrollView_ scrollRectToVisible:rc animated:YES]; + + // track view + CGRect trackRc = [scrollView_ convertRect:toLabel.bounds fromView:toLabel]; + trackView_.frame = CGRectMake(trackRc.origin.x, trackView_.frame.origin.y, trackRc.size.width, CGRectGetHeight(trackView_.bounds)); + } + +// float width = self.bounds.size.width/self.tabbarItems.count; +// float trackX = width*selectedIndex; +// trackView_.frame = CGRectMake(trackX, trackView_.frame.origin.y, CGRectGetWidth(trackView_.bounds), CGRectGetHeight(trackView_.bounds)); + + _selectedIndex = selectedIndex; + } +} + +- (void)tapAction:(UITapGestureRecognizer *)tap{ + NSInteger i = tap.view.tag - kViewTagBase; + self.selectedIndex = i; + if (self.delegate) { + [self.delegate DLSlideTabbar:self selectAt:i]; + } +} + + +@end diff --git a/LJHY_User/Utils/DLSlideView/DLTabbarView/DLSlideTabbarProtocol.h b/LJHY_User/Utils/DLSlideView/DLTabbarView/DLSlideTabbarProtocol.h new file mode 100644 index 0000000..3302f30 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLTabbarView/DLSlideTabbarProtocol.h @@ -0,0 +1,21 @@ +// +// DLSlideTabbarProtocol.h +// DLSlideController +// +// Created by Dongle Su on 14-12-8. +// Copyright (c) 2014年 dongle. All rights reserved. +// + +#import + +@protocol DLSlideTabbarDelegate +- (void)DLSlideTabbar:(id)sender selectAt:(NSInteger)index; +@end + +@protocol DLSlideTabbarProtocol +@property(nonatomic, assign) NSInteger selectedIndex; +@property(nonatomic, readonly) NSInteger tabbarCount; +@property(nonatomic, weak) id delegate; +- (void)switchingFrom:(NSInteger)fromIndex to:(NSInteger)toIndex percent:(float)percent; + +@end diff --git a/LJHY_User/Utils/DLSlideView/DLUtility.h b/LJHY_User/Utils/DLSlideView/DLUtility.h new file mode 100644 index 0000000..faf4e41 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLUtility.h @@ -0,0 +1,14 @@ +// +// DLUtility.h +// DLSlideViewDemo +// +// Created by Dongle Su on 15-2-12. +// Copyright (c) 2015年 dongle. All rights reserved. +// + +#import +#import + +@interface DLUtility : NSObject ++ (UIColor *)getColorOfPercent:(CGFloat)percent between:(UIColor *)color1 and:(UIColor *)color2; +@end diff --git a/LJHY_User/Utils/DLSlideView/DLUtility.m b/LJHY_User/Utils/DLSlideView/DLUtility.m new file mode 100644 index 0000000..205e547 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DLUtility.m @@ -0,0 +1,25 @@ +// +// DLUtility.m +// DLSlideViewDemo +// +// Created by Dongle Su on 15-2-12. +// Copyright (c) 2015年 dongle. All rights reserved. +// + +#import "DLUtility.h" + +@implementation DLUtility ++ (UIColor *)getColorOfPercent:(CGFloat)percent between:(UIColor *)color1 and:(UIColor *)color2{ + CGFloat red1, green1, blue1, alpha1; + [color1 getRed:&red1 green:&green1 blue:&blue1 alpha:&alpha1]; + + CGFloat red2, green2, blue2, alpha2; + [color2 getRed:&red2 green:&green2 blue:&blue2 alpha:&alpha2]; + + CGFloat p1 = percent; + CGFloat p2 = 1.0 - percent; + UIColor *mid = [UIColor colorWithRed:red1*p1+red2*p2 green:green1*p1+green2*p2 blue:blue1*p1+blue2*p2 alpha:1.0f]; + return mid; +} + +@end diff --git a/LJHY_User/Utils/DLSlideView/DlTabedSlideView.h b/LJHY_User/Utils/DLSlideView/DlTabedSlideView.h new file mode 100644 index 0000000..e7351c8 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DlTabedSlideView.h @@ -0,0 +1,55 @@ +// +// DLTabedSlideView.h +// DLSlideController +// +// Created by Dongle Su on 14-12-8. +// Copyright (c) 2014年 dongle. All rights reserved. +// + +#import +#import "DLSlideTabbarProtocol.h" +//#import "DLTabedSlideView.h" +@class DLTabedSlideView; +@interface DLTabedbarItem : NSObject +@property (nonatomic, strong) NSString *title; +@property(nonatomic, strong) UIImage *image; +@property(nonatomic, strong) UIImage *selectedImage; + ++ (DLTabedbarItem *)itemWithTitle:(NSString *)title image:(UIImage *)image selectedImage:(UIImage *)selectedImage; +@end + + + +@protocol DLTabedSlideViewDelegate +- (NSInteger)numberOfTabsInDLTabedSlideView:(DLTabedSlideView *)sender; +- (UIViewController *)DLTabedSlideView:(DLTabedSlideView *)sender controllerAt:(NSInteger)index; +@optional +- (void)DLTabedSlideView:(DLTabedSlideView *)sender didSelectedAt:(NSInteger)index; +@end + +@interface DlTabedSlideView : UIView +//@property(nonatomic, strong) NSArray *viewControllers; +@property(nonatomic, weak) UIViewController *baseViewController; +@property(nonatomic, assign) NSInteger selectedIndex; + + +//set tabbar properties. +@property (nonatomic, strong) UIColor *tabItemNormalColor; +@property (nonatomic, strong) UIColor *tabItemSelectedColor; +@property(nonatomic, strong) UIImage *tabbarBackgroundImage; +@property(nonatomic, strong) UIColor *tabbarTrackColor; +@property(nonatomic, strong) NSArray *tabbarItems; +@property(nonatomic, assign) float tabbarHeight; +@property(nonatomic, assign) float tabbarBottomSpacing; + +// cache properties +@property(nonatomic, assign) NSInteger cacheCount; + +- (void)buildTabbar; + +//@property(nonatomic, strong) IBOutlet id tabarView; + + +@property(nonatomic, weak)IBOutlet iddelegate; + +@end diff --git a/LJHY_User/Utils/DLSlideView/DlTabedSlideView.m b/LJHY_User/Utils/DLSlideView/DlTabedSlideView.m new file mode 100644 index 0000000..7fdc206 --- /dev/null +++ b/LJHY_User/Utils/DLSlideView/DlTabedSlideView.m @@ -0,0 +1,164 @@ +// +// DLTabedSlideView.m +// DLSlideController +// +// Created by Dongle Su on 14-12-8. +// Copyright (c) 2014年 dongle. All rights reserved. +// + +#import "DlTabedSlideView.h" +#import "DLFixedTabbarView.h" +#import "DLSlideView.h" +#import "DLLRUCache.h" + +#define kDefaultTabbarHeight 34 +#define kDefaultTabbarBottomSpacing 0 +#define kDefaultCacheCount 4 + +@implementation DLTabedbarItem ++ (DLTabedbarItem *)itemWithTitle:(NSString *)title image:(UIImage *)image selectedImage:(UIImage *)selectedImage{ + DLTabedbarItem *item = [[DLTabedbarItem alloc] init]; + item.title = title; + item.image = image; + item.selectedImage = selectedImage; + + return item; +} + +@end + +@interface DlTabedSlideView() + +@end + + +@implementation DlTabedSlideView{ + DLSlideView *slideView_; + DLFixedTabbarView *tabbar_; + DLLRUCache *ctrlCache_; +} + +- (void)commonInit{ + self.tabbarHeight = kDefaultTabbarHeight; + self.tabbarBottomSpacing = kDefaultTabbarBottomSpacing; + + tabbar_ = [[DLFixedTabbarView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, self.tabbarHeight)]; + tabbar_.delegate = self; + [self addSubview:tabbar_]; + + slideView_ = [[DLSlideView alloc] initWithFrame:CGRectMake(0, self.tabbarHeight+self.tabbarBottomSpacing, self.bounds.size.width, self.bounds.size.height-self.tabbarHeight-self.tabbarBottomSpacing)]; + slideView_.delegate = self; + slideView_.dataSource = self; + [self addSubview:slideView_]; + + ctrlCache_ = [[DLLRUCache alloc] initWithCount:4]; +} + +- (id)initWithCoder:(NSCoder *)aDecoder{ + if (self = [super initWithCoder:aDecoder]) { + [self commonInit]; + } + return self; +} +- (id)initWithFrame:(CGRect)frame{ + if (self = [super initWithFrame:frame]) { + [self commonInit]; + } + return self; +} + +- (void)layoutSubviews{ + [super layoutSubviews]; + + [self layoutBarAndSlide]; +} + +- (void)layoutBarAndSlide{ + UIView *barView = (UIView *)tabbar_; + barView.frame = CGRectMake(0, 0, CGRectGetWidth(self.bounds), self.tabbarHeight); + slideView_.frame = CGRectMake(0, self.tabbarHeight+self.tabbarBottomSpacing, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds)-self.tabbarHeight-self.tabbarBottomSpacing); + +} +//- (void)setViewControllers:(NSArray *)viewControllers{ +// //assert(self.tabarView == nil || viewControllers.count == [self.tabarView tabbarCount]); +// +// slideView_.viewControllers = viewControllers; +//} + +- (void)setBaseViewController:(UIViewController *)baseViewController{ + slideView_.baseViewController = baseViewController; +} + +- (void)buildTabbar{ + NSMutableArray *tabbarItems = [NSMutableArray array]; + for (DLTabedbarItem *item in self.tabbarItems) { + DLFixedTabbarViewTabItem *barItem = [[DLFixedTabbarViewTabItem alloc] init]; + barItem.title = item.title; + barItem.titleColor = self.tabItemNormalColor; + barItem.selectedTitleColor = self.tabItemSelectedColor; + barItem.image = item.image; + barItem.selectedImage = item.selectedImage; + + [tabbarItems addObject:barItem]; + } + + tabbar_.tabbarItems = tabbarItems; + tabbar_.trackColor = self.tabbarTrackColor; + tabbar_.backgroundImage = self.tabbarBackgroundImage; + +} +//- (void)setTabarView:(id)tabarView{ +// assert([tabarView isKindOfClass:[UIView class]]); +// assert(slideView_.viewControllers == nil || slideView_.viewControllers.count == [tabarView tabbarCount]); +// +// if (_tabarView != tabarView) { +// _tabarView.delegate = nil; +// _tabarView = tabarView; +// +// tabarView.delegate = self; +// [self layoutBarAndSlide]; +// +// } +//} + +- (void)setSelectedIndex:(NSInteger)selectedIndex{ + _selectedIndex = selectedIndex; + [slideView_ setSelectedIndex:selectedIndex]; + [tabbar_ setSelectedIndex:selectedIndex]; +} + +- (void)DLSlideTabbar:(id)sender selectAt:(NSInteger)index{ + [slideView_ setSelectedIndex:index]; +} + +- (NSInteger)numberOfControllersInDLSlideView:(DLSlideView *)sender{ + return [self.delegate numberOfTabsInDLTabedSlideView:self]; +} + +- (UIViewController *)DLSlideView:(DLSlideView *)sender controllerAt:(NSInteger)index{ + NSString *key = [NSString stringWithFormat:@"%ld", (long)index]; + if ([ctrlCache_ objectForKey:key]) { + return [ctrlCache_ objectForKey:key]; + } + else{ + UIViewController *ctrl = [self.delegate DLTabedSlideView:self controllerAt:index]; + [ctrlCache_ setObject:ctrl forKey:key]; + return ctrl; + } +} + +- (void)DLSlideView:(DLSlideView *)slide switchingFrom:(NSInteger)oldIndex to:(NSInteger)toIndex percent:(float)percent{ + [tabbar_ switchingFrom:oldIndex to:toIndex percent:percent]; +} +- (void)DLSlideView:(DLSlideView *)slide didSwitchTo:(NSInteger)index{ + [tabbar_ setSelectedIndex:index]; + if (self.delegate && [self.delegate respondsToSelector:@selector(DLTabedSlideView:didSelectedAt:)]) { + [self.delegate DLTabedSlideView:self didSelectedAt:index]; + } +} +- (void)DLSlideView:(DLSlideView *)slide switchCanceled:(NSInteger)oldIndex{ + [tabbar_ setSelectedIndex:oldIndex]; +} + + +@end diff --git a/LJHY_User/Utils/EMAlertView/EMAlertView.h b/LJHY_User/Utils/EMAlertView/EMAlertView.h new file mode 100644 index 0000000..73a1ee9 --- /dev/null +++ b/LJHY_User/Utils/EMAlertView/EMAlertView.h @@ -0,0 +1,30 @@ +// +// EMAlertView.h +// AlertView +// +// Created by EaseMob on 15/4/1. +// Copyright (c) 2015年 EaseMob. All rights reserved. +// + +#import + +@interface EMAlertView : UIAlertView + +/** + * 弹出提示框 + * + * @param title <#title description#> + * @param message <#message description#> + * @param block <#block description#> + * @param cancelButtonTitle <#cancelButtonTitle description#> + * @param otherButtonTitles <#otherButtonTitles description#> + * + * @return <#return value description#> + */ ++ (id)showAlertWithTitle:(NSString *)title + message:(NSString *)message + completionBlock:(void (^)(NSUInteger buttonIndex, EMAlertView *alertView))block + cancelButtonTitle:(NSString *)cancelButtonTitle + otherButtonTitles:(NSString *)otherButtonTitles, ...; + +@end diff --git a/LJHY_User/Utils/EMAlertView/EMAlertView.m b/LJHY_User/Utils/EMAlertView/EMAlertView.m new file mode 100644 index 0000000..c695759 --- /dev/null +++ b/LJHY_User/Utils/EMAlertView/EMAlertView.m @@ -0,0 +1,103 @@ +// +// EMAlertView.m +// AlertView +// +// Created by EaseMob on 15/4/1. +// Copyright (c) 2015年 EaseMob. All rights reserved. +// + +#import "EMAlertView.h" +#import + +@interface EMAlertView () + +@end + +@implementation EMAlertView + +void EMNoTitleAlert(NSString* message) { + UIAlertView* alert = [[UIAlertView alloc] initWithTitle:message + message:nil + delegate:nil + cancelButtonTitle:@"确定" + otherButtonTitles:nil]; + [alert show]; +} + ++ (id)showAlertWithTitle:(NSString *)title message:(NSString *)message + completionBlock:(void (^)(NSUInteger buttonIndex, EMAlertView *alertView))block + cancelButtonTitle:(NSString *)cancelButtonTitle + otherButtonTitles:(NSString *)otherButtonTitles, ... +{ + if (!cancelButtonTitle && !otherButtonTitles) { + return nil; + } + EMAlertView *alertView = [[self alloc] initWithTitle:title + message:message + completionBlock:block + cancelButtonTitle:cancelButtonTitle + otherButtonTitles:nil]; + + if (otherButtonTitles != nil) { + id eachObject; + va_list argumentList; + if (otherButtonTitles) { + [alertView addButtonWithTitle:otherButtonTitles]; + va_start(argumentList, otherButtonTitles); + while ((eachObject = va_arg(argumentList, id))) { + [alertView addButtonWithTitle:eachObject]; + } + va_end(argumentList); + } + } + + [alertView show]; + + return alertView; + +} + + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex +{ + void (^block)(NSUInteger buttonIndex, UIAlertView *alertView) = objc_getAssociatedObject(self, "blockCallback"); + if (block) { + block(buttonIndex, self); + } +} + + +- (id)initWithTitle:(NSString *)title + message:(NSString *)message + completionBlock:(void (^)(NSUInteger buttonIndex, EMAlertView *alertView))block + cancelButtonTitle:(NSString *)cancelButtonTitle + otherButtonTitles:(NSString *)otherButtonTitles, ... { + + objc_setAssociatedObject(self, "blockCallback", [block copy], OBJC_ASSOCIATION_RETAIN_NONATOMIC); + + if (self = [self initWithTitle:title + message:message + delegate:self + cancelButtonTitle:nil + otherButtonTitles:nil]) { + + if (cancelButtonTitle) { + [self addButtonWithTitle:cancelButtonTitle]; + self.cancelButtonIndex = [self numberOfButtons] - 1; + } + + id eachObject; + va_list argumentList; + if (otherButtonTitles) { + [self addButtonWithTitle:otherButtonTitles]; + va_start(argumentList, otherButtonTitles); + while ((eachObject = va_arg(argumentList, id))) { + [self addButtonWithTitle:eachObject]; + } + va_end(argumentList); + } + } + return self; +} + +@end diff --git a/LJHY_User/Utils/GetCurrentVC/AppCurrentControllerTool.h b/LJHY_User/Utils/GetCurrentVC/AppCurrentControllerTool.h new file mode 100644 index 0000000..c9f5679 --- /dev/null +++ b/LJHY_User/Utils/GetCurrentVC/AppCurrentControllerTool.h @@ -0,0 +1,14 @@ +// +// AppCurrentControllerTool.h +// yiliaotoutiao +// +// Created by Jason T on 16/2/15. +// Copyright © 2016年 YXH. All rights reserved. +// + +#import + +@interface AppCurrentControllerTool : NSObject + ++ (UIViewController *)getCurrentController; +@end diff --git a/LJHY_User/Utils/GetCurrentVC/AppCurrentControllerTool.m b/LJHY_User/Utils/GetCurrentVC/AppCurrentControllerTool.m new file mode 100644 index 0000000..7c956d6 --- /dev/null +++ b/LJHY_User/Utils/GetCurrentVC/AppCurrentControllerTool.m @@ -0,0 +1,96 @@ +// +// AppCurrentControllerTool.m +// yiliaotoutiao +// +// Created by Jason T on 16/2/15. +// Copyright © 2016年 YXH. All rights reserved. +// + +#import "AppCurrentControllerTool.h" + + +@implementation UIView(parentViewController) + +//1.提供一个UIView的分类方法,这个方法通过响应者链条获取view所在的控制器 + +- (UIViewController *)parentController +{ + UIResponder *responder = [self nextResponder]; + while (responder) { + if ([responder isKindOfClass:[UIViewController class]]) { + return (UIViewController *)responder; + } + responder = [responder nextResponder]; + } + return nil; +} + +@end + + +@implementation AppCurrentControllerTool + + + +//2.通过控制器的布局视图可以获取到控制器实例对象 +// +//modal的展现方式需要取到控制器的根视图 + ++ (UIViewController *)getCurrentController +{ + UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; + // modal展现方式的底层视图不同 + // 取到第一层时,取到的是UITransitionView,通过这个view拿不到控制器 + UIView *firstView = [keyWindow.subviews firstObject]; + UIView *secondView = [firstView.subviews firstObject]; + UIViewController *vc = secondView.parentController; + if ([vc isKindOfClass:[UITabBarController class]]) { + UITabBarController *tab = (UITabBarController *)vc; + if ([tab.selectedViewController isKindOfClass:[UINavigationController class]]) { + UINavigationController *nav = (UINavigationController *)tab.selectedViewController; + return [nav.viewControllers lastObject]; + } else { + return tab.selectedViewController; + } + } else if ([vc isKindOfClass:[UINavigationController class]]) { + UINavigationController *nav = (UINavigationController *)vc; + return [nav.viewControllers lastObject]; + } else { + return vc; + } + return nil; +} +/* ++ (UIViewController *)getCurrentController +{ + + UIViewController *result = nil; + + UIWindow * window = [[UIApplication sharedApplication] keyWindow]; + if (window.windowLevel != UIWindowLevelNormal) + { + NSArray *windows = [[UIApplication sharedApplication] windows]; + for(UIWindow * tmpWin in windows) + { + if (tmpWin.windowLevel == UIWindowLevelNormal) + { + window = tmpWin; + break; + } + } + } + + UIView *frontView = [[window subviews] objectAtIndex:0]; + id nextResponder = [frontView nextResponder]; + + if ([nextResponder isKindOfClass:[UIViewController class]]) + result = nextResponder; + else + result = window.rootViewController; + + return result; + +} + +*/ +@end diff --git a/LJHY_User/Utils/KJCountDown/UIViewController+countDown.h b/LJHY_User/Utils/KJCountDown/UIViewController+countDown.h new file mode 100644 index 0000000..b08fe3e --- /dev/null +++ b/LJHY_User/Utils/KJCountDown/UIViewController+countDown.h @@ -0,0 +1,18 @@ +// +// UIButton+countDown.h +// kangzhipifuyisheng +// +// Created by Jason T on 15/10/28. +// Copyright © 2015年 KangZhi. All rights reserved. +// + +#import +typedef void (^ myBlock)(int processTime); +@interface NSObject (countDown) + + +//+ (UIViewController *)addCountDownWithDuration:(int)duration andspeed:(int)speedTime andCounting:(myBlock)countingBlock andCountdown:(myBlock)countDownBlock; + +- (void )addCountDownWithDuration:(int)duration andspeed:(int)speedTime andCounting:(myBlock)countingBlock andCountdown:(myBlock)countDownBlock; + +@end diff --git a/LJHY_User/Utils/KJCountDown/UIViewController+countDown.m b/LJHY_User/Utils/KJCountDown/UIViewController+countDown.m new file mode 100644 index 0000000..3b2977a --- /dev/null +++ b/LJHY_User/Utils/KJCountDown/UIViewController+countDown.m @@ -0,0 +1,73 @@ + +// +// UIButton+countDown.m +// kangzhipifuyisheng +// +// Created by Jason T on 15/10/28. +// Copyright © 2015年 KangZhi. All rights reserved. +// + +#import "UIViewController+countDown.h" +static int duration0; +static int speedTime0; + +@implementation UIViewController (countDown) + + +//+ (UIViewController *)addCountDownWithDuration:(int)duration andspeed:(int)speedTime andCounting:(myBlock)countingBlock andCountdown:(myBlock)countDownBlock +//{ +// +// duration0 = duration; +// speedTime0 = speedTime; +// return [[self alloc] addCountDownWithDuration:duration andspeed:speedTime andCounting:countingBlock andCountdown:countDownBlock]; +//} + + + +- (void)addCountDownWithDuration:(int)duration andspeed:(int)speedTime andCounting:(myBlock)countingBlock andCountdown:(myBlock)countDownBlock +{ + duration0 = duration; + speedTime0 = speedTime; + +// return [self startTimeWithCounting:countingBlock andCountdown:countDownBlock]; + [self startTimeWithCounting:countingBlock andCountdown:countDownBlock]; + +} + + + +-(void)startTimeWithCounting:(myBlock)countingBlock andCountdown:(myBlock)countDownBlock +{ + __block int timeout=duration0; //倒计时时间 + dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); + dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,queue); + dispatch_source_set_timer(_timer,dispatch_walltime(NULL, 0),speedTime0*NSEC_PER_SEC, 0); //每秒执行 + dispatch_source_set_event_handler(_timer, ^{ + if(timeout<=0){ //倒计时结束,关闭 + dispatch_source_cancel(_timer); + dispatch_async(dispatch_get_main_queue(), ^{ + + if (countDownBlock) { + countDownBlock(0); + } + + }); + }else{ + // int minutes = timeout / 60; + int seconds = (timeout-1) % 60; + NSString *strTime = [NSString stringWithFormat:@"%.2d", seconds]; + dispatch_async(dispatch_get_main_queue(), ^{ + //设置界面的按钮显示 根据自己需求设置 +// NSLog(@"____%@",strTime); + if (countingBlock) { + countingBlock(seconds); + } + + }); + timeout--; + + } + }); + dispatch_resume(_timer); +} +@end diff --git a/LJHY_User/Utils/LimitTextField/LimitTextField.h b/LJHY_User/Utils/LimitTextField/LimitTextField.h new file mode 100644 index 0000000..367d353 --- /dev/null +++ b/LJHY_User/Utils/LimitTextField/LimitTextField.h @@ -0,0 +1,19 @@ +// +// UITextField+Limit.h +// yiliaotoutiao +// +// Created by Jason T on 16/5/26. +// Copyright © 2016年 YLTT. All rights reserved. +// + +//#import +#import + +@interface LimitTextField : UITextField + +@property (nonatomic,assign)NSUInteger kMaxLength; + +@property (nonatomic,copy)void (^ inptutBlock)(NSString * inputStr); +@end + + diff --git a/LJHY_User/Utils/LimitTextField/LimitTextField.m b/LJHY_User/Utils/LimitTextField/LimitTextField.m new file mode 100644 index 0000000..c6535ab --- /dev/null +++ b/LJHY_User/Utils/LimitTextField/LimitTextField.m @@ -0,0 +1,84 @@ +// +// UITextField+Limit.m +// yiliaotoutiao +// +// Created by Jason T on 16/5/26. +// Copyright © 2016年 YLTT. All rights reserved. +// + + +//@implementation LimitTextField +#import "LimitTextField.h" +@implementation LimitTextField + + + +- (void)awakeFromNib +{ + [super awakeFromNib]; + + [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textFiledEditChanged:) name:@"UITextFieldTextDidChangeNotification"object:self]; + + +} + +- (void)setText:(NSString *)text +{ + [super setText:text]; + + + +} + + +-(void)textFiledEditChanged:(NSNotification *)obj{ + UITextField *textField = (UITextField *)obj.object; + + NSString *toBeString = textField.text; + NSString *lang = [[UITextInputMode currentInputMode] primaryLanguage]; // 键盘输入模式 + if ([lang isEqualToString:@"zh-Hans"]) { // 简体中文输入,包括简体拼音,健体五笔,简体手写 + UITextRange *selectedRange = [textField markedTextRange]; + //获取高亮部分 + UITextPosition *position = [textField positionFromPosition:selectedRange.start offset:0]; + // 没有高亮选择的字,则对已输入的文字进行字数统计和限制 + if (!position) { + if (toBeString.length > _kMaxLength) { + textField.text = [toBeString substringToIndex:_kMaxLength]; + + if (self.inptutBlock) + { + self.inptutBlock(textField.text); + } + } + } + // 有高亮选择的字符串,则暂不对文字进行统计和限制 + else{ + + } + } + // 中文输入法以外的直接对其统计限制即可,不考虑其他语种情况 + else{ + if (toBeString.length > _kMaxLength) { + textField.text = [toBeString substringToIndex:_kMaxLength]; + if (self.inptutBlock) + { + self.inptutBlock(textField.text); + } + } + } + + if (self.inptutBlock) + { + self.inptutBlock(textField.text); + } +} + +-(void)dealloc{ + [[NSNotificationCenter defaultCenter]removeObserver:self + name:@"UITextFieldTextDidChangeNotification" + object:self]; +} + + + +@end \ No newline at end of file diff --git a/LJHY_User/Utils/PJTernarySearchTree/PJTernarySearchTree.h b/LJHY_User/Utils/PJTernarySearchTree/PJTernarySearchTree.h new file mode 100755 index 0000000..7cf0bd5 --- /dev/null +++ b/LJHY_User/Utils/PJTernarySearchTree/PJTernarySearchTree.h @@ -0,0 +1,64 @@ +// +// PJTernarySearchTree.h +// PJAutocomplete +// +// Created by Yichao 'Peak' Ji on 2013-2-22. + +// This code is distributed under the terms and conditions of the MIT license. + +// Copyright (c) 2013 Yichao 'Peak' Ji +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated 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: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// 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. + + +#import + +@protocol PJSearchableItem +- (NSString *)stringValue; +@end + +typedef void(^PJTernarySearchResultBlock)(NSArray * retrieved); + +@interface PJTernarySearchTree : NSObject + +/* Managing item/string */ + +- (void)insertItem:(id)item; +- (void)insertString:(NSString *)str; + +- (void)removeItem:(id)item; +- (void)removeString:(NSString *)str; + +/* Retrieving */ + +- (NSArray *)retrievePrefix:(NSString *)prefix; +- (NSArray *)retrievePrefix:(NSString *)prefix countLimit:(NSUInteger)countLimit; // 0 = no limit + +- (void)retrievePrefix:(NSString *)prefix callback:(PJTernarySearchResultBlock)callback; +- (void)retrievePrefix:(NSString *)prefix countLimit:(NSUInteger)countLimit callback:(PJTernarySearchResultBlock)callback; + +- (NSArray *)retrieveAll; +- (NSArray *)retrieveAllWithCountLimit:(NSUInteger)countLimit; + +/* Serializing */ + +- (void)saveTreeToFile:(NSString *)path; ++ (PJTernarySearchTree *)treeWithFile:(NSString *)path; + +@end diff --git a/LJHY_User/Utils/PJTernarySearchTree/PJTernarySearchTree.m b/LJHY_User/Utils/PJTernarySearchTree/PJTernarySearchTree.m new file mode 100755 index 0000000..bb0764d --- /dev/null +++ b/LJHY_User/Utils/PJTernarySearchTree/PJTernarySearchTree.m @@ -0,0 +1,520 @@ +// +// PJTernarySearchTree.m +// PJAutocomplete +// +// Created by Yichao 'Peak' Ji on 2013-2-22. + +#import "PJTernarySearchTree.h" + +#pragma mark - PJTernarySearchTreeNode + +@interface PJTernarySearchTreeNode : NSObject { +@public + PJTernarySearchTreeNode * descendingChild; + PJTernarySearchTreeNode * equalChild; + PJTernarySearchTreeNode * ascendingChild; +} + +@property (strong) id item; +@property (readwrite) unichar nodeChar; + +@end + +@implementation PJTernarySearchTreeNode + +#define kItemKey @"item" +#define kNodeCharKey @"nodeChar" +#define kDescendingChildKey @"de" +#define kEqualChildKey @"eq" +#define kAscendingChildKey @"as" + +#pragma mark - NSCoding Delegate + +- (void)encodeWithCoder:(NSCoder *)aCoder{ + + if((self.item!=nil)&&([self.item conformsToProtocol:@protocol(PJSearchableItem)]==YES)) + { + [aCoder encodeObject:self.item forKey:kItemKey]; + } + if([NSString stringWithFormat:@"%C",self.nodeChar]!=nil) + { + [aCoder encodeObject:[NSString stringWithFormat:@"%C",self.nodeChar] forKey:kNodeCharKey]; + } + if(descendingChild!=nil) + { + [aCoder encodeObject:descendingChild forKey:kDescendingChildKey]; + } + if(equalChild!=nil) + { + [aCoder encodeObject:equalChild forKey:kEqualChildKey]; + } + if(ascendingChild!=nil) + { + [aCoder encodeObject:ascendingChild forKey:kAscendingChildKey]; + } +} + + +- (id)initWithCoder:(NSCoder *)aDecoder{ + + if (self = [self init]) + { + if([aDecoder decodeObjectForKey:kItemKey]!=nil) + { + self.item = [aDecoder decodeObjectForKey:kItemKey]; + } + if([aDecoder decodeObjectForKey:kNodeCharKey]!=nil) + { + self.nodeChar = [[aDecoder decodeObjectForKey:kNodeCharKey] characterAtIndex:0]; + } + if([aDecoder decodeObjectForKey:kAscendingChildKey]!=nil) + { + ascendingChild = [aDecoder decodeObjectForKey:kAscendingChildKey]; + } + else + { + ascendingChild = nil; + } + if([aDecoder decodeObjectForKey:kDescendingChildKey]!=nil) + { + descendingChild = [aDecoder decodeObjectForKey:kDescendingChildKey]; + } + else + { + descendingChild = nil; + } + if([aDecoder decodeObjectForKey:kEqualChildKey]!=nil) + { + equalChild = [aDecoder decodeObjectForKey:kEqualChildKey]; + } + else + { + equalChild = nil; + } + + } + return self; + +} + +@end + + +#pragma mark - PJSearchableString (NSString add-on) + +@interface NSString (PJSearchableString) + +- (NSString *)stringValue; + +@end + +@implementation NSString (PJSearchableString) + +- (NSString *)stringValue{ + return (NSString *)self; +} + +@end + + +#pragma mark - PJTernarySearchTree + +@interface PJTernarySearchTree () + +@property (strong) PJTernarySearchTreeNode * rootNode; +@property (strong) NSString * lastPrefix; +@property (strong) PJTernarySearchTreeNode * lastResultNode; + +@end + + +@implementation PJTernarySearchTree + +@synthesize rootNode; + +- (id)init{ + self = [super init]; + if (self) { + self.rootNode = nil; + self.lastPrefix = nil; + self.lastResultNode = nil; + } + return self; +} + + +#pragma mark - NSCoding Delegate + +#define kRootKey @"root" + +- (void)encodeWithCoder:(NSCoder *)aCoder{ + + if(self.rootNode!=nil) + { + [aCoder encodeObject:self.rootNode forKey:kRootKey]; + } +} + + +- (id)initWithCoder:(NSCoder *)aDecoder{ + + if (self = [self init]) + { + if([aDecoder decodeObjectForKey:kRootKey]!=nil) + { + self.rootNode = [aDecoder decodeObjectForKey:kRootKey]; + } + + } + return self; + +} + + +#pragma mark - Managing + +- (void)insertItem:(id)item{ + + if(item==nil||([item isKindOfClass:[NSString class]]&&((NSString *)item).length==0)) + { + return; + } + + NSString * stringValue = [item stringValue]; + + PJTernarySearchTreeNode * __strong * found = &(self->rootNode),* node = self->rootNode,* parent = nil; + + int index = 0; + + while (index < [stringValue length]) { + unichar ch = [stringValue characterAtIndex:index]; + if (!node) { + * found = [[PJTernarySearchTreeNode alloc] init]; + node = *found; + node.nodeChar = ch; + } + if (ch < node.nodeChar) { + found = &(node->descendingChild); + node = node->descendingChild; + } else if (ch == node.nodeChar) { + parent = node; + found = &(node->equalChild); + node = node->equalChild; + index++; + } else { + found = &(node->ascendingChild); + node = node->ascendingChild; + } + } + + if (parent.item == nil) { + parent.item = item; + } else { + if ([parent.item isKindOfClass:[NSMutableArray class]]) { + [(NSMutableArray *)parent.item addObject:item]; + } else { + parent.item = [NSMutableArray arrayWithObjects:parent.item,item, nil]; + } + } +} + +- (void)insertString:(NSString *)str{ + [self insertItem:str]; +} + +- (BOOL)isEmptyNode:(PJTernarySearchTreeNode *)node{ + if((node==nil)||(node.item==nil && node->descendingChild==nil && node->equalChild==nil && node->ascendingChild==nil)) + { + return YES; + } + else + { + return NO; + } +} + +- (void)removeItem:(id)item{ + + self.lastResultNode = nil; + self.lastPrefix = nil; + + NSMutableArray * route = [self routePrefixRoot:[item stringValue]]; + + PJTernarySearchTreeNode * node = [route lastObject]; + + if(node!=nil) + { + node.item = nil; + } + + if([self isEmptyNode:node]==YES) + { + for(NSInteger i = [route count]-1;i>=0;i--) + { + PJTernarySearchTreeNode * checkNode = [route objectAtIndex:i]; + + if(checkNode->ascendingChild!=nil && ([self isEmptyNode:checkNode->ascendingChild]==YES)) + { + checkNode->ascendingChild = nil; + } + else + { + break; + } + if(checkNode->equalChild!=nil && ([self isEmptyNode:checkNode->equalChild]==YES)) + { + checkNode->equalChild = nil; + } + else + { + break; + } + if(checkNode->descendingChild!=nil && ([self isEmptyNode:checkNode->descendingChild]==YES)) + { + checkNode->descendingChild = nil; + } + else + { + break; + } + } + } +} + +- (void)removeString:(NSString *)str{ + [self removeItem:str]; +} + + +#pragma mark - Main + +- (NSMutableArray *)routePrefixRoot:(NSString*)prefix{ + + NSInteger index = 0; + + NSMutableArray * array = [NSMutableArray array]; + + PJTernarySearchTreeNode * node = self->rootNode,* found; + + while (index < [prefix length]) { + + unichar ch = [prefix characterAtIndex:index]; + if (ch < node.nodeChar) { + if (!node->descendingChild) { + return nil; + } + node = node->descendingChild; + + continue; + } else if (ch == node.nodeChar) { + found = node; + [array addObject:found]; + node = node->equalChild; + index++; + continue; + } else { + if (!node->ascendingChild) { + return nil; + } + node = node->ascendingChild; + continue; + } + } + return array; +} + +- (PJTernarySearchTreeNode *)locatePrefixRoot:(NSString*)prefix withRootNode:(PJTernarySearchTreeNode *)root{ + + NSInteger index = 0; + + PJTernarySearchTreeNode * node = self->rootNode,* found; + + if(root!=nil && (self.lastPrefix!=nil)) + { + node = root; + index = [prefix length] - ([prefix length] - [self.lastPrefix length]) - 1; + } + + while (index < [prefix length]) { + + if(!node){ + return nil; + } + + unichar ch = [prefix characterAtIndex:index]; + if (ch < node.nodeChar) { + if (!node->descendingChild) { + return nil; + } + node = node->descendingChild; + + continue; + } else if (ch == node.nodeChar) { + found = node; + node = node->equalChild; + index++; + continue; + } else { + if (!node->ascendingChild) { + return nil; + } + node = node->ascendingChild; + continue; + } + } + return found; +} + ++ (void)addItems:(PJTernarySearchTreeNode*)node toArray:(NSMutableArray*)output limit:(NSUInteger)countLimit{ + if ((countLimit!=0)&&([output count]>=countLimit)) { + return; + } + if (!node.item) { + return; + } + if ([node.item isKindOfClass:[NSArray class]]) { + [output addObjectsFromArray:node.item]; + } else { + [output addObject:node.item]; + } +} + +- (void)retrieveNodeFrom:(PJTernarySearchTreeNode *)prefixedRoot toArray:(NSMutableArray*)output limit:(NSUInteger)countLimit{ + + if ((countLimit!=0)&&([output count]>=countLimit)) { + return; + } + if (prefixedRoot == nil) { + return; + } + [self retrieveNodeFrom:prefixedRoot->descendingChild toArray:output limit:countLimit]; + [PJTernarySearchTree addItems:prefixedRoot toArray:output limit:countLimit]; + [self retrieveNodeFrom:prefixedRoot->equalChild toArray:output limit:countLimit]; + [self retrieveNodeFrom:prefixedRoot->ascendingChild toArray:output limit:countLimit]; +} + +#pragma mark - Retrieving + +- (NSArray *)retrieveAll{ + return [self retrieveAllWithCountLimit:0]; +} + +- (NSArray *)retrieveAllWithCountLimit:(NSUInteger)countLimit{ + + NSMutableArray* output = [NSMutableArray array]; + [PJTernarySearchTree addItems:self.rootNode toArray:output limit:countLimit]; + if(self.rootNode==nil) + { + return [NSArray array]; + } + [self retrieveNodeFrom:self.rootNode->descendingChild toArray:output limit:countLimit]; + [self retrieveNodeFrom:self.rootNode->equalChild toArray:output limit:countLimit]; + [self retrieveNodeFrom:self.rootNode->ascendingChild toArray:output limit:countLimit]; + + if ((countLimit!=0)&&([output count]>=countLimit)) { + return [NSArray arrayWithArray:[output objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, countLimit)]]]; + } + else + { + return [NSArray arrayWithArray:output]; + } +} + +- (NSArray *)retrievePrefix:(NSString *)prefix countLimit:(NSUInteger)countLimit{ + + if(prefix==nil) + { + prefix = @""; + } + + PJTernarySearchTreeNode * prefixedRoot = nil; + if(prefix.length==0) + { + return [self retrieveAllWithCountLimit:countLimit]; + } + else + { + if(self.lastPrefix!=nil && ([prefix hasPrefix:self.lastPrefix]==YES)) + { + prefixedRoot = [self locatePrefixRoot:prefix withRootNode:self.lastResultNode]; + } + else + { + prefixedRoot = [self locatePrefixRoot:prefix withRootNode:nil]; + } + } + + if(!prefixedRoot) + { + return [NSArray array]; + } + + self.lastResultNode = prefixedRoot; + self.lastPrefix = [NSString stringWithString:prefix]; + + NSMutableArray* output = [NSMutableArray array]; + [PJTernarySearchTree addItems:prefixedRoot toArray:output limit:countLimit]; + + [self retrieveNodeFrom:prefixedRoot->equalChild toArray:output limit:countLimit]; + + if ((countLimit!=0)&&([output count]>=countLimit)) { + return [NSArray arrayWithArray:[output objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, countLimit)]]]; + } + else + { + return [NSArray arrayWithArray:output]; + } +} + +- (NSArray *)retrievePrefix:(NSString *)prefix{ + + return [self retrievePrefix:prefix countLimit:0]; +} + +- (void)retrievePrefix:(NSString *)prefix callback:(PJTernarySearchResultBlock)callback{ + [self retrievePrefix:prefix countLimit:0 callback:callback]; +} + +- (void)retrievePrefix:(NSString *)prefix countLimit:(NSUInteger)countLimit callback:(PJTernarySearchResultBlock)callback{ + + if(!callback) + { + return; + } + + dispatch_queue_t ternary_search_queue; + + ternary_search_queue = dispatch_queue_create([[NSString stringWithFormat:@"com.PeakJi.PJAutocomplete.ternary_search.%@",prefix] UTF8String], nil); + + dispatch_async(ternary_search_queue, ^{ + + NSArray * array = [self retrievePrefix:prefix countLimit:countLimit]; + + dispatch_async(dispatch_get_main_queue(), ^{ + + callback(array); + + }); + }); +} + +#pragma mark - Serializing + +- (void)saveTreeToFile:(NSString *)path{ + __autoreleasing NSData * data = [NSKeyedArchiver archivedDataWithRootObject:self]; + [data writeToFile:path atomically:YES]; +} + ++ (PJTernarySearchTree *)treeWithFile:(NSString *)path{ + if (path == nil || [path length] == 0 || + [[NSFileManager defaultManager] fileExistsAtPath:path] == NO){ + return nil; + } + else + { + __autoreleasing PJTernarySearchTree * tree = [NSKeyedUnarchiver unarchiveObjectWithFile:path]; + return tree; + } +} + +@end diff --git a/LJHY_User/Utils/PlaceholderTextView/PlaceholderTextView.h b/LJHY_User/Utils/PlaceholderTextView/PlaceholderTextView.h new file mode 100755 index 0000000..e32f3da --- /dev/null +++ b/LJHY_User/Utils/PlaceholderTextView/PlaceholderTextView.h @@ -0,0 +1,30 @@ +// +// PlaceholderTextView.h +// SaleHelper +// +// Created by gitBurning on 14/12/8. +// Copyright (c) 2014年 Burning_git. All rights reserved. +// + +#import + + +/** + * 要是用非 arc。。。。。。// -fno-objc-arc + */ +@interface PlaceholderTextView : UITextView +//{ +// UILabel *PlaceholderLabel; +//} +@property (nonatomic,strong)UILabel * PlaceholderLabel; +@property(copy,nonatomic) NSString *placeholder; +@property(strong,nonatomic) UIColor *placeholderColor; +@property(strong,nonatomic) UIFont * placeholderFont; +@property (nonatomic,assign)int maxCount; +@property (nonatomic,copy)void (^ inptutBlock)(NSString * inputStr); +@property (nonatomic,copy)void (^ didEndInputBlock)(NSString * inputStr); +@end + +// 版权属于原作者 +// http://code4app.com (cn) http://code4app.net (en) +// 发布代码于最专业的源码分享网站: Code4App.com diff --git a/LJHY_User/Utils/PlaceholderTextView/PlaceholderTextView.m b/LJHY_User/Utils/PlaceholderTextView/PlaceholderTextView.m new file mode 100755 index 0000000..3eb3c04 --- /dev/null +++ b/LJHY_User/Utils/PlaceholderTextView/PlaceholderTextView.m @@ -0,0 +1,158 @@ +// +// PlaceholderTextView.m +// SaleHelper +// +// Created by gitBurning on 14/12/8. +// Copyright (c) 2014年 Burning_git. All rights reserved. +// + +#import "PlaceholderTextView.h" + +@interface PlaceholderTextView() + + +@end +@implementation PlaceholderTextView + +- (id) initWithFrame:(CGRect)frame { + if ((self = [super initWithFrame:frame])) { + [self awakeFromNib]; + self.backgroundColor = [UIColor whiteColor]; + } + return self; +} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + + //输入占位字符的时候重新调整label 的大小 + //占位字符和输入的大小一致。 + _PlaceholderLabel.font = self.placeholderFont; + _PlaceholderLabel.textColor = self.placeholderColor; + [_PlaceholderLabel sizeToFit]; + + + + //如果有内容和占位字符,优先显示内容 + if(![self.text isEqualToString:@""]) { + _PlaceholderLabel.hidden=YES; + } + else + { + _PlaceholderLabel.hidden=NO; + } + + +} + + +- (void)setText:(NSString *)text +{ + [super setText:text]; + if (text.length > 0) + { + _PlaceholderLabel.hidden=YES; + + }else + { + _PlaceholderLabel.hidden= NO; + + } +} + +- (void)awakeFromNib { + + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(DidChange:) name:UITextViewTextDidChangeNotification object:self]; + + float left=5,top=7,hegiht=20; + if (self.placeholderColor == nil) { + self.placeholderColor = [UIColor colorWithRed:199/255.0 green:199/255.0 blue:205/255.0 alpha:1.0f]; + } + _PlaceholderLabel=[[UILabel alloc] initWithFrame:CGRectMake(left, top + , self.frame.size.width, hegiht)]; + _PlaceholderLabel.numberOfLines = 0; + _PlaceholderLabel.font = [UIFont systemFontOfSize:15]; + _PlaceholderLabel.textColor=self.placeholderColor; +// [self addSubview:_PlaceholderLabel]; + [self insertSubview:_PlaceholderLabel atIndex:0]; + _PlaceholderLabel.text=self.placeholder; + self.delegate = self; + +} +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +-(void)setPlaceholder:(NSString *)placeholder{ + if (placeholder.length == 0 || [placeholder isEqualToString:@""]) { + _PlaceholderLabel.hidden=YES; + } + else + { + _PlaceholderLabel.text=placeholder; + _PlaceholderLabel.hidden=NO; + + } + _placeholder=placeholder; +} + + + +-(void)DidChange:(NSNotification*)noti{ + + if (self.placeholder.length == 0 || [self.placeholder isEqualToString:@""]) { + _PlaceholderLabel.hidden=YES; + } + + if (self.text.length > 0) { + _PlaceholderLabel.hidden=YES; + } + else{ + _PlaceholderLabel.hidden=NO; + } + + + + +} + + + -(void)textViewDidChange:(UITextView *)textView + +{ + if (self.inptutBlock) + { + self.inptutBlock(textView.text); + } + + if (self.maxCount >0) { + + if (textView.text.length > self.maxCount) { + + textView.text = [textView.text substringToIndex:_maxCount]; + + NSString * str = [NSString stringWithFormat:@"字符个数不能大于%d",self.maxCount]; + UIAlertView *tipAlert = [[UIAlertView alloc] initWithTitle:@"提示" message:str delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil]; + [tipAlert show]; + } + } + +} + + +//didEndInput + +- (void)textViewDidEndEditing:(UITextView *)textView +{ + if (_didEndInputBlock != nil) { + _didEndInputBlock(textView.text ); + } +} + +-(void)dealloc{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [_PlaceholderLabel removeFromSuperview]; + +} + +@end diff --git "a/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/NSCalendar+ST.h" "b/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/NSCalendar+ST.h" new file mode 100755 index 0000000..eaa2fcd --- /dev/null +++ "b/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/NSCalendar+ST.h" @@ -0,0 +1,70 @@ +// +// NSCalendar+ST.h +// STCalendarDemo +// +// Created by https://github.com/STShenZhaoliang/STCalendar on 15/12/17. +// Copyright © 2015年 ST. All rights reserved. +// + +#import + +@interface NSCalendar (ST) + +/** + * 1.当前的日期数据元件模型 + * + * @return <#return value description#> + */ ++ (NSDateComponents *)currentDateComponents; + +/** + * 2.当前年 + * + * @return <#return value description#> + */ ++ (NSInteger)currentYear; + +/** + * 3.当前月 + * + * @return <#return value description#> + */ ++ (NSInteger)currentMonth; + +/** + * 4.当前天 + */ ++ (NSInteger)currentDay; + +/** + * 5.当前周数 + */ ++ (NSInteger)currnentWeekday; + +/** + * 6.获取指定年月的天数 + */ ++ (NSInteger)getDaysWithYear:(NSInteger)year + month:(NSInteger)month; + +/** + * 7.获取指定年月的第一天的周数 + */ ++ (NSInteger)getFirstWeekdayWithYear:(NSInteger)year + month:(NSInteger)month; +/** + * 8.比较两个日期元件 + */ ++ (NSComparisonResult)compareWithComponentsOne:(NSDateComponents *)componentsOne + componentsTwo:(NSDateComponents *)componentsTwo; + +/** + * 9.获取两个日期元件之间的日期元件 + */ ++ (NSMutableArray *)arrayComponentsWithComponentsOne:(NSDateComponents *)componentsOne + componentsTwo:(NSDateComponents *)componentsTwo; +/** + * 10.字符串转日期元件 字符串格式为:yy-MM-dd + */ ++ (NSDateComponents *)dateComponentsWithString:(NSString *)String; +@end diff --git "a/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/NSCalendar+ST.m" "b/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/NSCalendar+ST.m" new file mode 100755 index 0000000..b0d6010 --- /dev/null +++ "b/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/NSCalendar+ST.m" @@ -0,0 +1,160 @@ +// +// NSCalendar+ST.m +// STCalendarDemo +// +// Created by https://github.com/STShenZhaoliang/STCalendar on 15/12/17. +// Copyright © 2015年 ST. All rights reserved. +// + +#import "NSCalendar+ST.h" + +@implementation NSCalendar (ST) + ++ (NSDateComponents *)currentDateComponents +{ + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; + NSInteger unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitWeekday; + return [calendar components:unitFlags fromDate:[NSDate date]]; +} + ++ (NSInteger)currentMonth +{ + return [NSCalendar currentDateComponents].month; +} + ++ (NSInteger)currentYear +{ + return [NSCalendar currentDateComponents].year; +} + ++ (NSInteger)currentDay +{ + return [NSCalendar currentDateComponents].day; +} + ++ (NSInteger)currnentWeekday +{ + return [NSCalendar currentDateComponents].weekday; +} + ++ (NSInteger)getDaysWithYear:(NSInteger)year + month:(NSInteger)month +{ + switch (month) { + case 1: + return 31; + break; + case 2: + if (year%400==0 || (year%100!=0 && year%4 == 0)) { + return 29; + }else{ + return 28; + } + break; + case 3: + return 31; + break; + case 4: + return 30; + break; + case 5: + return 31; + break; + case 6: + return 30; + break; + case 7: + return 31; + break; + case 8: + return 31; + break; + case 9: + return 30; + break; + case 10: + return 31; + break; + case 11: + return 30; + break; + case 12: + return 31; + break; + default: + return 0; + break; + } +} + ++ (NSInteger)getFirstWeekdayWithYear:(NSInteger)year + month:(NSInteger)month +{ + NSString *stringDate = [NSString stringWithFormat:@"%ld-%ld-01", (long)year, (long)month]; + NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; + [formatter setDateFormat:@"yy-MM-dd"]; + NSDate *date = [formatter dateFromString:stringDate]; + + NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; + NSDateComponents *components = [gregorian components:(NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear | NSCalendarUnitWeekday) fromDate:date]; + return [components weekday]; +} + ++ (NSComparisonResult)compareWithComponentsOne:(NSDateComponents *)componentsOne + componentsTwo:(NSDateComponents *)componentsTwo +{ + if (componentsOne.year == componentsTwo.year && + componentsOne.month == componentsTwo.month && + componentsOne.day == componentsTwo.day) { + return NSOrderedSame; + }else if (componentsOne.year < componentsTwo.year || + (componentsOne.year == componentsTwo.year && componentsOne.month < componentsTwo.month) || + (componentsOne.year == componentsTwo.year && componentsOne.month == componentsTwo.month && componentsOne.day < componentsTwo.day)) { + return NSOrderedAscending; + }else { + return NSOrderedDescending; + } +} + ++ (NSMutableArray *)arrayComponentsWithComponentsOne:(NSDateComponents *)componentsOne + componentsTwo:(NSDateComponents *)componentsTwo +{ + NSMutableArray *arrayComponents = [NSMutableArray array]; + + NSString *stringOne = [NSString stringWithFormat:@"%d-%d-%d", componentsOne.year, + componentsOne.month, + componentsOne.day]; + NSString *stringTwo = [NSString stringWithFormat:@"%d-%d-%d", componentsTwo.year, + componentsTwo.month, + componentsTwo.day]; + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; + [dateFormatter setDateFormat:@"yy-MM-dd"]; + + NSDate *dateFromString = [dateFormatter dateFromString:stringOne]; + NSDate *dateToString = [dateFormatter dateFromString:stringTwo]; + int timediff = [dateToString timeIntervalSince1970]-[dateFromString timeIntervalSince1970]; + + NSTimeInterval timeInterval = [dateFromString timeIntervalSinceDate:dateFromString]; + + for (int i = 0; i <= timediff; i+=86400) { + timeInterval = i; + NSDate *date = [dateFromString dateByAddingTimeInterval:timeInterval]; + + NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; + NSInteger unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitWeekday; + [arrayComponents addObject:[calendar components:unitFlags fromDate:date]]; + } + return arrayComponents; +} + ++ (NSDateComponents *)dateComponentsWithString:(NSString *)String +{ + NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; + [formatter setDateFormat:@"yy-MM-dd"]; + NSDate *date = [formatter dateFromString:String]; + + NSCalendar *calendar = [NSCalendar currentCalendar]; + NSInteger unitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay | NSCalendarUnitWeekday; + return [calendar components:unitFlags fromDate:date]; +} +@end diff --git "a/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/STPickerDate.h" "b/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/STPickerDate.h" new file mode 100755 index 0000000..95891a4 --- /dev/null +++ "b/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/STPickerDate.h" @@ -0,0 +1,28 @@ +// +// STPickerDate.h +// STPickerView +// +// Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/16. +// Copyright © 2016年 shentian. All rights reserved. +// + +#import "STPickerView.h" +NS_ASSUME_NONNULL_BEGIN +@class STPickerDate; +@protocol STPickerDateDelegate +- (void)pickerDate:(STPickerDate *)pickerDate year:(NSInteger)year month:(NSInteger)month day:(NSInteger)day; + +@end +@interface STPickerDate : STPickerView + +/** 1.最小的年份,default is 1900 */ +@property (nonatomic, assign)NSInteger yearLeast; +/** 2.显示年份数量,default is 200 */ +@property (nonatomic, assign)NSInteger yearSum; +/** 3.中间选择框的高度,default is 28*/ +@property (nonatomic, assign)CGFloat heightPickerComponent; + +@property(nonatomic, weak)id delegate ; + +@end +NS_ASSUME_NONNULL_END diff --git "a/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/STPickerDate.m" "b/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/STPickerDate.m" new file mode 100755 index 0000000..bf00431 --- /dev/null +++ "b/LJHY_User/Utils/STPickerView/Date(\346\227\245\346\234\237)/STPickerDate.m" @@ -0,0 +1,141 @@ +// +// STPickerDate.m +// STPickerView +// +// Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/16. +// Copyright © 2016年 shentian. All rights reserved. +// + +#import "STPickerDate.h" +#import "NSCalendar+ST.h" +@interface STPickerDate() +/** 1.年 */ +@property (nonatomic, assign)NSInteger year; +/** 2.月 */ +@property (nonatomic, assign)NSInteger month; +/** 3.日 */ +@property (nonatomic, assign)NSInteger day; + +@end + +@implementation STPickerDate + +#pragma mark - --- init 视图初始化 --- + +- (void)setupUI { + + self.title = @"请选择日期"; + + _yearLeast = 1900; + _yearSum = 200; + _heightPickerComponent = 28; + + _year = [NSCalendar currentYear]; + _month = [NSCalendar currentMonth]; + _day = [NSCalendar currentDay]; + + [self.pickerView setDelegate:self]; + [self.pickerView setDataSource:self]; + + [self.pickerView selectRow:(_year - _yearLeast) inComponent:0 animated:NO]; + [self.pickerView selectRow:(_month - 1) inComponent:1 animated:NO]; + [self.pickerView selectRow:(_day - 1) inComponent:2 animated:NO]; + +} + +#pragma mark - --- delegate 视图委托 --- + +- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView +{ + return 3; +} + +- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component +{ + if (component == 0) { + return self.yearSum; + }else if(component == 1) { + return 12; + }else { + NSInteger yearSelected = [pickerView selectedRowInComponent:0] + self.yearLeast; + NSInteger monthSelected = [pickerView selectedRowInComponent:1] + 1; + return [NSCalendar getDaysWithYear:yearSelected month:monthSelected]; + } +} + +- (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component +{ + return self.heightPickerComponent; +} + +- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component +{ + switch (component) { + case 0: + [pickerView reloadComponent:1]; + [pickerView reloadComponent:2]; + break; + case 1: + [pickerView reloadComponent:2]; + default: + break; + } + + [self reloadData]; +} + +- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(nullable UIView *)view +{ + + NSString *text; + if (component == 0) { + text = [NSString stringWithFormat:@"%d", row + 1900]; + }else if (component == 1){ + text = [NSString stringWithFormat:@"%d", row + 1]; + }else{ + text = [NSString stringWithFormat:@"%d", row + 1]; + } + + UILabel *label = [[UILabel alloc]init]; + [label setTextAlignment:NSTextAlignmentCenter]; + [label setFont:[UIFont systemFontOfSize:17]]; + [label setText:text]; + return label; +} +#pragma mark - --- event response 事件相应 --- + +- (void)selectedOk +{ + if ([self.delegate respondsToSelector:@selector(pickerDate:year:month:day:)]) { + [self.delegate pickerDate:self year:self.year month:self.month day:self.day]; + } + + [super selectedOk]; +} + +#pragma mark - --- private methods 私有方法 --- + +- (void)reloadData +{ + self.year = [self.pickerView selectedRowInComponent:0] + self.yearLeast; + self.month = [self.pickerView selectedRowInComponent:1] + 1; + self.day = [self.pickerView selectedRowInComponent:2] + 1; +} + +#pragma mark - --- setters 属性 --- + +- (void)setYearLeast:(NSInteger)yearLeast +{ + _yearLeast = yearLeast; +} + +- (void)setYearSum:(NSInteger)yearSum +{ + _yearSum = yearSum; +} +#pragma mark - --- getters 属性 --- + + +@end + + diff --git a/LJHY_User/Utils/STPickerView/STConfig/STConfig.h b/LJHY_User/Utils/STPickerView/STConfig/STConfig.h new file mode 100755 index 0000000..9175d31 --- /dev/null +++ b/LJHY_User/Utils/STPickerView/STConfig/STConfig.h @@ -0,0 +1,16 @@ +// +// STConfig.h +// STPhotoBrowser +// +// Created by https://github.com/STShenZhaoliang/STPhotoBrowser.git on 16/1/15. +// Copyright © 2016年 ST. All rights reserved. +// + +#ifndef STConfig_h +#define STConfig_h + +#import "STConst.h" +#import "STUI.h" +//#import "UIView+ST.h" + +#endif /* STConfig_h */ diff --git a/LJHY_User/Utils/STPickerView/STConfig/STConst.h b/LJHY_User/Utils/STPickerView/STConfig/STConst.h new file mode 100755 index 0000000..10077e3 --- /dev/null +++ b/LJHY_User/Utils/STPickerView/STConfig/STConst.h @@ -0,0 +1,29 @@ +// +// STConst.h +// STPhotoBrowser +// +// Created by https://github.com/STShenZhaoliang/STPhotoBrowser.git on 16/1/15. +// Copyright © 2016年 ST. All rights reserved. +// + + +/** + * 1.屏幕尺寸 + */ +#define ScreenWidth CGRectGetWidth([UIScreen mainScreen].bounds) +#define ScreenHeight CGRectGetHeight([UIScreen mainScreen].bounds) + +/** + * 2.返回一个RGBA格式的UIColor对象 + */ +#define RGBA(r, g, b, a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a] + +/** + * 3.返回一个RGB格式的UIColor对象 + */ +#define RGB(r, g, b) RGBA(r, g, b, 1.0f) + +/** + * 4.弱引用 + */ +#define STWeakSelf __weak typeof(self) weakSelf = self; \ No newline at end of file diff --git a/LJHY_User/Utils/STPickerView/STConfig/STConst.m b/LJHY_User/Utils/STPickerView/STConfig/STConst.m new file mode 100755 index 0000000..4355b44 --- /dev/null +++ b/LJHY_User/Utils/STPickerView/STConfig/STConst.m @@ -0,0 +1,9 @@ +// +// STConst.m +// STPhotoBrowser +// +// Created by https://github.com/STShenZhaoliang/STPhotoBrowser.git on 16/1/15. +// Copyright © 2016年 ST. All rights reserved. +// + + diff --git a/LJHY_User/Utils/STPickerView/STConfig/STUI.h b/LJHY_User/Utils/STPickerView/STConfig/STUI.h new file mode 100755 index 0000000..83f7988 --- /dev/null +++ b/LJHY_User/Utils/STPickerView/STConfig/STUI.h @@ -0,0 +1,27 @@ +// +// STUI.h +// Copyright © 2016年 ST. All rights reserved. +// + +#import +#import + +/** 1.统一的较小间距 5 */ +UIKIT_EXTERN CGFloat const STMarginSmall; + +/** 2.统一的间距 10 */ +UIKIT_EXTERN CGFloat const STMargin; + +/** 3.统一的较大间距 16 */ +UIKIT_EXTERN CGFloat const STMarginBig; + +/** 4.导航栏的最大的Y值 64 */ +UIKIT_EXTERN CGFloat const STNavigationBarY; + +/** 5.控件的系统高度 44 */ +UIKIT_EXTERN CGFloat const STControlSystemHeight; + +/** 6.控件的普通高度 36 */ +UIKIT_EXTERN CGFloat const STControlNormalHeight; + + diff --git a/LJHY_User/Utils/STPickerView/STConfig/STUI.m b/LJHY_User/Utils/STPickerView/STConfig/STUI.m new file mode 100755 index 0000000..8fcfae5 --- /dev/null +++ b/LJHY_User/Utils/STPickerView/STConfig/STUI.m @@ -0,0 +1,25 @@ +// +// STUI.m +// Copyright © 2016年 ST. All rights reserved. +// + +#import "STUI.h" + +/** 1.统一的较小间距 5*/ +CGFloat const STMarginSmall = 5; + +/** 2.统一的间距 10*/ +CGFloat const STMargin = 10; + +/** 3.统一的较大间距 16*/ +CGFloat const STMarginBig = 16; + +/** 4.导航栏的最大的Y值 64*/ +CGFloat const STNavigationBarY = 64; + +/** 5.控件的系统高度 44*/ +CGFloat const STControlSystemHeight = 44; + +/** 6.控件的普通高度 36*/ +CGFloat const STControlNormalHeight = 36; + diff --git a/LJHY_User/Utils/STPickerView/STConfig/UIView+ST.h b/LJHY_User/Utils/STPickerView/STConfig/UIView+ST.h new file mode 100755 index 0000000..e498ff1 --- /dev/null +++ b/LJHY_User/Utils/STPickerView/STConfig/UIView+ST.h @@ -0,0 +1,86 @@ +// +// UIView+ST.h +// Copyright © 2016年 ST. All rights reserved. +// + +#import + +@interface UIView (ST) +/** + * 1.间隔X值 + */ +@property (nonatomic, assign) CGFloat x; + +/** + * 2.间隔Y值 + */ +@property (nonatomic, assign) CGFloat y; + +/** + * 3.宽度 + */ +@property (nonatomic, assign) CGFloat width; + +/** + * 4.高度 + */ +@property (nonatomic, assign) CGFloat height; + +/** + * 5.中心点X值 + */ +@property (nonatomic, assign) CGFloat centerX; + +/** + * 6.中心点Y值 + */ +@property (nonatomic, assign) CGFloat centerY; + +/** + * 7.尺寸大小 + */ +@property (nonatomic, assign) CGSize size; + +/** + * 8.起始点 + */ +@property (nonatomic, assign) CGPoint origin; + +/** + * 9.上 < Shortcut for frame.origin.y + */ +@property (nonatomic) CGFloat top; + +/** + * 10.下 < Shortcut for frame.origin.y + frame.size.height + */ +@property (nonatomic) CGFloat bottom; + +/** + * 11.左 < Shortcut for frame.origin.x. + */ +@property (nonatomic) CGFloat left; + +/** + * 12.右 < Shortcut for frame.origin.x + frame.size.width + */ +@property (nonatomic) CGFloat right; + + +/** + * 1.添加边框 + * + * @param color <#color description#> + */ +- (void)addBorderColor:(UIColor *)color; + +/** + * 2.UIView 的点击事件 + * + * @param target 目标 + * @param action 事件 + */ + +- (void)addTarget:(id)target + action:(SEL)action; +@end diff --git a/LJHY_User/Utils/STPickerView/STConfig/UIView+ST.m b/LJHY_User/Utils/STPickerView/STConfig/UIView+ST.m new file mode 100755 index 0000000..3ce4150 --- /dev/null +++ b/LJHY_User/Utils/STPickerView/STConfig/UIView+ST.m @@ -0,0 +1,210 @@ +// +// UIView+ST.m +// Copyright © 2016年 ST. All rights reserved. +// + +#import "UIView+ST.h" + +@implementation UIView (ST) + +- (void)setX:(CGFloat)x +{ + CGRect frame = self.frame; + frame.origin.x = x; + self.frame = frame; +} + +- (void)setY:(CGFloat)y +{ + CGRect frame = self.frame; + frame.origin.y = y; + self.frame = frame; +} + +- (CGFloat)x +{ + return self.frame.origin.x; +} + +- (CGFloat)y +{ + return self.frame.origin.y; +} + +- (void)setWidth:(CGFloat)width +{ + CGRect frame = self.frame; + frame.size.width = width; + self.frame = frame; +} + +- (void)setHeight:(CGFloat)height +{ + CGRect frame = self.frame; + frame.size.height = height; + self.frame = frame; +} + +- (CGFloat)height +{ + return self.frame.size.height; +} + +- (CGFloat)width +{ + return self.frame.size.width; +} + +- (UIView * (^)(CGFloat x))setX +{ + return ^(CGFloat x) { + self.x = x; + return self; + }; +} + +- (void)setCenterX:(CGFloat)centerX +{ + CGPoint center = self.center; + center.x = centerX; + self.center = center; +} + +- (CGFloat)centerX +{ + return self.center.x; +} + +- (void)setCenterY:(CGFloat)centerY +{ + CGPoint center = self.center; + center.y = centerY; + self.center = center; +} + +- (CGFloat)centerY +{ + return self.center.y; +} + +- (void)setSize:(CGSize)size +{ + CGRect frame = self.frame; + frame.size = size; + self.frame = frame; +} + +- (CGSize)size +{ + return self.frame.size; +} + +- (void)setOrigin:(CGPoint)origin +{ + CGRect frame = self.frame; + frame.origin = origin; + self.frame = frame; +} + +- (CGPoint)origin +{ + return self.frame.origin; +} + +- (CGFloat)left { + return self.frame.origin.x; +} + +- (void)setLeft:(CGFloat)x { + CGRect frame = self.frame; + frame.origin.x = x; + self.frame = frame; +} + +- (CGFloat)top { + return self.frame.origin.y; +} + +- (void)setTop:(CGFloat)y { + CGRect frame = self.frame; + frame.origin.y = y; + self.frame = frame; +} + +- (CGFloat)right { + return self.frame.origin.x + self.frame.size.width; +} + +- (void)setRight:(CGFloat)right { + CGRect frame = self.frame; + frame.origin.x = right - frame.size.width; + self.frame = frame; +} + +- (CGFloat)bottom { + return self.frame.origin.y + self.frame.size.height; +} + +- (void)setBottom:(CGFloat)bottom { + CGRect frame = self.frame; + frame.origin.y = bottom - frame.size.height; + self.frame = frame; +} + + +- (UIView *(^)(UIColor *color)) setColor +{ + return ^ (UIColor *color) { + self.backgroundColor = color; + return self; + }; +} + +- (UIView *(^)(CGRect frame)) setFrame +{ + return ^ (CGRect frame) { + self.frame = frame; + return self; + }; +} + +- (UIView *(^)(CGSize size)) setSize +{ + return ^ (CGSize size) { + self.bounds = CGRectMake(0, 0, size.width, size.height); + return self; + }; +} + +- (UIView *(^)(CGPoint point)) setCenter +{ + return ^ (CGPoint point) { + self.center = point; + return self; + }; +} + +- (UIView *(^)(NSInteger tag)) setTag +{ + return ^ (NSInteger tag) { + self.tag = tag; + return self; + }; +} + +- (void)addTarget:(id)target + action:(SEL)action; +{ + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:target + action:action]; + self.userInteractionEnabled = YES; + [self addGestureRecognizer:tap]; +} + +- (void)addBorderColor:(UIColor *)color{ + [self.layer setBorderColor:color.CGColor]; + [self.layer setBorderWidth:0.5]; + [self.layer setCornerRadius:4]; +} + +@end diff --git a/LJHY_User/Utils/STPickerView/STPickerView.h b/LJHY_User/Utils/STPickerView/STPickerView.h new file mode 100755 index 0000000..12e002b --- /dev/null +++ b/LJHY_User/Utils/STPickerView/STPickerView.h @@ -0,0 +1,71 @@ +// +// STPickerView.h +// STPickerView +// +// Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/17. +// Copyright © 2016年 shentian. All rights reserved. +// + +#import +#import "STConfig.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSInteger, STPickerContentMode) { + STPickerContentModeBottom, // 1.选择器在视图的下方 + STPickerContentModeCenter // 2.选择器在视图的中间 +}; + +@interface STPickerView : UIButton + +/** 1.内部视图 */ +@property (nonatomic, strong) UIView *contentView; +/** 2.边线,选择器和上方tool之间的边线 */ +@property (nonatomic, strong)UIView *lineView; +/** 3.选择器 */ +@property (nonatomic, strong)UIPickerView *pickerView; +/** 4.左边的按钮 */ +@property (nonatomic, strong)UIButton *buttonLeft; +/** 5.右边的按钮 */ +@property (nonatomic, strong)UIButton *buttonRight; +/** 6.标题label */ +@property (nonatomic, strong)UILabel *labelTitle; +/** 7.下边线,在显示模式是STPickerContentModeCenter的时候显示 */ +@property (nonatomic, strong)UIView *lineViewDown; + +/** 1.标题,default is nil */ +@property(nullable, nonatomic,copy) NSString *title; +/** 2.字体,default is nil (system font 17 plain) */ +@property(null_resettable, nonatomic,strong) UIFont *font; +/** 3.字体颜色,default is nil (text draws black) */ +@property(null_resettable, nonatomic,strong) UIColor *titleColor; +/** 4.按钮边框颜色颜色,default is RGB(205, 205, 205) */ +@property(null_resettable, nonatomic,strong) UIColor *borderButtonColor; +/** 5.选择器的高度,default is 240 */ +@property (nonatomic, assign)CGFloat heightPicker; +/** 6.视图的显示模式 */ +@property (nonatomic, assign)STPickerContentMode contentMode; + + +/** + * 5.创建视图,初始化视图时初始数据 + */ +- (void)setupUI; + +/** + * 6.确认按钮的点击事件 + */ +- (void)selectedOk; + +/** + * 7.显示 + */ +- (void)show; + +/** + * 8.移除 + */ +- (void)remove; + +@end +NS_ASSUME_NONNULL_END diff --git a/LJHY_User/Utils/STPickerView/STPickerView.m b/LJHY_User/Utils/STPickerView/STPickerView.m new file mode 100755 index 0000000..a71acad --- /dev/null +++ b/LJHY_User/Utils/STPickerView/STPickerView.m @@ -0,0 +1,277 @@ +// +// STPickerView.m +// STPickerView +// +// Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/17. +// Copyright © 2016年 shentian. All rights reserved. +// + +#import "STPickerView.h" +#import "UIView+ST.h" + +@implementation STPickerView + +#pragma mark - --- init 视图初始化 --- +- (instancetype)init +{ + self = [super init]; + if (self) { + [self setupDefault]; + [self setupUI]; + } + return self; +} + +- (void)setupDefault +{ + // 1.设置数据的默认值 + _title = nil; + _font = [UIFont systemFontOfSize:15]; + _titleColor = [UIColor blackColor]; + _borderButtonColor = RGB(205, 205, 205); + _heightPicker = 240; + _contentMode = STPickerContentModeBottom; + + // 2.设置自身的属性 + self.bounds = [UIScreen mainScreen].bounds; + self.backgroundColor = RGBA(0, 0, 0, 102.0/255); + self.layer.opacity = 0.0; + [self addTarget:self action:@selector(remove) forControlEvents:UIControlEventTouchUpInside]; + + // 3.添加子视图 + [self addSubview:self.contentView]; + [self.contentView addSubview:self.lineView]; + [self.contentView addSubview:self.pickerView]; + [self.contentView addSubview:self.buttonLeft]; + [self.contentView addSubview:self.buttonRight]; + [self.contentView addSubview:self.labelTitle]; + [self.contentView addSubview:self.lineViewDown]; +} + +- (void)setupUI +{} + +- (void)layoutSubviews +{ + [super layoutSubviews]; + + if (self.contentMode == STPickerContentModeBottom) { + }else { + self.buttonLeft.y = self.lineViewDown.bottom + STMarginSmall; + self.buttonRight.y = self.lineViewDown.bottom + STMarginSmall; + } +} + +#pragma mark - --- delegate 视图委托 --- + +#pragma mark - --- event response 事件相应 --- + +- (void)selectedOk +{ + [self remove]; +} + +- (void)selectedCancel +{ + [self remove]; +} + +#pragma mark - --- private methods 私有方法 --- + + +- (void)show +{ + [[UIApplication sharedApplication].keyWindow addSubview:self]; + [self setCenter:[UIApplication sharedApplication].keyWindow.center]; + [[UIApplication sharedApplication].keyWindow bringSubviewToFront:self]; + + if (self.contentMode == STPickerContentModeBottom) { + CGRect frameContent = self.contentView.frame; + frameContent.origin.y -= self.contentView.height; + [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ + [self.layer setOpacity:1.0]; + self.contentView.frame = frameContent; + } completion:^(BOOL finished) { + }]; + }else { + CGRect frameContent = self.contentView.frame; + frameContent.origin.y -= (ScreenHeight+self.contentView.height)/2; + [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ + [self.layer setOpacity:1.0]; + self.contentView.frame = frameContent; + } completion:^(BOOL finished) { + }]; + } +} + +- (void)remove +{ + if (self.contentMode == STPickerContentModeBottom) { + CGRect frameContent = self.contentView.frame; + frameContent.origin.y += self.contentView.height; + [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ + [self.layer setOpacity:0.0]; + self.contentView.frame = frameContent; + } completion:^(BOOL finished) { + [self removeFromSuperview]; + }]; + }else { + CGRect frameContent = self.contentView.frame; + frameContent.origin.y += (ScreenHeight+self.contentView.height)/2; + [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ + [self.layer setOpacity:0.0]; + self.contentView.frame = frameContent; + } completion:^(BOOL finished) { + [self removeFromSuperview]; + }]; + } +} + +#pragma mark - --- setters 属性 --- + +- (void)setTitle:(NSString *)title +{ + _title = title; + [self.labelTitle setText:title]; +} + +- (void)setFont:(UIFont *)font +{ + _font = font; + [self.buttonLeft.titleLabel setFont:font]; + [self.buttonRight.titleLabel setFont:font]; + [self.labelTitle setFont:font]; +} + +- (void)setTitleColor:(UIColor *)titleColor +{ + _titleColor = titleColor; + [self.labelTitle setTextColor:titleColor]; + [self.buttonLeft setTitleColor:titleColor forState:UIControlStateNormal]; + [self.buttonRight setTitleColor:titleColor forState:UIControlStateNormal]; +} + +- (void)setBorderButtonColor:(UIColor *)borderButtonColor +{ + _borderButtonColor = borderButtonColor; + [self.buttonLeft addBorderColor:borderButtonColor]; + [self.buttonRight addBorderColor:borderButtonColor]; +} + +- (void)setHeightPicker:(CGFloat)heightPicker +{ + _heightPicker = heightPicker; + self.contentView.height = heightPicker; +} + +- (void)setContentMode:(STPickerContentMode)contentMode +{ + _contentMode = contentMode; + if (contentMode == STPickerContentModeCenter) { + self.contentView.height += STControlSystemHeight; + } +} +#pragma mark - --- getters 属性 --- +- (UIView *)contentView +{ + if (!_contentView) { + CGFloat contentX = 0; + CGFloat contentY = ScreenHeight; + CGFloat contentW = ScreenWidth; + CGFloat contentH = self.heightPicker; + _contentView = [[UIView alloc]initWithFrame:CGRectMake(contentX, contentY, contentW, contentH)]; + [_contentView setBackgroundColor:[UIColor whiteColor]]; + } + return _contentView; +} + +- (UIView *)lineView +{ + if (!_lineView) { + CGFloat lineX = 0; + CGFloat lineY = STControlSystemHeight; + CGFloat lineW = self.contentView.width; + CGFloat lineH = 0.5; + _lineView = [[UIView alloc]initWithFrame:CGRectMake(lineX, lineY, lineW, lineH)]; + [_lineView setBackgroundColor:self.borderButtonColor]; + } + return _lineView; +} + +- (UIPickerView *)pickerView +{ + if (!_pickerView) { + CGFloat pickerW = self.contentView.width; + CGFloat pickerH = self.contentView.height - self.lineView.bottom; + CGFloat pickerX = 0; + CGFloat pickerY = self.lineView.bottom; + _pickerView = [[UIPickerView alloc]initWithFrame:CGRectMake(pickerX, pickerY, pickerW, pickerH)]; + [_pickerView setBackgroundColor:[UIColor whiteColor]]; + } + return _pickerView; +} + +- (UIButton *)buttonLeft +{ + if (!_buttonLeft) { + CGFloat leftW = STControlSystemHeight; + CGFloat leftH = self.lineView.top - STMargin; + CGFloat leftX = STMarginBig; + CGFloat leftY = (self.lineView.top - leftH) / 2; + _buttonLeft = [[UIButton alloc]initWithFrame:CGRectMake(leftX, leftY, leftW, leftH)]; + [_buttonLeft setTitle:@"取消" forState:UIControlStateNormal]; + [_buttonLeft setTitleColor:self.titleColor forState:UIControlStateNormal]; +// [_buttonLeft addBorderColor:self.borderButtonColor]; + [_buttonLeft.titleLabel setFont:self.font]; + [_buttonLeft addTarget:self action:@selector(selectedCancel) forControlEvents:UIControlEventTouchUpInside]; + } + return _buttonLeft; +} + +- (UIButton *)buttonRight +{ + if (!_buttonRight) { + CGFloat rightW = self.buttonLeft.width; + CGFloat rightH = self.buttonLeft.height; + CGFloat rightX = self.contentView.width - rightW - self.buttonLeft.x; + CGFloat rightY = self.buttonLeft.y; + _buttonRight = [[UIButton alloc]initWithFrame:CGRectMake(rightX, rightY, rightW, rightH)]; + [_buttonRight setTitle:@"确定" forState:UIControlStateNormal]; + [_buttonRight setTitleColor:self.titleColor forState:UIControlStateNormal]; +// [_buttonRight addBorderColor:self.borderButtonColor]; + [_buttonRight.titleLabel setFont:self.font]; + [_buttonRight addTarget:self action:@selector(selectedOk) forControlEvents:UIControlEventTouchUpInside]; + } + return _buttonRight; +} + +- (UILabel *)labelTitle +{ + if (!_labelTitle) { + CGFloat titleX = self.buttonLeft.right + STMarginSmall; + CGFloat titleY = 0; + CGFloat titleW = self.contentView.width - titleX * 2; + CGFloat titleH = self.lineView.top; + _labelTitle = [[UILabel alloc]initWithFrame:CGRectMake(titleX, titleY, titleW, titleH)]; + [_labelTitle setTextAlignment:NSTextAlignmentCenter]; + [_labelTitle setTextColor:self.titleColor]; + [_labelTitle setFont:self.font]; + _labelTitle.adjustsFontSizeToFitWidth = YES; + } + return _labelTitle; +} + +- (UIView *)lineViewDown +{ + if (!_lineViewDown) { + CGFloat lineX = 0; + CGFloat lineY = self.pickerView.bottom; + CGFloat lineW = self.contentView.width; + CGFloat lineH = 0.5; + _lineViewDown = [[UIView alloc]initWithFrame:CGRectMake(lineX, lineY, lineW, lineH)]; + [_lineViewDown setBackgroundColor:self.borderButtonColor]; + } + return _lineViewDown; +} +@end + diff --git "a/LJHY_User/Utils/STPickerView/Single(\345\215\225\346\225\260\347\273\204)/STPickerSingle.h" "b/LJHY_User/Utils/STPickerView/Single(\345\215\225\346\225\260\347\273\204)/STPickerSingle.h" new file mode 100755 index 0000000..d0c56f2 --- /dev/null +++ "b/LJHY_User/Utils/STPickerView/Single(\345\215\225\346\225\260\347\273\204)/STPickerSingle.h" @@ -0,0 +1,31 @@ +// +// STPickerSingle.h +// STPickerView +// +// Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/16. +// Copyright © 2016年 shentian. All rights reserved. +// + +#import "STPickerView.h" +NS_ASSUME_NONNULL_BEGIN +@class STPickerSingle; +@protocol STPickerSingleDelegate +- (void)pickerSingle:(STPickerSingle *)pickerSingle selectedTitle:(NSString *)selectedTitle; +@end + +@interface STPickerSingle : STPickerView + +/** 1.设置字符串数据数组 */ +@property (nonatomic, strong)NSMutableArray *arrayData; +/** 2.设置单位标题 */ +@property (nonatomic, strong)NSString *titleUnit; +/** 3.中间选择框的高度,default is 44*/ +@property (nonatomic, assign)CGFloat heightPickerComponent; +/** 4.中间选择框的宽度,default is 32*/ +@property (nonatomic, assign)CGFloat widthPickerComponent; +@property(nonatomic, weak)id delegate; + +/** 4.中间label宽度,default is 32*/ +@property (nonatomic, assign)CGFloat labelWidthPickerComponent; +@end +NS_ASSUME_NONNULL_END diff --git "a/LJHY_User/Utils/STPickerView/Single(\345\215\225\346\225\260\347\273\204)/STPickerSingle.m" "b/LJHY_User/Utils/STPickerView/Single(\345\215\225\346\225\260\347\273\204)/STPickerSingle.m" new file mode 100755 index 0000000..c9addf2 --- /dev/null +++ "b/LJHY_User/Utils/STPickerView/Single(\345\215\225\346\225\260\347\273\204)/STPickerSingle.m" @@ -0,0 +1,122 @@ +// +// STPickerSingle.m +// STPickerView +// +// Created by https://github.com/STShenZhaoliang/STPickerView on 16/2/16. +// Copyright © 2016年 shentian. All rights reserved. +// + +#import "STPickerSingle.h" +//#import "UIView+ST.h" + +@interface STPickerSingle() +/** 1.选中的字符串 */ +@property (nonatomic, strong, nullable)NSString *selectedTitle; + +@end + +@implementation STPickerSingle + +#pragma mark - --- init 视图初始化 --- +- (void)setupUI +{ + [super setupUI]; + + _titleUnit = @""; + _arrayData = @[].mutableCopy; + _heightPickerComponent = 44; + _labelWidthPickerComponent = ScreenWidth; + _widthPickerComponent = 32; + + [self.pickerView setDelegate:self]; + [self.pickerView setDataSource:self]; +} + +#pragma mark - --- delegate 视图委托 --- + +- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView +{ + return 3; +} + +- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component +{ + if (component == 0) { + return 1; + }else if (component == 1){ + return self.arrayData.count; + }else { + return 1; + } +} + +- (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component +{ + return self.heightPickerComponent; +} + +- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component +{ + + if (component == 0) { + return (self.frame.size.width-self.widthPickerComponent)/2; + }else if (component == 1){ + return self.widthPickerComponent; + }else { + return (self.frame.size.width-self.widthPickerComponent)/2; + } +} + +- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component +{ + self.selectedTitle = self.arrayData[row]; +} + +- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(nullable UIView *)view +{ + + if (component == 0) { + return nil; + }else if (component == 1){ + UILabel *label = [[UILabel alloc]init]; + label.width = _labelWidthPickerComponent; + [label setText:self.arrayData[row]]; + [label sizeToFit]; + [label setTextAlignment:NSTextAlignmentCenter]; + return label; + }else { + UILabel *label = [[UILabel alloc]init]; + [label setText:self.titleUnit]; + [label setTextAlignment:NSTextAlignmentLeft]; + [label sizeToFit]; + return label; + } +} +#pragma mark - --- event response 事件相应 --- + +- (void)selectedOk +{ + [self.delegate pickerSingle:self selectedTitle:self.selectedTitle]; + [super selectedOk]; +} + +#pragma mark - --- private methods 私有方法 --- + +#pragma mark - --- setters 属性 --- + +- (void)setArrayData:(NSMutableArray *)arrayData +{ + _arrayData = arrayData; + _selectedTitle = arrayData.firstObject; + [self.pickerView reloadAllComponents]; +} + +- (void)setTitleUnit:(NSString *)titleUnit +{ + _titleUnit = titleUnit; + [self.pickerView reloadAllComponents]; +} + +#pragma mark - --- getters 属性 --- +@end + diff --git "a/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/KZPortaitView.h" "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/KZPortaitView.h" new file mode 100755 index 0000000..bf9cefb --- /dev/null +++ "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/KZPortaitView.h" @@ -0,0 +1,55 @@ +// +// VPViewController.h +// VPImageCropperDemo +// +// Created by Vinson.D.Warm on 1/13/14. +// Copyright (c) 2014 Vinson.D.Warm. All rights reserved. +// + +#import + +typedef void (^myblock2)(UIImage * image); + +@protocol KZPortaitViewDelegate + +- (void)uploadPict:(UIImage *)image; + +@end + +@interface KZPortaitView : UIView + + +//头像图片View +@property (nonatomic, strong) UIImageView *portraitImageView; + +@property (nonatomic,assign)BOOL isCrop; +@property (nonatomic,assign)float portraintX; +@property (nonatomic,assign)float portraintY; +@property (nonatomic,strong)UITapGestureRecognizer * tapGesture; + +@property (nonatomic,assign)UIViewController * controller; + + +/**1 + * * 创建返回一个可以选择图片的iamgeView + * + * @param width 宽度 + * @param X x值 + * @param Y y值 + * @param borderW 外圆宽度,一般为2.0f + * @param borderColor 外圆颜色,默认白色 + * @param round 是否切成原型 + * @param controller 当前控制器(遵守KZPortaitViewDelegate即可) + */ ++ (KZPortaitView *)addPortaitImageViewWidth:(CGFloat)imageW portraitX:(CGFloat)X portraitY:(CGFloat)Y borderWidth:(CGFloat)borderW circleColor:(UIColor *)borderColor isRound:(BOOL)round andViewController:(UIViewController *)controller; + + +/** + * 当取到图片就执行的操作,可以在此上传 + */ +@property (nonatomic,copy)myblock2 uploadPictBlock; + +@property (nonatomic,assign)id portaitDelegate; + + +@end diff --git "a/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/KZPortaitView.m" "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/KZPortaitView.m" new file mode 100755 index 0000000..6fe153c --- /dev/null +++ "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/KZPortaitView.m" @@ -0,0 +1,335 @@ +// +// VPViewController.m +// VPImageCropperDemo +// +// Created by Vinson.D.Warm on 1/13/14. +// Copyright (c) 2014 Vinson.D.Warm. All rights reserved. +// + +#import "KZPortaitView.h" +#import "VPImageCropperViewController.h" +#import +#import +#import "UIImageView+KJ.h" +#import "AppCurrentControllerTool.h" + +#define ORIGINAL_MAX_WIDTH 640.0f + +@interface KZPortaitView () + +@property (nonatomic,strong)UIImage * origalImage; + +@end + +@implementation KZPortaitView + + + +- (void)awakeFromNib +{ + [super awakeFromNib]; + + self.backgroundColor = [UIColor clearColor]; + self.userInteractionEnabled = YES; + + [self addImageView]; +} + + +- (void)addImageView{ + + UIImageView * imageView = [[UIImageView alloc]initImageViewWidth:self.bounds.size.width X:self.portraintX Y:self.portraintY circleColor:[UIColor clearColor] borderWidth:0 isRound:NO]; + UITapGestureRecognizer *portraitTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(editPortrait)]; + [imageView addGestureRecognizer:portraitTap]; + self.tapGesture = portraitTap; + + self.portraitImageView = imageView; + + [self addSubview:imageView]; +} + +- (id)initWithWithWidth:(CGFloat)imageW portraitX:(CGFloat)X portraitY:(CGFloat)Y borderWidth:(CGFloat)borderW circleColor:(UIColor *)borderColor isRound:(BOOL)round andViewController:(UIViewController *)controller +{ + + if (self = [super init]) { + + + self.controller = controller; + self.backgroundColor = [UIColor clearColor]; + self.userInteractionEnabled = YES; + + CGRect tempFrame = self.frame; + + tempFrame.size.width = imageW; + tempFrame.size.height = imageW; + tempFrame.origin.x = X; + tempFrame.origin.y = Y; + + + self.frame = tempFrame; + + [self addImageView]; +// UIImageView * imageView = [[UIImageView alloc]initImageViewWidth:imageW X:0 Y:0 circleColor:borderColor borderWidth:borderW isRound:round]; +// UITapGestureRecognizer *portraitTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(editPortrait)]; +// [imageView addGestureRecognizer:portraitTap]; +// +// self.tapGesture = portraitTap; +// +// self.portraitImageView = imageView; +// [self addSubview:imageView]; + + + } + return self; +} +- (void)loadPortrait { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ { + NSURL *portraitUrl = [NSURL URLWithString:@"http://photo.l99.com/bigger/31/1363231021567_5zu910.jpg"]; + UIImage *protraitImg = [UIImage imageWithData:[NSData dataWithContentsOfURL:portraitUrl]]; + dispatch_sync(dispatch_get_main_queue(), ^{ + self.portraitImageView.image = protraitImg; + }); + }); +} + +- (void)editPortrait { + + [self endEditing:YES]; + UIViewController * vc = [AppCurrentControllerTool getCurrentController]; + [vc.view endEditing:YES]; + UIActionSheet *choiceSheet = [[UIActionSheet alloc] initWithTitle:nil + delegate:self + cancelButtonTitle:@"取消" + destructiveButtonTitle:nil + otherButtonTitles:@"拍照", @"从相册中选取", nil]; + [choiceSheet showInView:self]; +} + +#pragma mark VPImageCropperDelegate + +//点击确定的代理方法 +- (void)imageCropper:(VPImageCropperViewController *)cropperViewController didFinished:(UIImage *)editedImage { + self.portraitImageView.image = editedImage; + if (self.uploadPictBlock) { + self.uploadPictBlock(editedImage); + }else if ([self.portaitDelegate respondsToSelector:@selector(uploadPict:)]) + { + [self.portaitDelegate uploadPict:editedImage]; + } +// NSLog(@"裁剪--%@,未裁剪===%@",editedImage,self.origalImage); + [cropperViewController dismissViewControllerAnimated:YES completion:^{ + [[NSNotificationCenter defaultCenter] postNotificationName:@"pickerFinish" object:nil]; + }]; +} + +//点击取消的代理方法 +- (void)imageCropperDidCancel:(VPImageCropperViewController *)cropperViewController { + [cropperViewController dismissViewControllerAnimated:YES completion:^{ + }]; +} + +#pragma mark UIActionSheetDelegate +- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { + if (buttonIndex == 0) { + // 拍照 + if ([self isCameraAvailable] && [self doesCameraSupportTakingPhotos]) { + UIImagePickerController *controller = [[UIImagePickerController alloc] init]; + controller.sourceType = UIImagePickerControllerSourceTypeCamera; + if ([self isRearCameraAvailable]) { + controller.cameraDevice = UIImagePickerControllerCameraDeviceRear; + } + NSMutableArray *mediaTypes = [[NSMutableArray alloc] init]; + [mediaTypes addObject:(__bridge NSString *)kUTTypeImage]; + controller.mediaTypes = mediaTypes; + controller.delegate = self; + [self.controller presentViewController:controller + animated:YES + completion:^(void){ + //NSLog(@"Picker View Controller is presented"); + }]; + } + + } else if (buttonIndex == 1) { + // 从相册中选取 + if ([self isPhotoLibraryAvailable]) { + + UIImagePickerController *controller = [[UIImagePickerController alloc] init]; + controller.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + NSMutableArray *mediaTypes = [[NSMutableArray alloc] init]; + [mediaTypes addObject:(__bridge NSString *)kUTTypeImage]; + controller.mediaTypes = mediaTypes; + controller.delegate = self; + [self.controller presentViewController:controller + animated:YES + completion:^(void){ + // NSLog(@"Picker View Controller is presented"); + }]; + } + } +} + + + +#pragma mark - UIImagePickerControllerDelegate +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { + [picker dismissViewControllerAnimated:YES completion:^() { + UIImage *portraitImg = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; + portraitImg = [self imageByScalingToMaxSize:portraitImg]; + + self.origalImage = portraitImg; + + +// if (self.isCrop) { + + // 裁剪 + VPImageCropperViewController *imgEditorVC = [[VPImageCropperViewController alloc ] initWithImage:portraitImg cropFrame:CGRectMake(0, 100.0f, self.controller.view.frame.size.width, self.controller.view.frame.size.width) limitScaleRatio:3.0]; + imgEditorVC.delegate = self; + self.controller.modalPresentationStyle = UIModalPresentationFormSheet; + [self.controller presentViewController:imgEditorVC animated:YES completion:^{ + // TO DO + + }]; + +// } + }]; + +} + +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { + [picker dismissViewControllerAnimated:YES completion:^(){ + }]; +} + +#pragma mark - UINavigationControllerDelegate +- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { +} + +- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated { + +} + +#pragma mark camera utility +- (BOOL) isCameraAvailable{ + return [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]; +} + +- (BOOL) isRearCameraAvailable{ + return [UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceRear]; +} + +- (BOOL) isFrontCameraAvailable { + return [UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront]; +} + +- (BOOL) doesCameraSupportTakingPhotos { + return [self cameraSupportsMedia:(__bridge NSString *)kUTTypeImage sourceType:UIImagePickerControllerSourceTypeCamera]; +} + +- (BOOL) isPhotoLibraryAvailable{ + return [UIImagePickerController isSourceTypeAvailable: + UIImagePickerControllerSourceTypePhotoLibrary]; +} +- (BOOL) canUserPickVideosFromPhotoLibrary{ + return [self + cameraSupportsMedia:(__bridge NSString *)kUTTypeMovie sourceType:UIImagePickerControllerSourceTypePhotoLibrary]; +} +- (BOOL) canUserPickPhotosFromPhotoLibrary{ + return [self + cameraSupportsMedia:(__bridge NSString *)kUTTypeImage sourceType:UIImagePickerControllerSourceTypePhotoLibrary]; +} + +- (BOOL) cameraSupportsMedia:(NSString *)paramMediaType sourceType:(UIImagePickerControllerSourceType)paramSourceType{ + __block BOOL result = NO; + if ([paramMediaType length] == 0) { + return NO; + } + NSArray *availableMediaTypes = [UIImagePickerController availableMediaTypesForSourceType:paramSourceType]; + [availableMediaTypes enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) { + NSString *mediaType = (NSString *)obj; + if ([mediaType isEqualToString:paramMediaType]){ + result = YES; + *stop= YES; + } + }]; + return result; +} + +#pragma mark image scale utility +- (UIImage *)imageByScalingToMaxSize:(UIImage *)sourceImage { + if (sourceImage.size.width < ORIGINAL_MAX_WIDTH) return sourceImage; + CGFloat btWidth = 0.0f; + CGFloat btHeight = 0.0f; + if (sourceImage.size.width > sourceImage.size.height) { + btHeight = ORIGINAL_MAX_WIDTH; + btWidth = sourceImage.size.width * (ORIGINAL_MAX_WIDTH / sourceImage.size.height); + } else { + btWidth = ORIGINAL_MAX_WIDTH; + btHeight = sourceImage.size.height * (ORIGINAL_MAX_WIDTH / sourceImage.size.width); + } + CGSize targetSize = CGSizeMake(btWidth, btHeight); + return [self imageByScalingAndCroppingForSourceImage:sourceImage targetSize:targetSize]; +} + +- (UIImage *)imageByScalingAndCroppingForSourceImage:(UIImage *)sourceImage targetSize:(CGSize)targetSize { + UIImage *newImage = nil; + CGSize imageSize = sourceImage.size; + CGFloat width = imageSize.width; + CGFloat height = imageSize.height; + CGFloat targetWidth = targetSize.width; + CGFloat targetHeight = targetSize.height; + CGFloat scaleFactor = 0.0; + CGFloat scaledWidth = targetWidth; + CGFloat scaledHeight = targetHeight; + CGPoint thumbnailPoint = CGPointMake(0.0,0.0); + if (CGSizeEqualToSize(imageSize, targetSize) == NO) + { + CGFloat widthFactor = targetWidth / width; + CGFloat heightFactor = targetHeight / height; + + if (widthFactor > heightFactor) + scaleFactor = widthFactor; // scale to fit height + else + scaleFactor = heightFactor; // scale to fit width + scaledWidth = width * scaleFactor; + scaledHeight = height * scaleFactor; + + // center the image + if (widthFactor > heightFactor) + { + thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5; + } + else + if (widthFactor < heightFactor) + { + thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5; + } + } + UIGraphicsBeginImageContext(targetSize); // this will crop + CGRect thumbnailRect = CGRectZero; + thumbnailRect.origin = thumbnailPoint; + thumbnailRect.size.width = scaledWidth; + thumbnailRect.size.height = scaledHeight; + + [sourceImage drawInRect:thumbnailRect]; + + newImage = UIGraphicsGetImageFromCurrentImageContext(); +// if(newImage == nil) NSLog(@"could not scale image"); + + //pop the context to get back to the default + UIGraphicsEndImageContext(); + return newImage; +} + +#pragma mark portraitImageView getter + + ++ (KZPortaitView *)addPortaitImageViewWidth:(CGFloat)imageW portraitX:(CGFloat)X portraitY:(CGFloat)Y borderWidth:(CGFloat)borderW circleColor:(UIColor *)borderColor isRound:(BOOL)round andViewController:(UIViewController *)controller; +{ + + return [[self alloc]initWithWithWidth:imageW portraitX:X portraitY:Y borderWidth:borderW circleColor:borderColor isRound:round andViewController:controller]; + +} + + + +@end diff --git "a/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/UIImageView+KJ.h" "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/UIImageView+KJ.h" new file mode 100644 index 0000000..24fe323 --- /dev/null +++ "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/UIImageView+KJ.h" @@ -0,0 +1,30 @@ +// +// UIImageView+KJ.h +// VPImageCropperDemo +// +// Created by 唐开江 on 14/12/20. +// Copyright (c) 2014年 Vinson.D.Warm. All rights reserved. +// + +#import + +@interface UIImageView (KJ) + +/** + * 创建一个缩小的imageView,可以指定x,y和圆圈颜色 + * + * @param width 图片宽度 + * @param imageViewX x值 + * @param imageViewY y值 + * @param color 指定颜色 + * @param borderW 外边宽度 + * @param round 是否切成原型 + */ +- (instancetype)initImageViewWidth:(CGFloat)imageV X:(CGFloat)imageViewX Y:(CGFloat)imageViewY circleColor:(UIColor *)color borderWidth:(CGFloat)borderW isRound:(BOOL)round; + + + + + + +@end diff --git "a/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/UIImageView+KJ.m" "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/UIImageView+KJ.m" new file mode 100644 index 0000000..d50618f --- /dev/null +++ "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/UIImageView+KJ.m" @@ -0,0 +1,41 @@ +// +// UIImageView+KJ.m +// VPImageCropperDemo +// +// Created by 唐开江 on 14/12/20. +// Copyright (c) 2014年 Vinson.D.Warm. All rights reserved. +// + +#import "UIImageView+KJ.h" + +@implementation UIImageView (KJ) + +- (instancetype)initImageViewWidth:(CGFloat)imageV X:(CGFloat)imageViewX Y:(CGFloat)imageViewY circleColor:(UIColor *)color borderWidth:(CGFloat)borderW isRound:(BOOL)round +{ + CGFloat w = imageV; CGFloat h = w; + self = [[UIImageView alloc] initWithFrame:CGRectMake(imageViewX, imageViewY, w, h)]; + if(round) + { + [self.layer setCornerRadius:(self.frame.size.height/2)]; + } + + [self setContentMode:UIViewContentModeScaleAspectFill]; + [self setClipsToBounds:YES]; + + + if (color) { + self.layer.borderColor = [color CGColor]; + }else + { + self.layer.borderColor = [[UIColor blackColor] CGColor]; + } + + self.layer.borderWidth = borderW; + + self.userInteractionEnabled = YES; + + + + return self; +} +@end diff --git "a/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPImageCropperViewController.h" "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPImageCropperViewController.h" new file mode 100755 index 0000000..9ecd433 --- /dev/null +++ "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPImageCropperViewController.h" @@ -0,0 +1,27 @@ +// +// VPImageCropperViewController.h +// VPolor +// +// Created by Vinson.D.Warm on 12/30/13. +// Copyright (c) 2013 Huang Vinson. All rights reserved. +// + +#import + +@class VPImageCropperViewController; + +@protocol VPImageCropperDelegate + +- (void)imageCropper:(VPImageCropperViewController *)cropperViewController didFinished:(UIImage *)editedImage; +- (void)imageCropperDidCancel:(VPImageCropperViewController *)cropperViewController; +@end + +@interface VPImageCropperViewController : UIViewController + +@property (nonatomic, assign) NSInteger tag; +@property (nonatomic, assign) id delegate; +@property (nonatomic, assign) CGRect cropFrame; + +- (id)initWithImage:(UIImage *)originalImage cropFrame:(CGRect)cropFrame limitScaleRatio:(NSInteger)limitRatio; + +@end diff --git "a/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPImageCropperViewController.m" "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPImageCropperViewController.m" new file mode 100755 index 0000000..d83bcca --- /dev/null +++ "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPImageCropperViewController.m" @@ -0,0 +1,294 @@ +// +// VPImageCropperViewController.m +// VPolor +// +// Created by Vinson.D.Warm on 12/30/13. +// Copyright (c) 2013 Huang Vinson. All rights reserved. +// + +#import "VPImageCropperViewController.h" + +#define SCALE_FRAME_Y 100.0f +#define BOUNDCE_DURATION 0.3f + +@interface VPImageCropperViewController () + +@property (nonatomic, retain) UIImage *originalImage; +@property (nonatomic, retain) UIImage *editedImage; + +@property (nonatomic, retain) UIImageView *showImgView; +@property (nonatomic, retain) UIView *overlayView; +@property (nonatomic, retain) UIView *ratioView; + +@property (nonatomic, assign) CGRect oldFrame; +@property (nonatomic, assign) CGRect largeFrame; +@property (nonatomic, assign) CGFloat limitRatio; + +@property (nonatomic, assign) CGRect latestFrame; + +@end + +@implementation VPImageCropperViewController + +- (void)dealloc { + self.originalImage = nil; + self.showImgView = nil; + self.editedImage = nil; + self.overlayView = nil; + self.ratioView = nil; +} + +- (id)initWithImage:(UIImage *)originalImage cropFrame:(CGRect)cropFrame limitScaleRatio:(NSInteger)limitRatio { + self = [super init]; + if (self) { + self.cropFrame = cropFrame; + self.limitRatio = limitRatio; + self.originalImage = originalImage; + } + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + [self initView]; + [self initControlBtn]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { + return NO; +} + +- (void)initView { + + //防止加载view的时候出现卡顿和透明现象 + self.view.backgroundColor = [UIColor whiteColor]; + self.showImgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 480)]; + [self.showImgView setMultipleTouchEnabled:YES]; + [self.showImgView setUserInteractionEnabled:YES]; + [self.showImgView setImage:self.originalImage]; + [self.showImgView setUserInteractionEnabled:YES]; + [self.showImgView setMultipleTouchEnabled:YES]; + + // scale to fit the screen + CGFloat oriWidth = self.cropFrame.size.width; + CGFloat oriHeight = self.originalImage.size.height * (oriWidth / self.originalImage.size.width); + CGFloat oriX = self.cropFrame.origin.x + (self.cropFrame.size.width - oriWidth) / 2; + CGFloat oriY = self.cropFrame.origin.y + (self.cropFrame.size.height - oriHeight) / 2; + self.oldFrame = CGRectMake(oriX, oriY, oriWidth, oriHeight); + self.latestFrame = self.oldFrame; + self.showImgView.frame = self.oldFrame; + + self.largeFrame = CGRectMake(0, 0, self.limitRatio * self.oldFrame.size.width, self.limitRatio * self.oldFrame.size.height); + + [self addGestureRecognizers]; + [self.view addSubview:self.showImgView]; + + self.overlayView = [[UIView alloc] initWithFrame:self.view.bounds]; + self.overlayView.alpha = .5f; + self.overlayView.backgroundColor = [UIColor blackColor]; + self.overlayView.userInteractionEnabled = NO; + self.overlayView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; + [self.view addSubview:self.overlayView]; + + self.ratioView = [[UIView alloc] initWithFrame:self.cropFrame]; + self.ratioView.layer.borderColor = [UIColor yellowColor].CGColor; + self.ratioView.layer.borderWidth = 1.0f; + self.ratioView.autoresizingMask = UIViewAutoresizingNone; + [self.view addSubview:self.ratioView]; + + [self overlayClipping]; +} + +- (void)initControlBtn { + UIButton *cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 50.0f, 100, 50)]; + cancelBtn.backgroundColor = [UIColor clearColor]; + cancelBtn.titleLabel.textColor = [UIColor whiteColor]; + [cancelBtn setTitle:@"取消" forState:UIControlStateNormal]; + [cancelBtn.titleLabel setFont:[UIFont boldSystemFontOfSize:18.0f]]; + [cancelBtn.titleLabel setTextAlignment:NSTextAlignmentCenter]; +// [cancelBtn.titleLabel setLineBreakMode:NSLineBreakByWordWrapping]; + [cancelBtn.titleLabel setNumberOfLines:0]; + [cancelBtn setTitleEdgeInsets:UIEdgeInsetsMake(5.0f, 5.0f, 5.0f, 5.0f)]; + [cancelBtn addTarget:self action:@selector(cancel:) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:cancelBtn]; + + UIButton *confirmBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width - 100.0f, self.view.frame.size.height - 50.0f, 100, 50)]; + confirmBtn.backgroundColor = [UIColor clearColor]; + confirmBtn.titleLabel.textColor = [UIColor whiteColor]; + [confirmBtn setTitle:@"确定" forState:UIControlStateNormal]; + [confirmBtn.titleLabel setFont:[UIFont boldSystemFontOfSize:18.0f]]; + [confirmBtn.titleLabel setTextAlignment:NSTextAlignmentCenter]; + confirmBtn.titleLabel.textColor = [UIColor whiteColor]; +// [confirmBtn.titleLabel setLineBreakMode:NSLineBreakByWordWrapping]; + [confirmBtn.titleLabel setNumberOfLines:0]; + [confirmBtn setTitleEdgeInsets:UIEdgeInsetsMake(5.0f, 5.0f, 5.0f, 5.0f)]; + [confirmBtn addTarget:self action:@selector(confirm:) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:confirmBtn]; +} + +- (void)cancel:(id)sender { + if (self.delegate && [self.delegate conformsToProtocol:@protocol(VPImageCropperDelegate)]) { + [self.delegate imageCropperDidCancel:self]; + } +} + +- (void)confirm:(id)sender { + if (self.delegate && [self.delegate conformsToProtocol:@protocol(VPImageCropperDelegate)]) { + [self.delegate imageCropper:self didFinished:[self getSubImage]]; + } +} + +- (void)overlayClipping +{ + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; + CGMutablePathRef path = CGPathCreateMutable(); + // Left side of the ratio view + CGPathAddRect(path, nil, CGRectMake(0, 0, + self.ratioView.frame.origin.x, + self.overlayView.frame.size.height)); + // Right side of the ratio view + CGPathAddRect(path, nil, CGRectMake( + self.ratioView.frame.origin.x + self.ratioView.frame.size.width, + 0, + self.overlayView.frame.size.width - self.ratioView.frame.origin.x - self.ratioView.frame.size.width, + self.overlayView.frame.size.height)); + // Top side of the ratio view + CGPathAddRect(path, nil, CGRectMake(0, 0, + self.overlayView.frame.size.width, + self.ratioView.frame.origin.y)); + // Bottom side of the ratio view + CGPathAddRect(path, nil, CGRectMake(0, + self.ratioView.frame.origin.y + self.ratioView.frame.size.height, + self.overlayView.frame.size.width, + self.overlayView.frame.size.height - self.ratioView.frame.origin.y + self.ratioView.frame.size.height)); + maskLayer.path = path; + self.overlayView.layer.mask = maskLayer; + CGPathRelease(path); +} + +// register all gestures +- (void) addGestureRecognizers +{ + // add pinch gesture + UIPinchGestureRecognizer *pinchGestureRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pinchView:)]; + [self.view addGestureRecognizer:pinchGestureRecognizer]; + + // add pan gesture + UIPanGestureRecognizer *panGestureRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panView:)]; + [self.view addGestureRecognizer:panGestureRecognizer]; +} + +// pinch gesture handler +- (void) pinchView:(UIPinchGestureRecognizer *)pinchGestureRecognizer +{ + UIView *view = self.showImgView; + if (pinchGestureRecognizer.state == UIGestureRecognizerStateBegan || pinchGestureRecognizer.state == UIGestureRecognizerStateChanged) { + view.transform = CGAffineTransformScale(view.transform, pinchGestureRecognizer.scale, pinchGestureRecognizer.scale); + pinchGestureRecognizer.scale = 1; + } + else if (pinchGestureRecognizer.state == UIGestureRecognizerStateEnded) { + CGRect newFrame = self.showImgView.frame; + newFrame = [self handleScaleOverflow:newFrame]; + newFrame = [self handleBorderOverflow:newFrame]; + [UIView animateWithDuration:BOUNDCE_DURATION animations:^{ + self.showImgView.frame = newFrame; + self.latestFrame = newFrame; + }]; + } +} + +// pan gesture handler +- (void) panView:(UIPanGestureRecognizer *)panGestureRecognizer +{ + UIView *view = self.showImgView; + if (panGestureRecognizer.state == UIGestureRecognizerStateBegan || panGestureRecognizer.state == UIGestureRecognizerStateChanged) { + // calculate accelerator + CGFloat absCenterX = self.cropFrame.origin.x + self.cropFrame.size.width / 2; + CGFloat absCenterY = self.cropFrame.origin.y + self.cropFrame.size.height / 2; + CGFloat scaleRatio = self.showImgView.frame.size.width / self.cropFrame.size.width; + CGFloat acceleratorX = 1 - ABS(absCenterX - view.center.x) / (scaleRatio * absCenterX); + CGFloat acceleratorY = 1 - ABS(absCenterY - view.center.y) / (scaleRatio * absCenterY); + CGPoint translation = [panGestureRecognizer translationInView:view.superview]; + [view setCenter:(CGPoint){view.center.x + translation.x * acceleratorX, view.center.y + translation.y * acceleratorY}]; + [panGestureRecognizer setTranslation:CGPointZero inView:view.superview]; + } + else if (panGestureRecognizer.state == UIGestureRecognizerStateEnded) { + // bounce to original frame + CGRect newFrame = self.showImgView.frame; + newFrame = [self handleBorderOverflow:newFrame]; + [UIView animateWithDuration:BOUNDCE_DURATION animations:^{ + self.showImgView.frame = newFrame; + self.latestFrame = newFrame; + }]; + } +} + +- (CGRect)handleScaleOverflow:(CGRect)newFrame { + // bounce to original frame + CGPoint oriCenter = CGPointMake(newFrame.origin.x + newFrame.size.width/2, newFrame.origin.y + newFrame.size.height/2); + if (newFrame.size.width < self.oldFrame.size.width) { + newFrame = self.oldFrame; + } + if (newFrame.size.width > self.largeFrame.size.width) { + newFrame = self.largeFrame; + } + newFrame.origin.x = oriCenter.x - newFrame.size.width/2; + newFrame.origin.y = oriCenter.y - newFrame.size.height/2; + + return newFrame; +} + +- (CGRect)handleBorderOverflow:(CGRect)newFrame { + // horizontally + if (newFrame.origin.x > self.cropFrame.origin.x) newFrame.origin.x = self.cropFrame.origin.x; + if (CGRectGetMaxX(newFrame) < self.cropFrame.size.width) newFrame.origin.x = self.cropFrame.size.width - newFrame.size.width; + // vertically + if (newFrame.origin.y > self.cropFrame.origin.y) newFrame.origin.y = self.cropFrame.origin.y; + if (CGRectGetMaxY(newFrame) < self.cropFrame.origin.y + self.cropFrame.size.height) { + newFrame.origin.y = self.cropFrame.origin.y + self.cropFrame.size.height - newFrame.size.height; + } + // adapt horizontally rectangle + if (self.showImgView.frame.size.width > self.showImgView.frame.size.height && newFrame.size.height <= self.cropFrame.size.height) { + newFrame.origin.y = self.cropFrame.origin.y + (self.cropFrame.size.height - newFrame.size.height) / 2; + } + + return newFrame; +} + +-(UIImage *)getSubImage{ + CGRect squareFrame = self.cropFrame; + CGFloat scaleRatio = self.latestFrame.size.width / self.originalImage.size.width; + CGFloat x = (squareFrame.origin.x - self.latestFrame.origin.x) / scaleRatio; + CGFloat y = (squareFrame.origin.y - self.latestFrame.origin.y) / scaleRatio; + CGFloat w = squareFrame.size.width / scaleRatio; + CGFloat h = squareFrame.size.width / scaleRatio; + if (self.latestFrame.size.width < self.cropFrame.size.width) { + CGFloat newW = self.originalImage.size.width; + CGFloat newH = newW * (self.cropFrame.size.height / self.cropFrame.size.width); + x = 0; y = y + (h - newH) / 2; + w = newH; h = newH; + } + if (self.latestFrame.size.height < self.cropFrame.size.height) { + CGFloat newH = self.originalImage.size.height; + CGFloat newW = newH * (self.cropFrame.size.width / self.cropFrame.size.height); + x = x + (w - newW) / 2; y = 0; + w = newH; h = newH; + } + CGRect myImageRect = CGRectMake(x, y, w, h); + CGImageRef imageRef = self.originalImage.CGImage; + CGImageRef subImageRef = CGImageCreateWithImageInRect(imageRef, myImageRect); + CGSize size; + size.width = myImageRect.size.width; + size.height = myImageRect.size.height; + UIGraphicsBeginImageContext(size); + CGContextRef context = UIGraphicsGetCurrentContext(); + CGContextDrawImage(context, myImageRect, subImageRef); + UIImage* smallImage = [UIImage imageWithCGImage:subImageRef]; + UIGraphicsEndImageContext(); + + return smallImage; +} + +@end diff --git "a/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPViewController.h" "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPViewController.h" new file mode 100755 index 0000000..85b56b6 --- /dev/null +++ "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPViewController.h" @@ -0,0 +1,35 @@ +// +// VPViewController.h +// VPImageCropperDemo +// +// Created by Vinson.D.Warm on 1/13/14. +// Copyright (c) 2014 Vinson.D.Warm. All rights reserved. +// + +#import + +@interface VPViewController : UIViewController + +//不改变形状的图片 +@property (nonatomic,weak)UIImage * originalImageView; + +/** + * * 创建返回一个可以选择图片的iamgeView + * + * @param width 宽度 + * @param X x值 + * @param Y y值 + * @param borderW 外圆宽度,一般为2.0f + * @param borderColor 外圆颜色,默认白色 + * @param round 是否切成原型 + */ +- (UIImageView *)addPortaitImageViewWidth:(CGFloat)imageW portraitX:(CGFloat)X portraitY:(CGFloat)Y width:(CGFloat)borderW circleColor:(UIColor *)borderColor isRound:(BOOL)round; + + + +- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex; + + + +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info; +@end diff --git "a/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPViewController.m" "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPViewController.m" new file mode 100755 index 0000000..47a2beb --- /dev/null +++ "b/LJHY_User/Utils/VPImageCropper(\345\244\264\345\203\217\345\267\245\345\205\267)/VPViewController.m" @@ -0,0 +1,284 @@ +// +// VPViewController.m +// VPImageCropperDemo +// +// Created by Vinson.D.Warm on 1/13/14. +// Copyright (c) 2014 Vinson.D.Warm. All rights reserved. +// + +#import "VPViewController.h" +#import "VPImageCropperViewController.h" +#import +#import +#import "UIImageView+KJ.h" + +#define ORIGINAL_MAX_WIDTH 640.0f + +@interface VPViewController () +@property (nonatomic, strong) UIImageView *portraitImageView; + + +@end + +@implementation VPViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + self.view.backgroundColor = [UIColor whiteColor]; +// [self.view addSubview:self.portraitImageView]; + //[self loadPortrait]; + + + + +} + +- (void)loadPortrait { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^ { + NSURL *portraitUrl = [NSURL URLWithString:@"http://photo.l99.com/bigger/31/1363231021567_5zu910.jpg"]; + UIImage *protraitImg = [UIImage imageWithData:[NSData dataWithContentsOfURL:portraitUrl]]; + dispatch_sync(dispatch_get_main_queue(), ^{ + self.portraitImageView.image = protraitImg; + }); + }); +} + +- (void)editPortrait { +// [self.view endEditing:YES]; + UIActionSheet *choiceSheet = [[UIActionSheet alloc] initWithTitle:nil + delegate:self + cancelButtonTitle:@"取消" + destructiveButtonTitle:nil + otherButtonTitles:@"拍照", @"从相册中选取", nil]; + [choiceSheet showInView:self.view]; + +} + +#pragma mark VPImageCropperDelegate + +//点击确定的代理方法 +- (void)imageCropper:(VPImageCropperViewController *)cropperViewController didFinished:(UIImage *)editedImage { + self.portraitImageView.image = editedImage; + NSLog(@"%@",editedImage); + [cropperViewController dismissViewControllerAnimated:YES completion:^{ + [[NSNotificationCenter defaultCenter] postNotificationName:@"pickerFinish" object:nil]; + }]; +} + +//点击取消的代理方法 +- (void)imageCropperDidCancel:(VPImageCropperViewController *)cropperViewController { + [cropperViewController dismissViewControllerAnimated:YES completion:^{ + }]; +} + +#pragma mark UIActionSheetDelegate +- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { + + if (buttonIndex == 0) { + // 拍照 + if ([self isCameraAvailable] && [self doesCameraSupportTakingPhotos]) { + UIImagePickerController *controller = [[UIImagePickerController alloc] init]; + controller.sourceType = UIImagePickerControllerSourceTypeCamera; + if ([self isRearCameraAvailable]) { + controller.cameraDevice = UIImagePickerControllerCameraDeviceRear; + } + NSMutableArray *mediaTypes = [[NSMutableArray alloc] init]; + [mediaTypes addObject:(__bridge NSString *)kUTTypeImage]; + controller.mediaTypes = mediaTypes; + controller.delegate = self; + [self presentViewController:controller + animated:YES + completion:^(void){ + //NSLog(@"Picker View Controller is presented"); + }]; + } + + } else if (buttonIndex == 1) { + // 从相册中选取 + if ([self isPhotoLibraryAvailable]) { + + UIImagePickerController *controller = [[UIImagePickerController alloc] init]; + controller.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; + NSMutableArray *mediaTypes = [[NSMutableArray alloc] init]; + [mediaTypes addObject:(__bridge NSString *)kUTTypeImage]; + controller.mediaTypes = mediaTypes; + controller.delegate = self; + [self presentViewController:controller + animated:YES + completion:^(void){ + // NSLog(@"Picker View Controller is presented"); + }]; + } + } +} + + + +#pragma mark - UIImagePickerControllerDelegate +- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { + [picker dismissViewControllerAnimated:YES completion:^() { + UIImage *portraitImg = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; + portraitImg = [self imageByScalingToMaxSize:portraitImg]; + + // 裁剪 + VPImageCropperViewController *imgEditorVC = [[VPImageCropperViewController alloc ] initWithImage:portraitImg cropFrame:CGRectMake(0, 100.0f, self.view.frame.size.width, self.view.frame.size.width) limitScaleRatio:3.0]; + imgEditorVC.delegate = self; + self.modalPresentationStyle = UIModalPresentationFormSheet; + [self presentViewController:imgEditorVC animated:YES completion:^{ + // TO DO + + }]; + }]; +} + +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { + [picker dismissViewControllerAnimated:YES completion:^(){ + }]; +} + +#pragma mark - UINavigationControllerDelegate +- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated { +} + +- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated { + +} + +#pragma mark camera utility +- (BOOL) isCameraAvailable{ + return [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]; +} + +- (BOOL) isRearCameraAvailable{ + return [UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceRear]; +} + +- (BOOL) isFrontCameraAvailable { + return [UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront]; +} + +- (BOOL) doesCameraSupportTakingPhotos { + return [self cameraSupportsMedia:(__bridge NSString *)kUTTypeImage sourceType:UIImagePickerControllerSourceTypeCamera]; +} + +- (BOOL) isPhotoLibraryAvailable{ + return [UIImagePickerController isSourceTypeAvailable: + UIImagePickerControllerSourceTypePhotoLibrary]; +} +- (BOOL) canUserPickVideosFromPhotoLibrary{ + return [self + cameraSupportsMedia:(__bridge NSString *)kUTTypeMovie sourceType:UIImagePickerControllerSourceTypePhotoLibrary]; +} +- (BOOL) canUserPickPhotosFromPhotoLibrary{ + return [self + cameraSupportsMedia:(__bridge NSString *)kUTTypeImage sourceType:UIImagePickerControllerSourceTypePhotoLibrary]; +} + +- (BOOL) cameraSupportsMedia:(NSString *)paramMediaType sourceType:(UIImagePickerControllerSourceType)paramSourceType{ + __block BOOL result = NO; + if ([paramMediaType length] == 0) { + return NO; + } + NSArray *availableMediaTypes = [UIImagePickerController availableMediaTypesForSourceType:paramSourceType]; + [availableMediaTypes enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) { + NSString *mediaType = (NSString *)obj; + if ([mediaType isEqualToString:paramMediaType]){ + result = YES; + *stop= YES; + } + }]; + return result; +} + +#pragma mark image scale utility +- (UIImage *)imageByScalingToMaxSize:(UIImage *)sourceImage { + if (sourceImage.size.width < ORIGINAL_MAX_WIDTH) return sourceImage; + CGFloat btWidth = 0.0f; + CGFloat btHeight = 0.0f; + if (sourceImage.size.width > sourceImage.size.height) { + btHeight = ORIGINAL_MAX_WIDTH; + btWidth = sourceImage.size.width * (ORIGINAL_MAX_WIDTH / sourceImage.size.height); + } else { + btWidth = ORIGINAL_MAX_WIDTH; + btHeight = sourceImage.size.height * (ORIGINAL_MAX_WIDTH / sourceImage.size.width); + } + CGSize targetSize = CGSizeMake(btWidth, btHeight); + return [self imageByScalingAndCroppingForSourceImage:sourceImage targetSize:targetSize]; +} + +- (UIImage *)imageByScalingAndCroppingForSourceImage:(UIImage *)sourceImage targetSize:(CGSize)targetSize { + UIImage *newImage = nil; + CGSize imageSize = sourceImage.size; + CGFloat width = imageSize.width; + CGFloat height = imageSize.height; + CGFloat targetWidth = targetSize.width; + CGFloat targetHeight = targetSize.height; + CGFloat scaleFactor = 0.0; + CGFloat scaledWidth = targetWidth; + CGFloat scaledHeight = targetHeight; + CGPoint thumbnailPoint = CGPointMake(0.0,0.0); + if (CGSizeEqualToSize(imageSize, targetSize) == NO) + { + CGFloat widthFactor = targetWidth / width; + CGFloat heightFactor = targetHeight / height; + + if (widthFactor > heightFactor) + scaleFactor = widthFactor; // scale to fit height + else + scaleFactor = heightFactor; // scale to fit width + scaledWidth = width * scaleFactor; + scaledHeight = height * scaleFactor; + + // center the image + if (widthFactor > heightFactor) + { + thumbnailPoint.y = (targetHeight - scaledHeight) * 0.5; + } + else + if (widthFactor < heightFactor) + { + thumbnailPoint.x = (targetWidth - scaledWidth) * 0.5; + } + } + UIGraphicsBeginImageContext(targetSize); // this will crop + CGRect thumbnailRect = CGRectZero; + thumbnailRect.origin = thumbnailPoint; + thumbnailRect.size.width = scaledWidth; + thumbnailRect.size.height = scaledHeight; + + [sourceImage drawInRect:thumbnailRect]; + + newImage = UIGraphicsGetImageFromCurrentImageContext(); + if(newImage == nil) NSLog(@"could not scale image"); + + //pop the context to get back to the default + UIGraphicsEndImageContext(); + return newImage; +} + +#pragma mark portraitImageView getter + + +- (UIImageView *)addPortaitImageViewWidth:(CGFloat)imageW portraitX:(CGFloat)X portraitY:(CGFloat)Y width:(CGFloat)borderW circleColor:(UIColor *)borderColor isRound:(BOOL)round +{ + + UIImageView * imageView = [[UIImageView alloc]initImageViewWidth:imageW X:X Y:Y circleColor:borderColor borderWidth:borderW isRound:round]; + + UITapGestureRecognizer *portraitTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(editPortrait)]; + [imageView addGestureRecognizer:portraitTap]; + + self.portraitImageView = imageView; + + return imageView; + +} + + + + + + + +@end diff --git a/LJHY_User/Utils/ZoomImage/ZoomImage.h b/LJHY_User/Utils/ZoomImage/ZoomImage.h new file mode 100644 index 0000000..2c104d1 --- /dev/null +++ b/LJHY_User/Utils/ZoomImage/ZoomImage.h @@ -0,0 +1,21 @@ +// +// ZoomImage.h +// yiliaotoutiao +// +// Created by Jason T on 16/2/29. +// Copyright © 2016年 YXH. All rights reserved. +// + +#import + + + +@interface ZoomImage : UIView +/** +  * @brief 点击图片放大,再次点击缩小 +  * +  * @param oldImageView 头像所在的imageView +  */ ++(void)showImage:(UIImageView*)avatarImageView; +@end + diff --git a/LJHY_User/Utils/ZoomImage/ZoomImage.m b/LJHY_User/Utils/ZoomImage/ZoomImage.m new file mode 100644 index 0000000..c7dad9e --- /dev/null +++ b/LJHY_User/Utils/ZoomImage/ZoomImage.m @@ -0,0 +1,52 @@ +// +// ZoomImage.m +// yiliaotoutiao +// +// Created by Jason T on 16/2/29. +// Copyright © 2016年 YXH. All rights reserved. +// + + + +#import "ZoomImage.h" +static CGRect oldframe; +@implementation ZoomImage + + ++(void)showImage:(UIImageView*)avatarImageView +{ + UIImage *image =avatarImageView.image; + UIWindow *window =[UIApplication sharedApplication].keyWindow; + UIView *backgroundView =[[UIView alloc]initWithFrame:CGRectMake(0, 0,[UIScreen mainScreen].bounds.size.width,[UIScreen mainScreen].bounds.size.height)]; + oldframe =[avatarImageView convertRect:avatarImageView.bounds toView:window]; + backgroundView.backgroundColor =[UIColor blackColor]; + backgroundView.alpha =0.5; + UIImageView *imageView =[[UIImageView alloc]initWithFrame:oldframe]; + imageView.image =image; + imageView.tag =1; + [backgroundView addSubview:imageView]; + [window addSubview:backgroundView]; + //点击图片缩小的手势 + UITapGestureRecognizer *tap =[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(hideImage:)]; + [backgroundView addGestureRecognizer:tap]; + + [UIView animateWithDuration:0.3 animations:^{ + imageView.frame =CGRectMake(0,([UIScreen mainScreen].bounds.size.height-image.size.height*[UIScreen mainScreen].bounds.size.width/image.size.width)/2, [UIScreen mainScreen].bounds.size.width, image.size.height*[UIScreen mainScreen].bounds.size.width/image.size.width); + backgroundView.alpha =1; + }]; +} ++(void)hideImage:(UITapGestureRecognizer *)tap{ + + UIView *backgroundView =tap.view; + UIImageView *imageView =(UIImageView *)[tap.view viewWithTag:1]; + [UIView animateWithDuration:0.3 animations:^{ + imageView.frame =oldframe; + backgroundView.alpha =0; + + } completion:^(BOOL finished) { + [backgroundView removeFromSuperview]; + }]; + + +} +@end diff --git a/LJHY_User/Utils/kXMenu/KxMenu.h b/LJHY_User/Utils/kXMenu/KxMenu.h new file mode 100644 index 0000000..0de0c5d --- /dev/null +++ b/LJHY_User/Utils/kXMenu/KxMenu.h @@ -0,0 +1,67 @@ +// +// KxMenu.h +// kxmenu project +// https://github.com/kolyvan/kxmenu/ +// +// Created by Kolyvan on 17.05.13. +// + +/* + Copyright (c) 2013 Konstantin Bukreev. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + + +#import + +@interface KxMenuItem : NSObject + +@property (readwrite, nonatomic, strong) UIImage *image; +@property (readwrite, nonatomic, strong) NSString *title; +@property (readwrite, nonatomic, weak) id target; +@property (readwrite, nonatomic) SEL action; +@property (readwrite, nonatomic, strong) UIColor *foreColor; +@property (readwrite, nonatomic) NSTextAlignment alignment; + ++ (instancetype) menuItem:(NSString *) title + image:(UIImage *) image + target:(id)target + action:(SEL) action; + +@end + +@interface KxMenu : NSObject + ++ (void) showMenuInView:(UIView *)view + fromRect:(CGRect)rect + menuItems:(NSArray *)menuItems; + ++ (void) dismissMenu; + ++ (UIColor *) tintColor; ++ (void) setTintColor: (UIColor *) tintColor; + ++ (UIFont *) titleFont; ++ (void) setTitleFont: (UIFont *) titleFont; + +@end diff --git a/LJHY_User/Utils/kXMenu/KxMenu.m b/LJHY_User/Utils/kXMenu/KxMenu.m new file mode 100644 index 0000000..1c2f81e --- /dev/null +++ b/LJHY_User/Utils/kXMenu/KxMenu.m @@ -0,0 +1,921 @@ +// +// KxMenu.m +// kxmenu project +// https://github.com/kolyvan/kxmenu/ +// +// Created by Kolyvan on 17.05.13. +// + +/* + Copyright (c) 2013 Konstantin Bukreev. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/* + Some ideas was taken from QBPopupMenu project by Katsuma Tanaka. + https://github.com/questbeat/QBPopupMenu +*/ + +#import "KxMenu.h" +#import + +const CGFloat kArrowSize = 12.f; + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +@interface KxMenuView : UIView +@end + +@interface KxMenuOverlay : UIView +@end + +@implementation KxMenuOverlay + +// - (void) dealloc { NSLog(@"dealloc %@", self); } + +- (id)initWithFrame:(CGRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + self.backgroundColor = [UIColor clearColor]; + self.opaque = NO; + + UITapGestureRecognizer *gestureRecognizer; + gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self + action:@selector(singleTap:)]; + [self addGestureRecognizer:gestureRecognizer]; + } + return self; +} + +// thank horaceho https://github.com/horaceho +// for his solution described in https://github.com/kolyvan/kxmenu/issues/9 + +- (void)singleTap:(UITapGestureRecognizer *)recognizer +{ + for (UIView *v in self.subviews) { + if ([v isKindOfClass:[KxMenuView class]] && [v respondsToSelector:@selector(dismissMenu:)]) { + [v performSelector:@selector(dismissMenu:) withObject:@(YES)]; + } + } +} + +@end + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +@implementation KxMenuItem + ++ (instancetype) menuItem:(NSString *) title + image:(UIImage *) image + target:(id)target + action:(SEL) action +{ + return [[KxMenuItem alloc] init:title + image:image + target:target + action:action]; +} + +- (id) init:(NSString *) title + image:(UIImage *) image + target:(id)target + action:(SEL) action +{ + NSParameterAssert(title.length || image); + + self = [super init]; + if (self) { + + _title = title; + _image = image; + _target = target; + _action = action; + } + return self; +} + +- (BOOL) enabled +{ + return _target != nil && _action != NULL; +} + +- (void) performAction +{ + __strong id target = self.target; + + if (target && [target respondsToSelector:_action]) { + + [target performSelectorOnMainThread:_action withObject:self waitUntilDone:YES]; + } +} + +- (NSString *) description +{ + return [NSString stringWithFormat:@"<%@ #%p %@>", [self class], self, _title]; +} + +@end + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +typedef enum { + + KxMenuViewArrowDirectionNone, + KxMenuViewArrowDirectionUp, + KxMenuViewArrowDirectionDown, + KxMenuViewArrowDirectionLeft, + KxMenuViewArrowDirectionRight, + +} KxMenuViewArrowDirection; + +@implementation KxMenuView { + + KxMenuViewArrowDirection _arrowDirection; + CGFloat _arrowPosition; + UIView *_contentView; + NSArray *_menuItems; +} + +- (id)init +{ + self = [super initWithFrame:CGRectZero]; + if(self) { + + self.backgroundColor = [UIColor clearColor]; + self.opaque = YES; + self.alpha = 0; + +// self.layer.shadowOpacity = 0.5; +// self.layer.shadowOffset = CGSizeMake(2, 2); +// self.layer.shadowRadius = 2; + + self.layer.shadowOpacity = 0.5; + self.layer.shadowOffset = CGSizeMake(0, 0); + self.layer.shadowRadius = 0; + + + } + + return self; +} + +// - (void) dealloc { NSLog(@"dealloc %@", self); } + +- (void) setupFrameInView:(UIView *)view + fromRect:(CGRect)fromRect +{ + const CGSize contentSize = _contentView.frame.size; + + const CGFloat outerWidth = view.bounds.size.width; + const CGFloat outerHeight = view.bounds.size.height; + + const CGFloat rectX0 = fromRect.origin.x; + const CGFloat rectX1 = fromRect.origin.x + fromRect.size.width; + const CGFloat rectXM = fromRect.origin.x + fromRect.size.width * 0.5f; + const CGFloat rectY0 = fromRect.origin.y; + const CGFloat rectY1 = fromRect.origin.y + fromRect.size.height; + const CGFloat rectYM = fromRect.origin.y + fromRect.size.height * 0.5f;; + + const CGFloat widthPlusArrow = contentSize.width + kArrowSize; + const CGFloat heightPlusArrow = contentSize.height + kArrowSize; + const CGFloat widthHalf = contentSize.width * 0.5f; + const CGFloat heightHalf = contentSize.height * 0.5f; + + const CGFloat kMargin = 5.f; + + if (heightPlusArrow < (outerHeight - rectY1)) { + + _arrowDirection = KxMenuViewArrowDirectionUp; + CGPoint point = (CGPoint){ + rectXM - widthHalf, + rectY1 + }; + + if (point.x < kMargin) + point.x = kMargin; + + if ((point.x + contentSize.width + kMargin) > outerWidth) + point.x = outerWidth - contentSize.width - kMargin; + + _arrowPosition = rectXM - point.x; + //_arrowPosition = MAX(16, MIN(_arrowPosition, contentSize.width - 16)); + _contentView.frame = (CGRect){0, kArrowSize, contentSize}; + + self.frame = (CGRect) { + + point, + contentSize.width, + contentSize.height + kArrowSize + }; + + } else if (heightPlusArrow < rectY0) { + + _arrowDirection = KxMenuViewArrowDirectionDown; + CGPoint point = (CGPoint){ + rectXM - widthHalf, + rectY0 - heightPlusArrow + }; + + if (point.x < kMargin) + point.x = kMargin; + + if ((point.x + contentSize.width + kMargin) > outerWidth) + point.x = outerWidth - contentSize.width - kMargin; + + _arrowPosition = rectXM - point.x; + _contentView.frame = (CGRect){CGPointZero, contentSize}; + + self.frame = (CGRect) { + + point, + contentSize.width, + contentSize.height + kArrowSize + }; + + } else if (widthPlusArrow < (outerWidth - rectX1)) { + + _arrowDirection = KxMenuViewArrowDirectionLeft; + CGPoint point = (CGPoint){ + rectX1, + rectYM - heightHalf + }; + + if (point.y < kMargin) + point.y = kMargin; + + if ((point.y + contentSize.height + kMargin) > outerHeight) + point.y = outerHeight - contentSize.height - kMargin; + + _arrowPosition = rectYM - point.y; + _contentView.frame = (CGRect){kArrowSize, 0, contentSize}; + + self.frame = (CGRect) { + + point, + contentSize.width + kArrowSize, + contentSize.height + }; + + } else if (widthPlusArrow < rectX0) { + + _arrowDirection = KxMenuViewArrowDirectionRight; + CGPoint point = (CGPoint){ + rectX0 - widthPlusArrow, + rectYM - heightHalf + }; + + if (point.y < kMargin) + point.y = kMargin; + + if ((point.y + contentSize.height + 5) > outerHeight) + point.y = outerHeight - contentSize.height - kMargin; + + _arrowPosition = rectYM - point.y; + _contentView.frame = (CGRect){CGPointZero, contentSize}; + + self.frame = (CGRect) { + + point, + contentSize.width + kArrowSize, + contentSize.height + }; + + } else { + + _arrowDirection = KxMenuViewArrowDirectionNone; + + self.frame = (CGRect) { + + (outerWidth - contentSize.width) * 0.5f, + (outerHeight - contentSize.height) * 0.5f, + contentSize, + }; + } +} + +- (void)showMenuInView:(UIView *)view + fromRect:(CGRect)rect + menuItems:(NSArray *)menuItems +{ + _menuItems = menuItems; + + _contentView = [self mkContentView]; + [self addSubview:_contentView]; + + [self setupFrameInView:view fromRect:rect]; + + KxMenuOverlay *overlay = [[KxMenuOverlay alloc] initWithFrame:view.bounds]; + overlay.backgroundColor = [UIColor lightGrayColor]; + overlay.alpha = 0.2; + [overlay addSubview:self]; + [view addSubview:overlay]; + + _contentView.hidden = YES; + const CGRect toFrame = self.frame; + self.frame = (CGRect){self.arrowPoint, 1, 1}; + _contentView.backgroundColor = [UIColor whiteColor]; + + + //新加 + self.frame = toFrame; + self.alpha = 1.0f; + + [UIView animateWithDuration:0.2 + animations:^(void) { + +// self.alpha = 1.0f; +// self.frame = toFrame; + + } completion:^(BOOL completed) { + _contentView.hidden = NO; + }]; + +} + +- (void)dismissMenu:(BOOL) animated +{ + if (self.superview) { + + if (animated) { + + _contentView.hidden = YES; + const CGRect toFrame = (CGRect){self.arrowPoint, 1, 1}; + + self.alpha = 0; + self.frame = toFrame; + + [UIView animateWithDuration:0.2 + animations:^(void) { + +// self.alpha = 0; +// self.frame = toFrame; + + } completion:^(BOOL finished) { + + if ([self.superview isKindOfClass:[KxMenuOverlay class]]) + [self.superview removeFromSuperview]; + [self removeFromSuperview]; + }]; + + } else { + + if ([self.superview isKindOfClass:[KxMenuOverlay class]]) + [self.superview removeFromSuperview]; + [self removeFromSuperview]; + } + } +} + +- (void)performAction:(id)sender +{ + [self dismissMenu:YES]; + + UIButton *button = (UIButton *)sender; + KxMenuItem *menuItem = _menuItems[button.tag]; + [menuItem performAction]; +} + +- (UIView *) mkContentView +{ + for (UIView *v in self.subviews) { + [v removeFromSuperview]; + } + + if (!_menuItems.count) + return nil; + + const CGFloat kMinMenuItemHeight = 32.f; + const CGFloat kMinMenuItemWidth = 32.f; + const CGFloat kMarginX = 10.f; + const CGFloat kMarginY = 5.f; + + UIFont *titleFont = [KxMenu titleFont]; +// if (!titleFont) titleFont = [UIFont boldSystemFontOfSize:16]; + //修改 + if (!titleFont) titleFont = [UIFont systemFontOfSize:16]; + + + CGFloat maxImageWidth = 0; + CGFloat maxItemHeight = 0; + CGFloat maxItemWidth = 0; + + for (KxMenuItem *menuItem in _menuItems) { + + const CGSize imageSize = menuItem.image.size; + if (imageSize.width > maxImageWidth) + maxImageWidth = imageSize.width; + } + + if (maxImageWidth) { + maxImageWidth += kMarginX; + } + + for (KxMenuItem *menuItem in _menuItems) { + + const CGSize titleSize = [menuItem.title sizeWithFont:titleFont]; + const CGSize imageSize = menuItem.image.size; + + const CGFloat itemHeight = MAX(titleSize.height, imageSize.height) + kMarginY * 2; + const CGFloat itemWidth = ((!menuItem.enabled && !menuItem.image) ? titleSize.width : maxImageWidth + titleSize.width) + kMarginX * 4; + + if (itemHeight > maxItemHeight) + maxItemHeight = itemHeight; + + if (itemWidth > maxItemWidth) + maxItemWidth = itemWidth; + } + + maxItemWidth = MAX(maxItemWidth, kMinMenuItemWidth); + maxItemHeight = MAX(maxItemHeight, kMinMenuItemHeight); + + const CGFloat titleX = kMarginX * 2 + maxImageWidth; + const CGFloat titleWidth = maxItemWidth - titleX - kMarginX * 2; + + UIImage *selectedImage = [KxMenuView selectedImage:(CGSize){maxItemWidth, maxItemHeight + 2}]; + + //修改 + UIImage *gradientLine = [KxMenuView gradientLine: (CGSize){maxItemWidth - kMarginX * 4, 1}]; + + UIView *contentView = [[UIView alloc] initWithFrame:CGRectZero]; + contentView.autoresizingMask = UIViewAutoresizingNone; + contentView.backgroundColor = [UIColor clearColor]; + contentView.opaque = NO; + + CGFloat itemY = kMarginY * 2; + NSUInteger itemNum = 0; + + for (KxMenuItem *menuItem in _menuItems) { + + const CGRect itemFrame = (CGRect){0, itemY, maxItemWidth, maxItemHeight}; + + UIView *itemView = [[UIView alloc] initWithFrame:itemFrame]; + itemView.autoresizingMask = UIViewAutoresizingNone; + itemView.backgroundColor = [UIColor clearColor]; + itemView.opaque = NO; + + [contentView addSubview:itemView]; + + if (menuItem.enabled) { + + UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; + + button.tag = itemNum; + button.frame = itemView.bounds; + button.enabled = menuItem.enabled; + button.backgroundColor = [UIColor clearColor]; + button.opaque = NO; + // button.autoresizingMask = UIViewAutoresizingNone; + + [button addTarget:self + action:@selector(performAction:) + forControlEvents:UIControlEventTouchUpInside]; + + [button setBackgroundImage:selectedImage forState:UIControlStateHighlighted]; + + [itemView addSubview:button]; + } + + if (menuItem.title.length) { + + CGRect titleFrame; + + if (!menuItem.enabled && !menuItem.image) { + + titleFrame = (CGRect){ + kMarginX * 2, + kMarginY, + maxItemWidth - kMarginX * 4, + maxItemHeight - kMarginY * 2 + }; + + } else { + + titleFrame = (CGRect){ + titleX, + kMarginY, + titleWidth, + maxItemHeight - kMarginY * 2 + }; + } + + UILabel *titleLabel = [[UILabel alloc] initWithFrame:titleFrame]; + titleLabel.text = menuItem.title; + titleLabel.font = titleFont; + titleLabel.textAlignment = menuItem.alignment; + titleLabel.textColor = menuItem.foreColor ? menuItem.foreColor : [UIColor whiteColor]; + titleLabel.backgroundColor = [UIColor clearColor]; + titleLabel.autoresizingMask = UIViewAutoresizingNone; + //titleLabel.backgroundColor = [UIColor greenColor]; + [itemView addSubview:titleLabel]; + } + + if (menuItem.image) { + + const CGRect imageFrame = {kMarginX * 2, kMarginY, maxImageWidth, maxItemHeight - kMarginY * 2}; + UIImageView *imageView = [[UIImageView alloc] initWithFrame:imageFrame]; + imageView.image = menuItem.image; + imageView.clipsToBounds = YES; + imageView.contentMode = UIViewContentModeCenter; + imageView.autoresizingMask = UIViewAutoresizingNone; + [itemView addSubview:imageView]; + } + + if (itemNum < _menuItems.count - 1) { + + UIImageView *gradientView = [[UIImageView alloc] initWithImage:gradientLine]; +// gradientView.frame = (CGRect){kMarginX * 2, maxItemHeight + 1, gradientLine.size}; + + //修改 + gradientView.frame = (CGRect){0, maxItemHeight + 1, gradientLine.size.width*1.46, gradientLine.size.height*0.5}; + + gradientView.contentMode = UIViewContentModeLeft; + [itemView addSubview:gradientView]; + + //新加 + gradientView.backgroundColor = [UIColor blackColor]; + gradientView.alpha = 0.1; + itemY += 2; + } + + itemY += maxItemHeight; + ++itemNum; + } + + contentView.frame = (CGRect){0, 0, maxItemWidth, itemY + kMarginY * 2}; + + return contentView; +} + +- (CGPoint) arrowPoint +{ + CGPoint point; + + if (_arrowDirection == KxMenuViewArrowDirectionUp) { + + point = (CGPoint){ CGRectGetMinX(self.frame) + _arrowPosition, CGRectGetMinY(self.frame) }; + + } else if (_arrowDirection == KxMenuViewArrowDirectionDown) { + + point = (CGPoint){ CGRectGetMinX(self.frame) + _arrowPosition, CGRectGetMaxY(self.frame) }; + + } else if (_arrowDirection == KxMenuViewArrowDirectionLeft) { + + point = (CGPoint){ CGRectGetMinX(self.frame), CGRectGetMinY(self.frame) + _arrowPosition }; + + } else if (_arrowDirection == KxMenuViewArrowDirectionRight) { + + point = (CGPoint){ CGRectGetMaxX(self.frame), CGRectGetMinY(self.frame) + _arrowPosition }; + + } else { + + point = self.center; + } + + return point; +} + ++ (UIImage *) selectedImage: (CGSize) size +{ + const CGFloat locations[] = {0,1}; + const CGFloat components[] = { + 0.216, 0.471, 0.871, 1, + 0.059, 0.353, 0.839, 1, + }; + + return [self gradientImageWithSize:size locations:locations components:components count:2]; +} + ++ (UIImage *) gradientLine: (CGSize) size +{ + const CGFloat locations[5] = {0,0.2,0.5,0.8,1}; + + const CGFloat R = 0.44f, G = 0.44f, B = 0.44f; + + const CGFloat components[20] = { + R,G,B,0.1, + R,G,B,0.4, + R,G,B,0.7, + R,G,B,0.4, + R,G,B,0.1 + }; + + return [self gradientImageWithSize:size locations:locations components:components count:5]; +} + ++ (UIImage *) gradientImageWithSize:(CGSize) size + locations:(const CGFloat []) locations + components:(const CGFloat []) components + count:(NSUInteger)count +{ + + UIGraphicsBeginImageContextWithOptions(size, NO, 0); + CGContextRef context = UIGraphicsGetCurrentContext(); + + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGGradientRef colorGradient = CGGradientCreateWithColorComponents(colorSpace, components, locations, 2); + [[UIColor whiteColor]set]; + CGColorSpaceRelease(colorSpace); + CGContextDrawLinearGradient(context, colorGradient, (CGPoint){0, 0}, (CGPoint){0, 0}, 0); + CGGradientRelease(colorGradient); + + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return image; +} + +- (void) drawRect:(CGRect)rect +{ + [self drawBackground:self.bounds + inContext:UIGraphicsGetCurrentContext()]; +} + +- (void)drawBackground:(CGRect)frame + inContext:(CGContextRef) context +{ + CGFloat R0 = 0.267, G0 = 0.303, B0 = 0.335; + CGFloat R1 = 0.040, G1 = 0.040, B1 = 0.040; + + UIColor *tintColor = [KxMenu tintColor]; + if (tintColor) { + + CGFloat a; + [tintColor getRed:&R0 green:&G0 blue:&B0 alpha:&a]; + } + + CGFloat X0 = frame.origin.x; + CGFloat X1 = frame.origin.x + frame.size.width; + CGFloat Y0 = frame.origin.y; + CGFloat Y1 = frame.origin.y + frame.size.height; + + // render arrow + + UIBezierPath *arrowPath = [UIBezierPath bezierPath]; + + // fix the issue with gap of arrow's base if on the edge + const CGFloat kEmbedFix = 3.f; + + if (_arrowDirection == KxMenuViewArrowDirectionUp) { + + const CGFloat arrowXM = _arrowPosition; + const CGFloat arrowX0 = arrowXM - kArrowSize; + const CGFloat arrowX1 = arrowXM + kArrowSize; + const CGFloat arrowY0 = Y0; + const CGFloat arrowY1 = Y0 + kArrowSize + kEmbedFix; + + [arrowPath moveToPoint: (CGPoint){arrowXM, arrowY0}]; + [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY1}]; + [arrowPath addLineToPoint: (CGPoint){arrowX0, arrowY1}]; + [arrowPath addLineToPoint: (CGPoint){arrowXM, arrowY0}]; + + [[UIColor colorWithRed:R0 green:G0 blue:B0 alpha:1] set]; + + Y0 += kArrowSize; + + } else if (_arrowDirection == KxMenuViewArrowDirectionDown) { + + const CGFloat arrowXM = _arrowPosition; + const CGFloat arrowX0 = arrowXM - kArrowSize; + const CGFloat arrowX1 = arrowXM + kArrowSize; + const CGFloat arrowY0 = Y1 - kArrowSize - kEmbedFix; + const CGFloat arrowY1 = Y1; + + [arrowPath moveToPoint: (CGPoint){arrowXM, arrowY1}]; + [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY0}]; + [arrowPath addLineToPoint: (CGPoint){arrowX0, arrowY0}]; + [arrowPath addLineToPoint: (CGPoint){arrowXM, arrowY1}]; + + [[UIColor colorWithRed:R1 green:G1 blue:B1 alpha:1] set]; + + Y1 -= kArrowSize; + + } else if (_arrowDirection == KxMenuViewArrowDirectionLeft) { + + const CGFloat arrowYM = _arrowPosition; + const CGFloat arrowX0 = X0; + const CGFloat arrowX1 = X0 + kArrowSize + kEmbedFix; + const CGFloat arrowY0 = arrowYM - kArrowSize;; + const CGFloat arrowY1 = arrowYM + kArrowSize; + + [arrowPath moveToPoint: (CGPoint){arrowX0, arrowYM}]; + [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY0}]; + [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY1}]; + [arrowPath addLineToPoint: (CGPoint){arrowX0, arrowYM}]; + + [[UIColor colorWithRed:R0 green:G0 blue:B0 alpha:1] set]; + + X0 += kArrowSize; + + } else if (_arrowDirection == KxMenuViewArrowDirectionRight) { + + const CGFloat arrowYM = _arrowPosition; + const CGFloat arrowX0 = X1; + const CGFloat arrowX1 = X1 - kArrowSize - kEmbedFix; + const CGFloat arrowY0 = arrowYM - kArrowSize;; + const CGFloat arrowY1 = arrowYM + kArrowSize; + + [arrowPath moveToPoint: (CGPoint){arrowX0, arrowYM}]; + [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY0}]; + [arrowPath addLineToPoint: (CGPoint){arrowX1, arrowY1}]; + [arrowPath addLineToPoint: (CGPoint){arrowX0, arrowYM}]; + + [[UIColor colorWithRed:R1 green:G1 blue:B1 alpha:1] set]; + + X1 -= kArrowSize; + } + + [arrowPath fill]; + + // render body + + const CGRect bodyFrame = {X0, Y0, X1 - X0, Y1 - Y0}; + + UIBezierPath *borderPath = [UIBezierPath bezierPathWithRoundedRect:bodyFrame + cornerRadius:8]; + + const CGFloat locations[] = {0, 1}; + const CGFloat components[] = { + R0, G0, B0, 1, + R1, G1, B1, 1, + }; + + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGGradientRef gradient = CGGradientCreateWithColorComponents(colorSpace, + components, + locations, + sizeof(locations)/sizeof(locations[0])); + CGColorSpaceRelease(colorSpace); + + + [borderPath addClip]; + + CGPoint start, end; + + if (_arrowDirection == KxMenuViewArrowDirectionLeft || + _arrowDirection == KxMenuViewArrowDirectionRight) { + + start = (CGPoint){X0, Y0}; + end = (CGPoint){X1, Y0}; + + } else { + + start = (CGPoint){X0, Y0}; + end = (CGPoint){X0, Y1}; + } + + CGContextDrawLinearGradient(context, gradient, start, end, 0); + + CGGradientRelease(gradient); +} + +@end + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +static KxMenu *gMenu; +static UIColor *gTintColor; +static UIFont *gTitleFont; + +@implementation KxMenu { + + KxMenuView *_menuView; + BOOL _observing; +} + ++ (instancetype) sharedMenu +{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + + gMenu = [[KxMenu alloc] init]; + }); + return gMenu; +} + +- (id) init +{ + NSAssert(!gMenu, @"singleton object"); + + self = [super init]; + if (self) { + } + return self; +} + +- (void) dealloc +{ + if (_observing) { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + } +} + +- (void) showMenuInView:(UIView *)view + fromRect:(CGRect)rect + menuItems:(NSArray *)menuItems +{ + NSParameterAssert(view); + NSParameterAssert(menuItems.count); + + if (_menuView) { + + [_menuView dismissMenu:NO]; + _menuView = nil; + } + + if (!_observing) { + + _observing = YES; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(orientationWillChange:) + name:UIApplicationWillChangeStatusBarOrientationNotification + object:nil]; + } + + + _menuView = [[KxMenuView alloc] init]; + [_menuView showMenuInView:view fromRect:rect menuItems:menuItems]; +} + +- (void) dismissMenu +{ + if (_menuView) { + + [_menuView dismissMenu:NO]; + _menuView = nil; + } + + if (_observing) { + + _observing = NO; + [[NSNotificationCenter defaultCenter] removeObserver:self]; + } +} + +- (void) orientationWillChange: (NSNotification *) n +{ + [self dismissMenu]; +} + ++ (void) showMenuInView:(UIView *)view + fromRect:(CGRect)rect + menuItems:(NSArray *)menuItems +{ + [[self sharedMenu] showMenuInView:view fromRect:rect menuItems:menuItems]; +} + ++ (void) dismissMenu +{ + [[self sharedMenu] dismissMenu]; +} + ++ (UIColor *) tintColor +{ + return gTintColor; +} + ++ (void) setTintColor: (UIColor *) tintColor +{ + if (tintColor != gTintColor) { + gTintColor = tintColor; + } +} + ++ (UIFont *) titleFont +{ + return gTitleFont; +} + ++ (void) setTitleFont: (UIFont *) titleFont +{ + if (titleFont != gTitleFont) { + gTitleFont = titleFont; + } +} + +@end diff --git a/Pods/Target Support Files/Pods-LJHY_User/Base/Common.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/Base/Common.xcconfig new file mode 100644 index 0000000..da94f2a --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/Base/Common.xcconfig @@ -0,0 +1,235 @@ +// +// This file defines common settings that should be enabled for every new +// project. Typically, you want to use Debug, Release, or a similar variant +// instead. +// + + + +// github :https://github.com/jspahrsummers/xcconfigs + + +// 教程:http://www.cnblogs.com/Jenaral/p/5661572.html + + + +// ---------------------------------项目管理基本配置------------------------------- + + +//app 发版版本 +APP_VERSION = 1.1 + + +// 编译版本 +APP_BUILD_VERSION = 10 + +//app 名字 +APP_NAME = Demo + + +// bundle ID +APP_BUNDLEIDENTIFIER = com.yixiaohu.yixiao + + + + +// ---------------------------------编译配置------------------------------- + +// +//// Disable legacy-compatible header searching +//ALWAYS_SEARCH_USER_PATHS = NO +// +//// Architectures to build +//ARCHS = $(ARCHS_STANDARD) +// +//// Whether to warn when a floating-point value is used as a loop counter +//CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES +// +//// Whether to warn about use of rand() and random() being used instead of arc4random() +//CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES +// +//// Whether to warn about strcpy() and strcat() +//CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES +// +//// Whether to enable module imports +//CLANG_ENABLE_MODULES = YES +// +//// Enable ARC +//CLANG_ENABLE_OBJC_ARC = YES +// +//// Warn about implicit conversions to boolean values that are suspicious. +//// For example, writing 'if (foo)' with 'foo' being the name a function will trigger a warning. +//CLANG_WARN_BOOL_CONVERSION = YES +// +//// Warn about implicit conversions of constant values that cause the constant value to change, +//// either through a loss of precision, or entirely in its meaning. +//CLANG_WARN_CONSTANT_CONVERSION = YES +// +//// Whether to warn when overriding deprecated methods +//CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES +// +//// Warn about direct accesses to the Objective-C 'isa' pointer instead of using a runtime API. +//CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR +// +//// Warn about declaring the same method more than once within the same @interface. +//CLANG_WARN__DUPLICATE_METHOD_MATCH = YES +// +//// Warn about loop bodies that are suspiciously empty. +//CLANG_WARN_EMPTY_BODY = YES +// +//// Warn about implicit conversions between different kinds of enum values. +//// For example, this can catch issues when using the wrong enum flag as an argument to a function or method. +//CLANG_WARN_ENUM_CONVERSION = YES +// +//// Whether to warn on implicit conversions between signed/unsigned types +//CLANG_WARN_IMPLICIT_SIGN_CONVERSION = NO +// +//// Warn about implicit conversions between pointers and integers. +//// For example, this can catch issues when one incorrectly intermixes using NSNumbers and raw integers. +//CLANG_WARN_INT_CONVERSION = YES +// +//// Warn about implicit capture of self (e.g. direct ivar access) +//CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES +// +//// Don't warn about repeatedly using a weak reference without assigning the weak reference to a strong reference. Too many false positives. +//CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = NO +// +//// Warn about classes that unintentionally do not subclass a root class (such as NSObject). +//CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR +// +//// Whether to warn on suspicious implicit conversions +//CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES +// +//// Warn about incorrect uses of nullable values +//CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION = YES +// +//// Warn for missing nullability attributes +//CLANG_ANALYZER_NONNULL = YES +// +//// Warn when a non-localized string is passed to a user-interface method expecting a localized string +//CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES +// +//// Warn about potentially unreachable code +//CLANG_WARN_UNREACHABLE_CODE = YES +// +//// The format of debugging symbols +//DEBUG_INFORMATION_FORMAT = dwarf-with-dsym +// +//// Whether to compile assertions in +//ENABLE_NS_ASSERTIONS = YES +// +//// Whether to require objc_msgSend to be cast before invocation +//ENABLE_STRICT_OBJC_MSGSEND = YES +// +//// Which C variant to use +//GCC_C_LANGUAGE_STANDARD = gnu99 +// +//// Whether to enable exceptions for Objective-C +//GCC_ENABLE_OBJC_EXCEPTIONS = YES +// +//// Whether to generate debugging symbols +//GCC_GENERATE_DEBUGGING_SYMBOLS = YES +// +//// Whether to precompile the prefix header (if one is specified) +//GCC_PRECOMPILE_PREFIX_HEADER = YES +// +//// Whether to enable strict aliasing, meaning that two pointers of different +//// types (other than void * or any id type) cannot point to the same memory +//// location +//GCC_STRICT_ALIASING = YES +// +//// Whether symbols not explicitly exported are hidden by default (this primarily +//// only affects C++ code) +//GCC_SYMBOLS_PRIVATE_EXTERN = NO +// +//// Whether static variables are thread-safe by default +//GCC_THREADSAFE_STATICS = NO +// +//// Which compiler to use +//GCC_VERSION = com.apple.compilers.llvm.clang.1_0 +// +//// Whether warnings are treated as errors +//GCC_TREAT_WARNINGS_AS_ERRORS = YES +//SWIFT_TREAT_WARNINGS_AS_ERRORS = YES +// +//// Whether to warn about 64-bit values being implicitly shortened to 32 bits +//GCC_WARN_64_TO_32_BIT_CONVERSION = YES +// +//// Whether to warn about fields missing from structure initializers (only if +//// designated initializers aren't used) +//GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES +// +//// Whether to warn about missing function prototypes +//GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO +// +//// Whether to warn about implicit conversions in the signedness of the type +//// a pointer is pointing to (e.g., 'int *' getting converted to 'unsigned int *') +//GCC_WARN_ABOUT_POINTER_SIGNEDNESS = YES +// +//// Whether to warn when the value returned from a function/method/block does not +//// match its return type +//GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR +// +//// Whether to warn on a class not implementing all the required methods of +//// a protocol it declares conformance to +//GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = YES +// +//// Whether to warn when switching on an enum value, and all possibilities are +//// not accounted for +//GCC_WARN_CHECK_SWITCH_STATEMENTS = YES +// +//// Whether to warn about the use of four-character constants +//GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES +// +//// Whether to warn about an aggregate data type's initializer not being fully +//// bracketed (e.g., array initializer syntax) +//GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES +// +//// Whether to warn about missing braces or parentheses that make the meaning of +//// the code ambiguous +//GCC_WARN_MISSING_PARENTHESES = YES +// +//// Whether to warn about unsafe comparisons between values of different +//// signedness +//GCC_WARN_SIGN_COMPARE = YES +// +//// Whether to warn about the arguments to printf-style functions not matching +//// the format specifiers +//GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES +// +//// Warn if a "@selector(...)" expression referring to an undeclared selector is found +//GCC_WARN_UNDECLARED_SELECTOR = YES +// +//// Warn if a variable might be clobbered by a setjmp call or if an automatic variable is used without prior initialization. +//GCC_WARN_UNINITIALIZED_AUTOS = YES +// +//// Whether to warn about static functions that are unused +//GCC_WARN_UNUSED_FUNCTION = YES +// +//// Whether to warn about labels that are unused +//GCC_WARN_UNUSED_LABEL = YES +// +//// Whether to warn about variables that are never used +//GCC_WARN_UNUSED_VARIABLE = YES +// +//// Whether to run the static analyzer with every build +//RUN_CLANG_STATIC_ANALYZER = YES +// +//// Don't treat unknown warnings as errors, and disable GCC compatibility warnings and unused static const variable warnings +//WARNING_CFLAGS = -Wno-error=unknown-warning-option -Wno-gcc-compat -Wno-unused-const-variable +// +//// This setting is on for new projects as of Xcode ~6.3, though it is still not +//// the default. It warns if the same variable is declared in two binaries that +//// are linked together. +//GCC_NO_COMMON_BLOCKS = YES +// +//// This warnings detects when a function will recursively call itself on every +//// code path though that function. More information can be found here: +//// http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20131216/096004.html +//CLANG_WARN_INFINITE_RECURSION = YES +// +//// This warning detects suspicious uses of std::move. +//CLANG_WARN_SUSPICIOUS_MOVE = YES +// +// + diff --git a/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Debug.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Debug.xcconfig new file mode 100644 index 0000000..a5911f6 --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Debug.xcconfig @@ -0,0 +1,51 @@ +// +// This file defines the base configuration for a Debug build of any project. +// This should be set at the project level for the Debug configuration. +// + +#include "../Common.xcconfig" + +// Whether to strip debugging symbols when copying resources (like included +// binaries) +COPY_PHASE_STRIP = NO + +// The optimization level (0, 1, 2, 3, s) for the produced binary +GCC_OPTIMIZATION_LEVEL = 0 + +// Preproccessor definitions to apply to each file compiled +GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 + +// Allow @testable imports +ENABLE_TESTABILITY = YES + +// Whether to enable link-time optimizations (such as inlining across translation +// units) +LLVM_LTO = NO + +// Whether to only build the active architecture +ONLY_ACTIVE_ARCH = YES + +// Other compiler flags +// +// These settings catch some errors in integer arithmetic +OTHER_CFLAGS = -ftrapv + +// Other flags to pass to the Swift compiler +// +// This enables conditional compilation with #if DEBUG +OTHER_SWIFT_FLAGS = -D DEBUG + +// Xcode 8 introduced a new flag for conditional compilation +// +// This enables conditional compilation with #if DEBUG +SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG + +// Whether to strip debugging symbols when copying the built product to its +// final installation location +STRIP_INSTALLED_PRODUCT = NO + +// The optimization level (-Onone, -O, -Ofast) for the produced Swift binary +SWIFT_OPTIMIZATION_LEVEL = -Onone + +// Disable Developer ID timestamping +OTHER_CODE_SIGN_FLAGS = --timestamp=none diff --git a/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Profile.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Profile.xcconfig new file mode 100644 index 0000000..0d01553 --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Profile.xcconfig @@ -0,0 +1,27 @@ +// +// This file defines the base configuration for an optional profiling-specific +// build of any project. To use these settings, create a Profile configuration +// in your project, and use this file at the project level for the new +// configuration. +// + +// based on the Release configuration, with some stuff related to debugging +// symbols re-enabled +#include "Release.xcconfig" + +// Whether to strip debugging symbols when copying resources (like included +// binaries) +COPY_PHASE_STRIP = NO + +// Whether to only build the active architecture +ONLY_ACTIVE_ARCH = YES + +// Whether to strip debugging symbols when copying the built product to its +// final installation location +STRIP_INSTALLED_PRODUCT = NO + +// Whether to perform App Store validation checks +VALIDATE_PRODUCT = NO + +// Disable Developer ID timestamping +OTHER_CODE_SIGN_FLAGS = --timestamp=none diff --git a/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Release.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Release.xcconfig new file mode 100644 index 0000000..c83729b --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Release.xcconfig @@ -0,0 +1,34 @@ +// +// This file defines the base configuration for a Release build of any project. +// This should be set at the project level for the Release configuration. +// + +#include "../Common.xcconfig" + +// Whether to strip debugging symbols when copying resources (like included +// binaries) +COPY_PHASE_STRIP = YES + +// The optimization level (0, 1, 2, 3, s) for the produced binary +GCC_OPTIMIZATION_LEVEL = s + +// Preproccessor definitions to apply to each file compiled +GCC_PREPROCESSOR_DEFINITIONS = NDEBUG=1 + +// Whether to enable link-time optimizations (such as inlining across translation +// units) +LLVM_LTO = NO + +// Whether to only build the active architecture +ONLY_ACTIVE_ARCH = NO + +// Whether to strip debugging symbols when copying the built product to its +// final installation location +STRIP_INSTALLED_PRODUCT = YES + +// The optimization level (-Onone, -O, -Owholemodule) for the produced Swift binary +SWIFT_OPTIMIZATION_LEVEL = -Owholemodule + +// Whether to perform App Store validation checks +VALIDATE_PRODUCT = YES + diff --git a/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Test.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Test.xcconfig new file mode 100644 index 0000000..bf17949 --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/Base/Configurations/Test.xcconfig @@ -0,0 +1,13 @@ +// +// This file defines the base configuration for a Test build of any project. +// This should be set at the project level for the Test configuration. +// + +#include "Debug.xcconfig" + +// Sandboxed apps can't be unit tested since they can't load some random +// external bundle. So we disable sandboxing for testing. +CODE_SIGN_ENTITLEMENTS = + +// Allow @testable imports +ENABLE_TESTABILITY = YES diff --git a/Pods/Target Support Files/Pods-LJHY_User/Base/Targets/Application.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/Base/Targets/Application.xcconfig new file mode 100644 index 0000000..a91feca --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/Base/Targets/Application.xcconfig @@ -0,0 +1,12 @@ +// +// This file defines additional configuration options that are appropriate only +// for an application. Typically, you want to use a platform-specific variant +// instead. +// + +// Whether to strip out code that isn't called from anywhere +DEAD_CODE_STRIPPING = NO + +// Sets the @rpath for the application such that it can include frameworks in +// the application bundle (inside the "Frameworks" folder) +LD_RUNPATH_SEARCH_PATHS = @executable_path/../Frameworks @loader_path/../Frameworks @executable_path/Frameworks diff --git a/Pods/Target Support Files/Pods-LJHY_User/Base/Targets/Framework.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/Base/Targets/Framework.xcconfig new file mode 100644 index 0000000..c92f57f --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/Base/Targets/Framework.xcconfig @@ -0,0 +1,37 @@ +// +// This file defines additional configuration options that are appropriate only +// for a framework. Typically, you want to use a platform-specific variant +// instead. +// + +// Disable code signing for successful device builds with Xcode 8. Frameworks do +// need to be signed, but they don't need to be signed at compile time because +// they'll be re-signed when you include them in your app. +CODE_SIGNING_REQUIRED = NO +CODE_SIGN_IDENTITY = + +// Whether to strip out code that isn't called from anywhere +DEAD_CODE_STRIPPING = NO + +// Whether this framework should define an LLVM module +DEFINES_MODULE = YES + +// Whether function calls should be position-dependent (should always be +// disabled for library code) +GCC_DYNAMIC_NO_PIC = NO + +// Default frameworks to the name of the project, instead of any +// platform-specific target +PRODUCT_NAME = $(PROJECT_NAME) + +// Enables the framework to be included from any location as long as the +// loader’s runpath search paths includes it. For example from an application +// bundle (inside the "Frameworks" folder) or shared folder +INSTALL_PATH = @rpath +LD_DYLIB_INSTALL_NAME = @rpath/$(PRODUCT_NAME).$(WRAPPER_EXTENSION)/$(PRODUCT_NAME) +SKIP_INSTALL = YES + +// Disallows use of APIs that are not available +// to app extensions and linking to frameworks +// that have not been built with this setting enabled. +APPLICATION_EXTENSION_API_ONLY = YES diff --git a/Pods/Target Support Files/Pods-LJHY_User/Base/Targets/StaticLibrary.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/Base/Targets/StaticLibrary.xcconfig new file mode 100644 index 0000000..b3b2b87 --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/Base/Targets/StaticLibrary.xcconfig @@ -0,0 +1,32 @@ +// +// This file defines additional configuration options that are appropriate only +// for a static library. Typically, you want to use a platform-specific variant +// instead. +// + +// Whether to strip out code that isn't called from anywhere +DEAD_CODE_STRIPPING = NO + +// Whether to strip debugging symbols when copying resources (like included +// binaries). +// +// Overrides Release.xcconfig when used at the target level. +COPY_PHASE_STRIP = NO + +// Whether function calls should be position-dependent (should always be +// disabled for library code) +GCC_DYNAMIC_NO_PIC = NO + +// Copy headers to "include/LibraryName" in the build folder by default. This +// lets consumers use #import syntax even for static +// libraries +PUBLIC_HEADERS_FOLDER_PATH = include/$PRODUCT_NAME + +// Don't include in an xcarchive +SKIP_INSTALL = YES + +// Disallows use of APIs that are not available +// to app extensions and linking to frameworks +// that have not been built with this setting enabled. +APPLICATION_EXTENSION_API_ONLY = YES + diff --git a/Pods/Target Support Files/Pods-LJHY_User/Pods-LJHY_User.debug.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/Pods-LJHY_User.debug.xcconfig index b61c3c6..d612d04 100644 --- a/Pods/Target Support Files/Pods-LJHY_User/Pods-LJHY_User.debug.xcconfig +++ b/Pods/Target Support Files/Pods-LJHY_User/Pods-LJHY_User.debug.xcconfig @@ -1,3 +1,29 @@ + + + +#include "./Base/Common.xcconfig" + +////app 发版版本 +//APP_VERSION = 1.1 +// +// +//// 编译版本 +//APP_BUILD_VERSION = 10 + +//app 名字 +APP_NAME = 模版app debug +// +// +//// bundle ID +//APP_BUNDLEIDENTIFIER = com.yixiaohu.yixiao +// +// + + + + + + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/CTMediator" "$PODS_CONFIGURATION_BUILD_DIR/DateTools" "$PODS_CONFIGURATION_BUILD_DIR/IQKeyboardManager" "$PODS_CONFIGURATION_BUILD_DIR/LJHY_OrderModule" "$PODS_CONFIGURATION_BUILD_DIR/MJExtension" "$PODS_CONFIGURATION_BUILD_DIR/ReactiveObjC" "$PODS_CONFIGURATION_BUILD_DIR/SDAutoLayout" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" "$PODS_CONFIGURATION_BUILD_DIR/SVProgressHUD" "$PODS_CONFIGURATION_BUILD_DIR/Toast" "$PODS_CONFIGURATION_BUILD_DIR/YTKNetwork" GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 diff --git a/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-Application.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-Application.xcconfig new file mode 100644 index 0000000..a700868 --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-Application.xcconfig @@ -0,0 +1,11 @@ +// +// This file defines additional configuration options that are appropriate only +// for an application on iOS. This should be set at the target level for each +// project configuration. +// + +// Import base application settings +#include "../Base/Targets/Application.xcconfig" + +// Apply common settings specific to iOS +#include "iOS-Base.xcconfig" diff --git a/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-Base.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-Base.xcconfig new file mode 100644 index 0000000..f45f905 --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-Base.xcconfig @@ -0,0 +1,18 @@ +// +// This file defines additional configuration options that are appropriate only +// for iOS. This file is not standalone -- it is meant to be included into +// a configuration file for a specific type of target. +// + +// Xcode needs this to find archived headers if SKIP_INSTALL is set +HEADER_SEARCH_PATHS = $(OBJROOT)/UninstalledProducts/include + +// Where to find embedded frameworks +LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks + +// The base SDK to use (if no version is specified, the latest version is +// assumed) +SDKROOT = iphoneos + +// Supported device families (1 is iPhone, 2 is iPad) +TARGETED_DEVICE_FAMILY = 1,2 diff --git a/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-Framework.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-Framework.xcconfig new file mode 100644 index 0000000..e538a7d --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-Framework.xcconfig @@ -0,0 +1,11 @@ +// +// This file defines additional configuration options that are appropriate only +// for a framework on iOS. This should be set at the target level for each +// project configuration. +// + +// Import base framework settings +#include "../Base/Targets/Framework.xcconfig" + +// Import common settings specific to iOS +#include "iOS-Base.xcconfig" diff --git a/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-StaticLibrary.xcconfig b/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-StaticLibrary.xcconfig new file mode 100644 index 0000000..7e3b507 --- /dev/null +++ b/Pods/Target Support Files/Pods-LJHY_User/iOS/iOS-StaticLibrary.xcconfig @@ -0,0 +1,11 @@ +// +// This file defines additional configuration options that are appropriate only +// for a static library on iOS. This should be set at the target level for each +// project configuration. +// + +// Import base static library settings +#include "../Base/Targets/StaticLibrary.xcconfig" + +// Apply common settings specific to iOS +#include "iOS-Base.xcconfig" diff --git a/test.m b/test.m new file mode 100644 index 0000000..4093a12 --- /dev/null +++ b/test.m @@ -0,0 +1 @@ +this is a pull request file