apple %!s(int64=5) %!d(string=hai) anos
pai
achega
517b37cac3

+ 32 - 0
ios/JianYuIOS/JianYuIOS.xcodeproj/project.pbxproj

@@ -9,6 +9,10 @@
 /* Begin PBXBuildFile section */
 		182ECCFB22FD221100FFC79E /* qidongye@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 182ECCFA22FD221000FFC79E /* qidongye@2x.png */; };
 		182ECCFD22FD223A00FFC79E /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 182ECCFC22FD223A00FFC79E /* logo.png */; };
+		184EC6532435B39200CA89F0 /* ZKGuideView.m in Sources */ = {isa = PBXBuildFile; fileRef = 184EC6522435B39200CA89F0 /* ZKGuideView.m */; };
+		184EC6592435B93600CA89F0 /* ZKControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 184EC6572435B93600CA89F0 /* ZKControl.m */; };
+		184EC6632435BA1D00CA89F0 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 184EC6612435BA1D00CA89F0 /* Reachability.m */; };
+		184EC6662435C45C00CA89F0 /* ZKMethod.m in Sources */ = {isa = PBXBuildFile; fileRef = 184EC6652435C45C00CA89F0 /* ZKMethod.m */; };
 		185F510A23A76765009F9022 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 185F510923A76765009F9022 /* CoreLocation.framework */; };
 		1876C3FC219920DE00BC23DE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1876C3FB219920DE00BC23DE /* ViewController.m */; };
 		187B4EE321EC356100A9368D /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 187B4EE221EC356100A9368D /* UIView+Extension.m */; };
@@ -85,6 +89,14 @@
 		10D9BC27D00CB4DF3F791728 /* Pods-JianYuIOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JianYuIOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS.release.xcconfig"; sourceTree = "<group>"; };
 		182ECCFA22FD221000FFC79E /* qidongye@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "qidongye@2x.png"; sourceTree = "<group>"; };
 		182ECCFC22FD223A00FFC79E /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = "<group>"; };
+		184EC6512435B39200CA89F0 /* ZKGuideView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZKGuideView.h; sourceTree = "<group>"; };
+		184EC6522435B39200CA89F0 /* ZKGuideView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZKGuideView.m; sourceTree = "<group>"; };
+		184EC6572435B93600CA89F0 /* ZKControl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZKControl.m; sourceTree = "<group>"; };
+		184EC6582435B93600CA89F0 /* ZKControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZKControl.h; sourceTree = "<group>"; };
+		184EC6612435BA1D00CA89F0 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; };
+		184EC6622435BA1D00CA89F0 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; };
+		184EC6642435C45C00CA89F0 /* ZKMethod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZKMethod.h; sourceTree = "<group>"; };
+		184EC6652435C45C00CA89F0 /* ZKMethod.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZKMethod.m; sourceTree = "<group>"; };
 		185F510923A76765009F9022 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
 		1876C3FB219920DE00BC23DE /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
 		187B4EE121EC356100A9368D /* UIView+Extension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; };
@@ -214,6 +226,21 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		184EC65D2435B9A300CA89F0 /* guide */ = {
+			isa = PBXGroup;
+			children = (
+				184EC6512435B39200CA89F0 /* ZKGuideView.h */,
+				184EC6522435B39200CA89F0 /* ZKGuideView.m */,
+				184EC6582435B93600CA89F0 /* ZKControl.h */,
+				184EC6572435B93600CA89F0 /* ZKControl.m */,
+				184EC6642435C45C00CA89F0 /* ZKMethod.h */,
+				184EC6652435C45C00CA89F0 /* ZKMethod.m */,
+				184EC6622435BA1D00CA89F0 /* Reachability.h */,
+				184EC6612435BA1D00CA89F0 /* Reachability.m */,
+			);
+			path = guide;
+			sourceTree = "<group>";
+		};
 		188037092193EAD1006F9D7B /* Classes(模块) */ = {
 			isa = PBXGroup;
 			children = (
@@ -366,6 +393,7 @@
 		C5BE6E392011D99100F28B36 /* JianYuIOS */ = {
 			isa = PBXGroup;
 			children = (
+				184EC65D2435B9A300CA89F0 /* guide */,
 				18E05CEF22F11CDD001E5B44 /* Libs(第三方) */,
 				C5321C73202BD8800023CFEA /* CustomView */,
 				C519972120202348007946E8 /* BaseClass1 */,
@@ -617,8 +645,10 @@
 				C555EC282047DC5E0084642F /* LXNetworkManager.m in Sources */,
 				C519972F2020238D007946E8 /* LXDataBaseManager.m in Sources */,
 				187B4EE321EC356100A9368D /* UIView+Extension.m in Sources */,
+				184EC6662435C45C00CA89F0 /* ZKMethod.m in Sources */,
 				C550BEFA20180AF000F0BC2A /* main.m in Sources */,
 				188036FC2193EA09006F9D7B /* JYTabBarController.m in Sources */,
+				184EC6532435B39200CA89F0 /* ZKGuideView.m in Sources */,
 				188036FB2193EA09006F9D7B /* JYNavigationController.m in Sources */,
 				C5321C76202BD89B0023CFEA /* LXProgressView.m in Sources */,
 				C519972C2020238D007946E8 /* LXUserDefaults.m in Sources */,
@@ -627,8 +657,10 @@
 				188037202193EB25006F9D7B /* JYSubViewController.m in Sources */,
 				188037212193EB25006F9D7B /* JYExpViewController.m in Sources */,
 				1880371F2193EB25006F9D7B /* JYMineViewController.m in Sources */,
+				184EC6592435B93600CA89F0 /* ZKControl.m in Sources */,
 				C550BEF920180AF000F0BC2A /* AppDelegate.m in Sources */,
 				187B4EE621EC635700A9368D /* GlobalData.m in Sources */,
+				184EC6632435BA1D00CA89F0 /* Reachability.m in Sources */,
 				1880371E2193EB25006F9D7B /* JYSearchViewController.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

BIN=BIN
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 5 - 2
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -1,15 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Bucket
+   uuid = "3209AFD3-A9DA-4750-983A-195A695CA827"
    type = "0"
    version = "2.0">
    <Breakpoints>
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
          <BreakpointContent
-            shouldBeEnabled = "No"
+            uuid = "C261A683-735F-4C28-A335-B079760E24D7"
+            shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            scope = "0"
+            breakpointStackSelectionBehavior = "1"
+            scope = "1"
             stopOnStyle = "0">
          </BreakpointContent>
       </BreakpointProxy>

+ 11 - 1
ios/JianYuIOS/JianYuIOS/AppDelegate.m

@@ -18,7 +18,7 @@
 #import <UMSocialCore/UMSocialCore.h>
 
 #import "JYTabBarController.h"
-
+#import "ZKGuideView.h"
 
 @interface AppDelegate ()<JPUSHRegisterDelegate,WXApiDelegate,UNUserNotificationCenterDelegate>
 
@@ -38,6 +38,16 @@
     self.window.rootViewController = tabBarVc;
     [self.window makeKeyAndVisible];
     
+    
+    //设置启动页
+    ZKGuideView *guideView = [[ZKGuideView alloc]initWithFrame:self.window.frame];
+    [guideView showView];
+    
+    
+    
+    
+    
+    NSLog(@"初始化");
     [GlobalData shareInstance];
     [LXDataBaseManager shareDataBaseManager];//初始化单例
     [LXViewControllerManager shareViewControllerManager];

+ 21 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/guide.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "guide@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN=BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/guide.imageset/guide@2x.png


+ 8 - 6
ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch

@@ -119,6 +119,9 @@ _Pragma("clang diagnostic pop")\
 //只刷新我的和百宝箱
 #define RefreshExpAndMine @"RefreshExpAndMine"
 
+//渐变色
+#define ColorGradientArray [NSArray arrayWithObjects:(id)UIColorFromRGB(0x094303).CGColor,(id)UIColorFromRGB(0x343d32).CGColor,(id)UIColorFromRGB(0xB2B7B7).CGColor, nil]
+
 
 //微信SDK头文件
 #import "WXApi.h"
@@ -128,10 +131,9 @@ _Pragma("clang diagnostic pop")\
 #import "UIView+Extension.h"
 #import "GlobalData.h"
 #import "UIDevice+Hardware.h"
-
-
-
-
+#import "ZKControl.h"
+#import "ZKMethod.h"
+#import "Reachability.h"
 //#define kHost @"http://web-jydev-ws.jianyu360.cn/" //王山
 
 //#define kHost @"https://web-jydev-wcj.jianyu360.cn/"//王传近
@@ -148,11 +150,11 @@ _Pragma("clang diagnostic pop")\
 
 //#define kHost @"https://app1.jianyu360.com/"//弃用
 
-#define kHost @"https://app2-jytest.jianyu360.cn/" //测试
+//#define kHost @"https://app2-jytest.jianyu360.cn/" //测试
 
 //#define kHost @"https://app-jytest.jianyu360.cn/" //老测试
 
-//#define kHost @"https://res.jianyu360.com/"//正式
+#define kHost @"https://res.jianyu360.com/"//正式
 
 
 /*

+ 102 - 0
ios/JianYuIOS/JianYuIOS/guide/Reachability.h

@@ -0,0 +1,102 @@
+/*
+ Copyright (c) 2011, Tony Million.
+ All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 
+ 1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ 
+ 2. 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 <Foundation/Foundation.h>
+#import <SystemConfiguration/SystemConfiguration.h>
+
+//! Project version number for MacOSReachability.
+FOUNDATION_EXPORT double ReachabilityVersionNumber;
+
+//! Project version string for MacOSReachability.
+FOUNDATION_EXPORT const unsigned char ReachabilityVersionString[];
+
+/** 
+ * Create NS_ENUM macro if it does not exist on the targeted version of iOS or OS X.
+ *
+ * @see http://nshipster.com/ns_enum-ns_options/
+ **/
+#ifndef NS_ENUM
+#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type
+#endif
+
+extern NSString *const kReachabilityChangedNotification;
+
+typedef NS_ENUM(NSInteger, NetworkStatus) {
+    // Apple NetworkStatus Compatible Names.
+    NotReachable = 0,
+    ReachableViaWiFi = 2,
+    ReachableViaWWAN = 1
+};
+
+@class Reachability;
+
+typedef void (^NetworkReachable)(Reachability * reachability);
+typedef void (^NetworkUnreachable)(Reachability * reachability);
+typedef void (^NetworkReachability)(Reachability * reachability, SCNetworkConnectionFlags flags);
+
+
+@interface Reachability : NSObject
+
+@property (nonatomic, copy) NetworkReachable    reachableBlock;
+@property (nonatomic, copy) NetworkUnreachable  unreachableBlock;
+@property (nonatomic, copy) NetworkReachability reachabilityBlock;
+
+@property (nonatomic, assign) BOOL reachableOnWWAN;
+
+
++(instancetype)reachabilityWithHostname:(NSString*)hostname;
+// This is identical to the function above, but is here to maintain
+//compatibility with Apples original code. (see .m)
++(instancetype)reachabilityWithHostName:(NSString*)hostname;
++(instancetype)reachabilityForInternetConnection;
++(instancetype)reachabilityWithAddress:(void *)hostAddress;
++(instancetype)reachabilityForLocalWiFi;
+
+-(instancetype)initWithReachabilityRef:(SCNetworkReachabilityRef)ref;
+
+-(BOOL)startNotifier;
+-(void)stopNotifier;
+
+-(BOOL)isReachable;
+-(BOOL)isReachableViaWWAN;
+-(BOOL)isReachableViaWiFi;
+
+// WWAN may be available, but not active until a connection has been established.
+// WiFi may require a connection for VPN on Demand.
+-(BOOL)isConnectionRequired; // Identical DDG variant.
+-(BOOL)connectionRequired; // Apple's routine.
+// Dynamic, on demand connection?
+-(BOOL)isConnectionOnDemand;
+// Is user intervention required?
+-(BOOL)isInterventionRequired;
+
+-(NetworkStatus)currentReachabilityStatus;
+-(SCNetworkReachabilityFlags)reachabilityFlags;
+-(NSString*)currentReachabilityString;
+-(NSString*)currentReachabilityFlags;
+
+@end

+ 475 - 0
ios/JianYuIOS/JianYuIOS/guide/Reachability.m

@@ -0,0 +1,475 @@
+/*
+ Copyright (c) 2011, Tony Million.
+ All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+ 
+ 1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ 
+ 2. 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 "Reachability.h"
+
+#import <sys/socket.h>
+#import <netinet/in.h>
+#import <netinet6/in6.h>
+#import <arpa/inet.h>
+#import <ifaddrs.h>
+#import <netdb.h>
+
+
+NSString *const kReachabilityChangedNotification = @"kReachabilityChangedNotification";
+
+
+@interface Reachability ()
+
+@property (nonatomic, assign) SCNetworkReachabilityRef  reachabilityRef;
+@property (nonatomic, strong) dispatch_queue_t          reachabilitySerialQueue;
+@property (nonatomic, strong) id                        reachabilityObject;
+
+-(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags;
+-(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags;
+
+@end
+
+
+static NSString *reachabilityFlags(SCNetworkReachabilityFlags flags) 
+{
+    return [NSString stringWithFormat:@"%c%c %c%c%c%c%c%c%c",
+#if	TARGET_OS_IPHONE
+            (flags & kSCNetworkReachabilityFlagsIsWWAN)               ? 'W' : '-',
+#else
+            'X',
+#endif
+            (flags & kSCNetworkReachabilityFlagsReachable)            ? 'R' : '-',
+            (flags & kSCNetworkReachabilityFlagsConnectionRequired)   ? 'c' : '-',
+            (flags & kSCNetworkReachabilityFlagsTransientConnection)  ? 't' : '-',
+            (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-',
+            (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic)  ? 'C' : '-',
+            (flags & kSCNetworkReachabilityFlagsConnectionOnDemand)   ? 'D' : '-',
+            (flags & kSCNetworkReachabilityFlagsIsLocalAddress)       ? 'l' : '-',
+            (flags & kSCNetworkReachabilityFlagsIsDirect)             ? 'd' : '-'];
+}
+
+// Start listening for reachability notifications on the current run loop
+static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) 
+{
+#pragma unused (target)
+
+    Reachability *reachability = ((__bridge Reachability*)info);
+
+    // We probably don't need an autoreleasepool here, as GCD docs state each queue has its own autorelease pool,
+    // but what the heck eh?
+    @autoreleasepool 
+    {
+        [reachability reachabilityChanged:flags];
+    }
+}
+
+
+@implementation Reachability
+
+#pragma mark - Class Constructor Methods
+
++(instancetype)reachabilityWithHostName:(NSString*)hostname
+{
+    return [Reachability reachabilityWithHostname:hostname];
+}
+
++(instancetype)reachabilityWithHostname:(NSString*)hostname
+{
+    SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithName(NULL, [hostname UTF8String]);
+    if (ref) 
+    {
+        id reachability = [[self alloc] initWithReachabilityRef:ref];
+
+        return reachability;
+    }
+    
+    return nil;
+}
+
++(instancetype)reachabilityWithAddress:(void *)hostAddress
+{
+    SCNetworkReachabilityRef ref = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr*)hostAddress);
+    if (ref) 
+    {
+        id reachability = [[self alloc] initWithReachabilityRef:ref];
+        
+        return reachability;
+    }
+    
+    return nil;
+}
+
++(instancetype)reachabilityForInternetConnection
+{
+    struct sockaddr_in zeroAddress;
+    bzero(&zeroAddress, sizeof(zeroAddress));
+    zeroAddress.sin_len = sizeof(zeroAddress);
+    zeroAddress.sin_family = AF_INET;
+    
+    return [self reachabilityWithAddress:&zeroAddress];
+}
+
++(instancetype)reachabilityForLocalWiFi
+{
+    struct sockaddr_in localWifiAddress;
+    bzero(&localWifiAddress, sizeof(localWifiAddress));
+    localWifiAddress.sin_len            = sizeof(localWifiAddress);
+    localWifiAddress.sin_family         = AF_INET;
+    // IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0
+    localWifiAddress.sin_addr.s_addr    = htonl(IN_LINKLOCALNETNUM);
+    
+    return [self reachabilityWithAddress:&localWifiAddress];
+}
+
+
+// Initialization methods
+
+-(instancetype)initWithReachabilityRef:(SCNetworkReachabilityRef)ref
+{
+    self = [super init];
+    if (self != nil) 
+    {
+        self.reachableOnWWAN = YES;
+        self.reachabilityRef = ref;
+
+        // We need to create a serial queue.
+        // We allocate this once for the lifetime of the notifier.
+
+        self.reachabilitySerialQueue = dispatch_queue_create("com.tonymillion.reachability", NULL);
+    }
+    
+    return self;    
+}
+
+-(void)dealloc
+{
+    [self stopNotifier];
+
+    if(self.reachabilityRef)
+    {
+        CFRelease(self.reachabilityRef);
+        self.reachabilityRef = nil;
+    }
+
+	self.reachableBlock          = nil;
+    self.unreachableBlock        = nil;
+    self.reachabilityBlock       = nil;
+    self.reachabilitySerialQueue = nil;
+}
+
+#pragma mark - Notifier Methods
+
+// Notifier 
+// NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD
+// - In other words DO NOT DO ANY UI UPDATES IN THE BLOCKS.
+//   INSTEAD USE dispatch_async(dispatch_get_main_queue(), ^{UISTUFF}) (or dispatch_sync if you want)
+
+-(BOOL)startNotifier
+{
+    // allow start notifier to be called multiple times
+    if(self.reachabilityObject && (self.reachabilityObject == self))
+    {
+        return YES;
+    }
+
+
+    SCNetworkReachabilityContext    context = { 0, NULL, NULL, NULL, NULL };
+    context.info = (__bridge void *)self;
+
+    if(SCNetworkReachabilitySetCallback(self.reachabilityRef, TMReachabilityCallback, &context))
+    {
+        // Set it as our reachability queue, which will retain the queue
+        if(SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, self.reachabilitySerialQueue))
+        {
+            // this should do a retain on ourself, so as long as we're in notifier mode we shouldn't disappear out from under ourselves
+            // woah
+            self.reachabilityObject = self;
+            return YES;
+        }
+        else
+        {
+#ifdef DEBUG
+            NSLog(@"SCNetworkReachabilitySetDispatchQueue() failed: %s", SCErrorString(SCError()));
+#endif
+
+            // UH OH - FAILURE - stop any callbacks!
+            SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL);
+        }
+    }
+    else
+    {
+#ifdef DEBUG
+        NSLog(@"SCNetworkReachabilitySetCallback() failed: %s", SCErrorString(SCError()));
+#endif
+    }
+
+    // if we get here we fail at the internet
+    self.reachabilityObject = nil;
+    return NO;
+}
+
+-(void)stopNotifier
+{
+    // First stop, any callbacks!
+    SCNetworkReachabilitySetCallback(self.reachabilityRef, NULL, NULL);
+    
+    // Unregister target from the GCD serial dispatch queue.
+    SCNetworkReachabilitySetDispatchQueue(self.reachabilityRef, NULL);
+
+    self.reachabilityObject = nil;
+}
+
+#pragma mark - reachability tests
+
+// This is for the case where you flick the airplane mode;
+// you end up getting something like this:
+//Reachability: WR ct-----
+//Reachability: -- -------
+//Reachability: WR ct-----
+//Reachability: -- -------
+// We treat this as 4 UNREACHABLE triggers - really apple should do better than this
+
+#define testcase (kSCNetworkReachabilityFlagsConnectionRequired | kSCNetworkReachabilityFlagsTransientConnection)
+
+-(BOOL)isReachableWithFlags:(SCNetworkReachabilityFlags)flags
+{
+    BOOL connectionUP = YES;
+    
+    if(!(flags & kSCNetworkReachabilityFlagsReachable))
+        connectionUP = NO;
+    
+    if( (flags & testcase) == testcase )
+        connectionUP = NO;
+    
+#if	TARGET_OS_IPHONE
+    if(flags & kSCNetworkReachabilityFlagsIsWWAN)
+    {
+        // We're on 3G.
+        if(!self.reachableOnWWAN)
+        {
+            // We don't want to connect when on 3G.
+            connectionUP = NO;
+        }
+    }
+#endif
+    
+    return connectionUP;
+}
+
+-(BOOL)isReachable
+{
+    SCNetworkReachabilityFlags flags;  
+    
+    if(!SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags))
+        return NO;
+    
+    return [self isReachableWithFlags:flags];
+}
+
+-(BOOL)isReachableViaWWAN 
+{
+#if	TARGET_OS_IPHONE
+
+    SCNetworkReachabilityFlags flags = 0;
+    
+    if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags))
+    {
+        // Check we're REACHABLE
+        if(flags & kSCNetworkReachabilityFlagsReachable)
+        {
+            // Now, check we're on WWAN
+            if(flags & kSCNetworkReachabilityFlagsIsWWAN)
+            {
+                return YES;
+            }
+        }
+    }
+#endif
+    
+    return NO;
+}
+
+-(BOOL)isReachableViaWiFi 
+{
+    SCNetworkReachabilityFlags flags = 0;
+    
+    if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags))
+    {
+        // Check we're reachable
+        if((flags & kSCNetworkReachabilityFlagsReachable))
+        {
+#if	TARGET_OS_IPHONE
+            // Check we're NOT on WWAN
+            if((flags & kSCNetworkReachabilityFlagsIsWWAN))
+            {
+                return NO;
+            }
+#endif
+            return YES;
+        }
+    }
+    
+    return NO;
+}
+
+
+// WWAN may be available, but not active until a connection has been established.
+// WiFi may require a connection for VPN on Demand.
+-(BOOL)isConnectionRequired
+{
+    return [self connectionRequired];
+}
+
+-(BOOL)connectionRequired
+{
+    SCNetworkReachabilityFlags flags;
+	
+	if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags))
+    {
+		return (flags & kSCNetworkReachabilityFlagsConnectionRequired);
+	}
+    
+    return NO;
+}
+
+// Dynamic, on demand connection?
+-(BOOL)isConnectionOnDemand
+{
+	SCNetworkReachabilityFlags flags;
+	
+	if (SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags))
+    {
+		return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) &&
+				(flags & (kSCNetworkReachabilityFlagsConnectionOnTraffic | kSCNetworkReachabilityFlagsConnectionOnDemand)));
+	}
+	
+	return NO;
+}
+
+// Is user intervention required?
+-(BOOL)isInterventionRequired
+{
+    SCNetworkReachabilityFlags flags;
+	
+	if (SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags))
+    {
+		return ((flags & kSCNetworkReachabilityFlagsConnectionRequired) &&
+				(flags & kSCNetworkReachabilityFlagsInterventionRequired));
+	}
+	
+	return NO;
+}
+
+
+#pragma mark - reachability status stuff
+
+-(NetworkStatus)currentReachabilityStatus
+{
+    if([self isReachable])
+    {
+        if([self isReachableViaWiFi])
+            return ReachableViaWiFi;
+        
+#if	TARGET_OS_IPHONE
+        return ReachableViaWWAN;
+#endif
+    }
+    
+    return NotReachable;
+}
+
+-(SCNetworkReachabilityFlags)reachabilityFlags
+{
+    SCNetworkReachabilityFlags flags = 0;
+    
+    if(SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) 
+    {
+        return flags;
+    }
+    
+    return 0;
+}
+
+-(NSString*)currentReachabilityString
+{
+	NetworkStatus temp = [self currentReachabilityStatus];
+	
+	if(temp == ReachableViaWWAN)
+	{
+        // Updated for the fact that we have CDMA phones now!
+		return NSLocalizedString(@"Cellular", @"");
+	}
+	if (temp == ReachableViaWiFi) 
+	{
+		return NSLocalizedString(@"WiFi", @"");
+	}
+	
+	return NSLocalizedString(@"No Connection", @"");
+}
+
+-(NSString*)currentReachabilityFlags
+{
+    return reachabilityFlags([self reachabilityFlags]);
+}
+
+#pragma mark - Callback function calls this method
+
+-(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags
+{
+    if([self isReachableWithFlags:flags])
+    {
+        if(self.reachableBlock)
+        {
+            self.reachableBlock(self);
+        }
+    }
+    else
+    {
+        if(self.unreachableBlock)
+        {
+            self.unreachableBlock(self);
+        }
+    }
+    
+    if(self.reachabilityBlock)
+    {
+        self.reachabilityBlock(self, flags);
+    }
+    
+    // this makes sure the change notification happens on the MAIN THREAD
+    dispatch_async(dispatch_get_main_queue(), ^{
+        [[NSNotificationCenter defaultCenter] postNotificationName:kReachabilityChangedNotification 
+                                                            object:self];
+    });
+}
+
+#pragma mark - Debug Description
+
+- (NSString *) description
+{
+    NSString *description = [NSString stringWithFormat:@"<%@: %#x (%@)>",
+                             NSStringFromClass([self class]), (unsigned int) self, [self currentReachabilityFlags]];
+    return description;
+}
+
+@end

+ 59 - 0
ios/JianYuIOS/JianYuIOS/guide/ZKControl.h

@@ -0,0 +1,59 @@
+//
+//  ZKControl.h
+//  zhengkun
+//
+//  Created by 郑坤 on 17/4/24.
+//  Copyright © 2017年 郑坤. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+@interface ZKControl : NSObject
+
+
+
+//创建view
++(UIView*)createViewWithFrame:(CGRect)frame color:(UIColor*)color;
+//创建label
++(UILabel*)createLabelWithFrame:(CGRect)frame font:(float)font text:(NSString*)text TextColor:(UIColor *)textColor bgColor:(UIColor *)bgColor;
++(UILabel*)createLabelWithFrame:(CGRect)frame font:(float)font text:(NSString*)text TextAlignment:(NSTextAlignment)textAlignment TextColor:(UIColor *)textColor bgColor:(UIColor *)bgColor;
+
+
+
+
+
+//创建button
++(UIButton*)createButtonWithFrame:(CGRect)frame title:(NSString*)title imageName:(NSString*)imageName bgImageName:(NSString*)bgImageName target:(id)target method:(SEL)select;
++(UIButton*)createButtonWithFrame:(CGRect)frame title:(NSString*)title titleColor:(UIColor *)titleColor titleFont:(float)titleFont imageName:(NSString*)imageName bgImageName:(NSString*)bgImageName target:(id)target method:(SEL)select;
++(UIButton*)createButtonWithFrame:(CGRect)frame title:(NSString*)title titleColor:(UIColor *)titleColor titleFont:(float)titleFont cornerRadius:(float)cornerRadius borderWidth:(float)borderWidth borderColor:(UIColor*)borderColor target:(id)target method:(SEL)select;//包含边框的button
+//渐变色button
++(UIButton*)createGradientButtonWithFrame:(CGRect)frame title:(NSString*)title titleColor:(UIColor *)titleColor titleFont:(float)titleFont cornerRadius:(float)cornerRadius borderWidth:(float)borderWidth borderColor:(UIColor*)borderColor target:(id)target method:(SEL)select;
+//创建switch
++(UISwitch *)createSwitchWithFrame:(CGRect)frame withBOOL:(BOOL)BL target:(id)target method:(SEL)select;
+
+
+
+
+
+
+//创建imageView
++(UIImageView*)createImageViewFrame:(CGRect)frame imageName:(NSString*)imageName;
+//创建圆imageView
++(UIImageView*)createCircleImageViewFrame:(CGRect)frame imageName:(NSString*)imageName image:(UIImage *)image;
+//创建自适应imageView
++(UIImageView*)createImageViewFrame:(CGRect)frame imageName:(NSString*)imageName withClips:(BOOL)clips;
+//创建textField
++(UITextField*)createTextFieldFrame:(CGRect)frame placeholder:(NSString*)placeholder bgImageName:(NSString*)imageName leftView:(UIView*)leftView rightView:(UIView*)rightView isPassWord:(BOOL)isPassWord;
+//创建圈(适用于长按的按钮)
++(UIView*)createCircleViewWithFrame:(CGRect)frame color:(UIColor*)color;
+
+
++(UITextField*)createTextFieldFrame:(CGRect)frame placeholder:(NSString*)placeholder textAlignment:(NSTextAlignment)textAlignment font:(float)font titleColor:(UIColor *)color;
+
+//搜索框
++(UITextField*)createTextFieldFrame:(CGRect)frame placeholder:(NSString*)placeholder textAlignment:(NSTextAlignment)textAlignment font:(float)font titleColor:(UIColor *)titleColor backgroundColor:(UIColor *)backgroundColor tintColor:(UIColor *)tintColor cornerRadius:(float)cornerRadius;
+
+
+
+@end

+ 301 - 0
ios/JianYuIOS/JianYuIOS/guide/ZKControl.m

@@ -0,0 +1,301 @@
+//
+//  ZKControl.m
+//  zhengkun
+//
+//  Created by 郑坤 on 17/4/24.
+//  Copyright © 2017年 郑坤. All rights reserved.
+//
+
+#import "ZKControl.h"
+@interface ZKControl()
+@end
+
+@implementation ZKControl
+
+
++(UIView*)createViewWithFrame:(CGRect)frame color:(UIColor*)color
+{
+    UIView*view=[[UIView alloc]initWithFrame:frame];
+    if (color!=nil) {
+        view.backgroundColor=color;
+    }
+    return view;
+}
+
+
++(UIView*)createCircleViewWithFrame:(CGRect)frame color:(UIColor*)color
+{
+    UIView*view=[[UIView alloc]initWithFrame:frame];
+    
+    view.layer.masksToBounds = YES;
+    view.layer.borderWidth = 1;
+    view.layer.cornerRadius = view.width*0.5;
+    
+    if (color!=nil) {
+        view.layer.borderColor = color.CGColor;
+    }else {
+        view.layer.borderColor = [UIColor groupTableViewBackgroundColor].CGColor;
+    }
+    
+    return view;
+}
+
++(UILabel*)createLabelWithFrame:(CGRect)frame font:(float)font text:(NSString*)text TextColor:(UIColor *)textColor bgColor:(UIColor *)bgColor
+{
+    UILabel*label=[[UILabel alloc]initWithFrame:frame];
+    label.font=[UIFont systemFontOfSize:font];
+    //设置折行方式
+    label.lineBreakMode=NSLineBreakByCharWrapping;
+    //设置折行行数
+    label.numberOfLines=0;
+    //设置文字
+    label.text=text;
+    //设置对齐方式
+    label.textAlignment=NSTextAlignmentLeft;
+    //设置颜色
+    label.textColor = textColor;
+    if(bgColor!=nil) {
+        label.backgroundColor = bgColor;
+    }
+    return label;
+}
++(UILabel*)createLabelWithFrame:(CGRect)frame font:(float)font text:(NSString*)text TextAlignment:(NSTextAlignment)textAlignment TextColor:(UIColor *)textColor bgColor:(UIColor *)bgColor
+{
+    UILabel*label=[[UILabel alloc]initWithFrame:frame];
+    label.font=[UIFont systemFontOfSize:font];
+    //设置折行方式
+    label.lineBreakMode=NSLineBreakByCharWrapping;
+    //设置折行行数
+    label.numberOfLines=0;
+    //设置文字
+    label.text=text;
+    //设置对齐方式
+    label.textAlignment=textAlignment;
+    //设置颜色
+    label.textColor = textColor;
+    if(bgColor!=nil) {
+        label.backgroundColor = bgColor;
+    }
+    return label;
+}
+
++(UIButton*)createButtonWithFrame:(CGRect)frame title:(NSString*)title imageName:(NSString*)imageName bgImageName:(NSString*)bgImageName target:(id)target method:(SEL)select
+{
+    UIButton*button=[UIButton buttonWithType:UIButtonTypeCustom];
+    button.frame=frame;
+    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
+    if (title) {
+        [button setTitle:title forState:UIControlStateNormal];
+    }
+    if (imageName) {
+        [button setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
+    }
+    if (bgImageName) {
+        [button setBackgroundImage:[UIImage imageNamed:bgImageName] forState:UIControlStateNormal];
+    }
+    [button addTarget:target action:select forControlEvents:UIControlEventTouchUpInside];
+    return button;
+}
+
++(UIButton*)createButtonWithFrame:(CGRect)frame title:(NSString *)title titleColor:(UIColor *)titleColor titleFont:(float)titleFont imageName:(NSString *)imageName bgImageName:(NSString *)bgImageName target:(id)target method:(SEL)select
+{
+    UIButton*button=[UIButton buttonWithType:UIButtonTypeCustom];
+    button.frame=frame;
+    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
+    if (title) {
+        [button setTitle:title forState:UIControlStateNormal];
+    }
+    
+    if (titleColor) {
+  
+        [button setTitleColor:titleColor forState:UIControlStateNormal];
+        
+    }
+    if (titleFont) {
+        button.titleLabel.font =[UIFont systemFontOfSize:titleFont];
+    }
+    
+    if (imageName) {
+        [button setImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
+    }
+    if (bgImageName) {
+        [button setBackgroundImage:[UIImage imageNamed:bgImageName] forState:UIControlStateNormal];
+    }
+    [button addTarget:target action:select forControlEvents:UIControlEventTouchUpInside];
+    return button;
+}
+
+
++(UIButton*)createButtonWithFrame:(CGRect)frame title:(NSString*)title titleColor:(UIColor *)titleColor titleFont:(float)titleFont cornerRadius:(float)cornerRadius borderWidth:(float)borderWidth borderColor:(UIColor*)borderColor target:(id)target method:(SEL)select
+{
+    UIButton*button=[UIButton buttonWithType:UIButtonTypeCustom];
+    button.frame=frame;
+    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
+    button.layer.masksToBounds = YES;
+    if(cornerRadius) {
+       button.layer.cornerRadius = cornerRadius;
+    }
+    if (title) {
+        [button setTitle:title forState:UIControlStateNormal];
+    }
+    
+    if (titleColor) {
+        [button setTitleColor:titleColor forState:UIControlStateNormal];
+    }
+    if (titleFont) {
+        button.titleLabel.font =[UIFont systemFontOfSize:titleFont];
+    }
+    
+    if (borderWidth) {
+        button.layer.borderWidth = borderWidth;
+    }
+    if (borderColor) {
+        button.layer.borderColor = borderColor.CGColor;
+    }
+    [button addTarget:target action:select forControlEvents:UIControlEventTouchUpInside];
+    return button;
+}
+
+
+
+
+
+
+
++(UIImageView*)createImageViewFrame:(CGRect)frame imageName:(NSString*)imageName
+{
+    UIImageView*imageView=[[UIImageView alloc]initWithFrame:frame];
+    if (imageName) {
+        imageView.image=[UIImage imageNamed:imageName];
+    }
+    imageView.userInteractionEnabled=YES;
+    return imageView;
+}
+
++(UIImageView*)createImageViewFrame:(CGRect)frame imageName:(NSString*)imageName withClips:(BOOL)clips
+{
+    UIImageView*imageView=[[UIImageView alloc]initWithFrame:frame];
+    if (imageName) {
+        imageView.image=[UIImage imageNamed:imageName];
+    }
+    imageView.userInteractionEnabled=YES;
+    if(clips) {
+        imageView.clipsToBounds = YES;
+        imageView.contentMode = UIViewContentModeScaleAspectFill;
+    }
+    return imageView;
+}
+
+
+
++(UIImageView*)createCircleImageViewFrame:(CGRect)frame imageName:(NSString*)imageName image:(UIImage *)image
+{
+    UIImageView*imageView=[[UIImageView alloc]initWithFrame:frame];
+    if (imageName) {
+        imageView.image=[UIImage imageNamed:imageName];
+    }
+    if (image) {
+        [imageView setImage:image];
+    }
+    imageView.userInteractionEnabled=YES;
+    imageView.layer.cornerRadius = frame.size.width*0.5;
+    imageView.layer.masksToBounds = YES;
+    return imageView;
+}
+
++(UITextField*)createTextFieldFrame:(CGRect)frame placeholder:(NSString*)placeholder bgImageName:(NSString*)imageName leftView:(UIView*)leftView rightView:(UIView*)rightView isPassWord:(BOOL)isPassWord
+{
+    UITextField*textField=[[UITextField alloc]initWithFrame:frame];
+    if (placeholder) {
+        textField.placeholder=placeholder;
+    }
+    if (imageName) {
+        textField.background=[UIImage imageNamed:imageName];
+    }
+    if (leftView) {
+        textField.leftView=leftView;
+        textField.leftViewMode=UITextFieldViewModeAlways;
+    }
+    if (rightView) {
+        textField.rightView=rightView;
+        textField.rightViewMode=UITextFieldViewModeAlways;
+    }
+    if (isPassWord) {
+        textField.secureTextEntry=YES;
+    }
+    return textField;
+}
+
+
+
++(UITextField*)createTextFieldFrame:(CGRect)frame placeholder:(NSString*)placeholder textAlignment:(NSTextAlignment)textAlignment font:(float)font titleColor:(UIColor *)color
+{
+    UITextField*textField=[[UITextField alloc]initWithFrame:frame];
+    if (placeholder) {
+        textField.placeholder=placeholder;
+    }
+    if (textAlignment) {
+        textField.textAlignment = textAlignment;
+    }
+    if(font){
+        textField.font  = [UIFont systemFontOfSize:font];
+    }
+    if(color){
+        textField.textColor = color;
+    }
+    textField.backgroundColor = [UIColor whiteColor];
+    textField.layer.cornerRadius = 2;
+    textField.layer.masksToBounds = YES;
+    textField.tintColor= color;
+    textField.keyboardType = UIKeyboardTypeNumberPad;
+    
+    return textField;
+    
+}
+
+//搜索框
++(UITextField*)createTextFieldFrame:(CGRect)frame placeholder:(NSString*)placeholder textAlignment:(NSTextAlignment)textAlignment font:(float)font titleColor:(UIColor *)titleColor backgroundColor:(UIColor *)backgroundColor tintColor:(UIColor *)tintColor cornerRadius:(float)cornerRadius
+{
+    UITextField*textField=[[UITextField alloc]initWithFrame:frame];
+    if (placeholder) {
+        textField.placeholder=placeholder;
+    }
+    if (textAlignment) {
+        textField.textAlignment = textAlignment;
+    }
+    if(font){
+        textField.font  = [UIFont systemFontOfSize:font];
+    }
+    if(titleColor){
+        textField.textColor = titleColor;
+    }
+    if(backgroundColor){
+        textField.backgroundColor = backgroundColor;
+    }
+    
+    if(tintColor){
+        //光标
+        textField.tintColor = tintColor;
+    }
+    if(cornerRadius){
+        textField.layer.cornerRadius = cornerRadius;
+        textField.layer.masksToBounds = YES;
+    }
+
+    return textField;
+    
+}
+
+
++(UISwitch *)createSwitchWithFrame:(CGRect)frame withBOOL:(BOOL)BL target:(id)target method:(SEL)select
+{
+    UISwitch *switch_BTN = [[UISwitch alloc] init];
+    switch_BTN.frame=frame;
+    if(BL) {[switch_BTN setOn:BL];}
+    [switch_BTN addTarget:target action:select forControlEvents:UIControlEventValueChanged];
+    return switch_BTN;
+}
+
+
+
+@end

+ 22 - 0
ios/JianYuIOS/JianYuIOS/guide/ZKGuideView.h

@@ -0,0 +1,22 @@
+//
+//  ZKGuideView.h
+//  JianYuIOS
+//
+//  Created by apple on 2020/4/2.
+//  Copyright © 2020 lixianglan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ZKGuideView : UIView
+
+
+
+- (instancetype)initWithFrame:(CGRect)frame;
+
+-(void)showView;
+@end
+
+NS_ASSUME_NONNULL_END

+ 183 - 0
ios/JianYuIOS/JianYuIOS/guide/ZKGuideView.m

@@ -0,0 +1,183 @@
+//
+//  ZKGuideView.m
+//  JianYuIOS
+//
+//  Created by apple on 2020/4/2.
+//  Copyright © 2020 lixianglan. All rights reserved.
+//
+
+#import "ZKGuideView.h"
+
+
+
+
+
+@interface ZKGuideView()<UITextViewDelegate>
+
+@property (nonatomic, strong) UIView  *contentView;//内容
+
+@end
+
+@implementation ZKGuideView
+
+- (instancetype)initWithFrame:(CGRect)frame {
+     if ([super initWithFrame:frame]) {
+         [self makeUI];
+     }
+    return self;
+}
+
+-(void)makeUI{
+    UIImageView *imgView = [[UIImageView alloc]initWithFrame:self.frame];
+    [imgView setImage:[UIImage imageNamed:@"guide"]];
+    [self addSubview:imgView];
+    
+    
+    /*创建灰色背景*/
+    UIView *bgView = [[UIView alloc] initWithFrame:self.frame];
+    bgView.alpha = 0.8;
+    bgView.backgroundColor = [UIColor blackColor];
+    [self addSubview:bgView];
+
+    self.contentView = [ZKControl createViewWithFrame:CGRectMake(WIDTH*0.1, HEIGHT, WIDTH*0.8, 320) color:[UIColor whiteColor]];
+    self.contentView.layer.cornerRadius = 10;
+    [self addSubview:self.contentView];
+    
+    CGFloat B_H = 45;
+    UILabel *titleLabel = [ZKControl createLabelWithFrame:CGRectMake(0, 15, self.contentView.width, 20) font:18 text:@"使用许可协议和隐私政策" TextAlignment:NSTextAlignmentCenter TextColor:UIColorFromRGB(0x171826) bgColor:nil];
+    [self.contentView addSubview:titleLabel];
+    
+    
+    
+//     UIButton *button1 = [ZKControl createButtonWithFrame:CGRectMake(0, self.contentView.height-200, self.contentView.width, 45) title:@"点击协议测试" titleColor:UIColorFromRGB(0x795441) titleFont:15 imageName:nil bgImageName:nil target:self method:@selector(cccclick)];
+//
+//    NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"点击协议测试"];
+//    NSRange strRange = {0,[str length]};
+//    [str addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:strRange];
+//    [button1 setAttributedTitle:str forState:UIControlStateNormal];
+    
+    
+    UIButton *button = [ZKControl createButtonWithFrame:CGRectMake(0, self.contentView.height-B_H, self.contentView.width, B_H) title:@"同意" titleColor:UIColorFromRGB(0x2ABED1) titleFont:15 imageName:nil bgImageName:nil target:self method:@selector(doneBtnClick:)];
+    UIView *lineView = [ZKControl createViewWithFrame:CGRectMake(0, self.contentView.height-B_H-1, self.contentView.width, 1) color:UIColorFromRGB(0xEEEEEE)];
+    [self.contentView addSubview:button];
+    [self.contentView addSubview:lineView];
+    
+    //拼接文本的方式
+    /*
+     @"欢迎使用剑鱼标讯!\n 我们依据最新法规及监管政策要求,更新了《剑鱼标讯用户使用许可协议》和《剑鱼标讯隐私政策》,在您使用剑鱼标讯前,请仔细阅读并充分了解。 如你同意《剑鱼标讯用户使用许可协议》和《剑鱼标讯隐私政策》,请点击“同意”并开始使用我们的产品和服务,我们会全力保护你的个人信息安全。"
+     */
+/// 同意文本
+    UITextView *protocolTV = [[UITextView alloc] init];
+    protocolTV.frame = CGRectMake(15, titleLabel.bottom+10, self.contentView.width-30, lineView.top-titleLabel.bottom-10);
+    protocolTV.editable = NO;
+    protocolTV.delegate = self;
+    protocolTV.textContainer.lineFragmentPadding = 0.0;
+
+    protocolTV.linkTextAttributes = @{NSForegroundColorAttributeName:UIColorFromRGB(0x2ABED1)};
+    [self.contentView addSubview:protocolTV];
+    NSString *appName = [NSBundle mainBundle].infoDictionary[@"CFBundleDisplayName"];
+    NSString *rangeA = [NSString stringWithFormat:@"《%@隐私政策》",appName];
+    NSString *rangeB = [NSString stringWithFormat:@"《%@用户使用许可协议》",appName];
+    NSString *protocolStr = @"欢迎使用剑鱼标讯!\n 我们依据最新法规及监管政策要求,更新了《剑鱼标讯用户使用许可协议》和《剑鱼标讯隐私政策》,在您使用剑鱼标讯前,请仔细阅读并充分了解。\n如你同意《剑鱼标讯用户使用许可协议》和《剑鱼标讯隐私政策》,请点击“同意”并开始使用我们的产品和服务,我们会全力保护你的个人信息安全。";
+    
+    NSMutableAttributedString *privacyMutableAttrStr = [[NSMutableAttributedString alloc] initWithString:protocolStr attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:15.0],NSForegroundColorAttributeName:UIColorFromRGB(0x5F5E64)}];
+    NSArray *arrA = [self rangeOfSubString:rangeA inString:protocolStr];
+    NSArray *arrB = [self rangeOfSubString:rangeB inString:protocolStr];
+    for (NSValue *value in arrA) {
+        [privacyMutableAttrStr addAttribute:NSLinkAttributeName value:@"privacyA://" range:[value rangeValue]];
+    }
+    for (NSValue *value in arrB) {
+        [privacyMutableAttrStr addAttribute:NSLinkAttributeName value:@"privacyB://" range:[value rangeValue]];
+    }
+    protocolTV.attributedText = privacyMutableAttrStr;
+   
+    
+}
+-(NSArray*)rangeOfSubString:(NSString*)subStr inString:(NSString*)string {
+    NSMutableArray *rangeArray = [NSMutableArray array];
+    NSString*string1 = [string stringByAppendingString:subStr];
+    NSString *temp;
+    for(int i =0; i < string.length; i ++) {
+        temp = [string1 substringWithRange:NSMakeRange(i, subStr.length)];
+        if ([temp isEqualToString:subStr]) {
+            NSRange range = {i,subStr.length};
+            [rangeArray addObject: [NSValue valueWithRange:range]];
+        }
+    }
+    return rangeArray;
+
+}
+
+
+#pragma mark - UITextViewDelegate
+-(BOOL)textView:(UITextView *)textView shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange{
+    if ([URL.scheme isEqualToString:@"privacyA"]) {
+        NSLog(@"隐私政策---A:");
+        
+        
+        return NO;
+    }
+    if ([URL.scheme isEqualToString:@"privacyB"]) {
+            NSLog(@"许可协议---B:");
+        
+        
+        
+            return NO;
+        }
+    return YES;
+}
+
+
+
+
+
+-(void)doneBtnClick:(UIButton *)button
+{
+    [self dismissContactView];
+}
+
+- (void)dismissContactView:(UITapGestureRecognizer *)tapGesture
+{
+    [self dismissContactView];
+}
+-(void)dismissContactView
+{
+    __weak typeof(self)weakSelf = self;
+    [UIView animateWithDuration:0.5 animations:^{
+        weakSelf.alpha = 0;
+        [self.contentView setY:self.height];
+    } completion:^(BOOL finished) {
+        [weakSelf removeFromSuperview];
+    }];
+}
+
+-(void)animationPop
+{
+    [UIView animateWithDuration:0.5 animations:^{
+        [self.contentView setY:(HEIGHT-250)*0.4];
+    } completion:^(BOOL finished) {
+        NSLog(@"完成")
+    }];
+}
+// 这里加载在了window上
+-(void)showView
+{
+    UIWindow *window =[UIApplication sharedApplication].keyWindow;
+    [window addSubview:self];
+    [self animationPop];
+}
+
+
+
+
+
+
+/*
+// Only override drawRect: if you perform custom drawing.
+// An empty implementation adversely affects performance during animation.
+- (void)drawRect:(CGRect)rect {
+    // Drawing code
+}
+*/
+
+@end

+ 57 - 0
ios/JianYuIOS/JianYuIOS/guide/ZKMethod.h

@@ -0,0 +1,57 @@
+//
+//  ZKMethod.h
+//  amoy
+//
+//  Created by apple on 2017/8/16.
+//  Copyright © 2017年 zhengkun. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+
+typedef NS_ENUM(NSInteger, DirType){
+    Horizontal  = 0,
+    Vertical,
+};
+
+typedef NS_ENUM(NSInteger, BoundsType){
+    Left  = 0,
+    Right,
+    Center,
+};
+
+
+@interface ZKMethod : NSObject
+
+
+//计算文本长度-宽度
++(CGFloat)dealTextLengh:(NSString *)string font:(float)font;
+//分段颜色
++(NSMutableAttributedString *)addAttribute:(NSString *)attributeName value:(UIColor *)color rangeLocation:(NSInteger)location length:(NSInteger)length;
+
+
+
+//分段颜色
++(NSMutableAttributedString *)addAttribute:(NSString *)attributeName value:(UIColor *)color rangeLocation:(NSInteger)location length:(NSInteger)length withFont:(float)font withLine:(NSInteger)start andEnd:(NSInteger)endLength;
+
+//改变label行间距
++(NSAttributedString *)getAttributedStringWithString:(NSString *)string lineSpace:(CGFloat)lineSpace with:(BoundsType)type;
+
++(BOOL)judgmentNetwork;
+
+
++(CGSize)getSize:(UILabel *)desLabel;
+//渐变色
++(CAGradientLayer *)gradient:(DirType)dirType withFrame:(CGRect)frame andArray:(NSArray *)colorArray;
+//处理cgrect frame
++(CGFloat)dealFrameW:(NSString *)string;
+//添加单点手势
++(UITapGestureRecognizer *)addGestureSingleWithtarget:(id)target method:(SEL)select;
+
+
++(NSInteger)getCurrentYMD:(NSInteger)index;
+
++(UIViewController *)getCurrentVC;//获取当前控制器
+
+
+@end

+ 182 - 0
ios/JianYuIOS/JianYuIOS/guide/ZKMethod.m

@@ -0,0 +1,182 @@
+//
+//  ZKMethod.m
+//  amoy
+//
+//  Created by apple on 2017/8/16.
+//  Copyright © 2017年 zhengkun. All rights reserved.
+//
+
+#import "ZKMethod.h"
+
+@implementation ZKMethod
+
+
++(CGFloat)dealTextLengh:(NSString *)string font:(float)font
+{
+    CGSize contentSize = [string sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:font]}];
+    CGFloat contentW = contentSize.width;
+    return contentW;
+}
+
++(NSMutableAttributedString *)addAttribute:(NSString *)attributeName value:(UIColor *)color rangeLocation:(NSInteger)location length:(NSInteger)length
+{
+    NSMutableAttributedString *hintString=[[NSMutableAttributedString alloc]initWithString:attributeName];
+//    NSRange range=[[hintString string]rangeOfString:@""];
+    [hintString addAttribute:NSForegroundColorAttributeName value:color range:NSMakeRange(location, length)];
+    return hintString;
+}
+
+
+
+
+
++(NSMutableAttributedString *)addAttribute:(NSString *)attributeName value:(UIColor *)color rangeLocation:(NSInteger)location length:(NSInteger)length withFont:(float)font withLine:(NSInteger)start andEnd:(NSInteger)endLength
+{
+    NSMutableAttributedString *hintString=[[NSMutableAttributedString alloc]initWithString:attributeName];
+    //    NSRange range=[[hintString string]rangeOfString:@""];
+    //颜色
+    [hintString addAttribute:NSForegroundColorAttributeName value:color range:NSMakeRange(location, length)];
+    //尺寸
+    [hintString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:font] range:NSMakeRange(location, length)]; // 0为起始位置 length是从起始位置开始 设置指定字体尺寸的长度
+    //横线
+    [hintString addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlinePatternSolid | NSUnderlineStyleSingle) range:NSMakeRange(start, endLength)];
+    return hintString;
+}
+
++(NSAttributedString *)getAttributedStringWithString:(NSString *)string lineSpace:(CGFloat)lineSpace with:(BoundsType)type {
+    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:string];
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    paragraphStyle.lineSpacing = lineSpace; // 调整行间距
+    if(type==Left) {
+        [paragraphStyle setAlignment:NSTextAlignmentLeft];
+    }else if (type==Right) {
+        [paragraphStyle setAlignment:NSTextAlignmentRight];
+    }else if (type==Center) {
+        [paragraphStyle setAlignment:NSTextAlignmentCenter];
+    }else {
+        
+    }
+    NSRange range = NSMakeRange(0, [string length]);
+    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:range];
+    return attributedString;
+}
+
+
++(BOOL)judgmentNetwork
+{
+    BOOL reachable;
+    reachable = [[Reachability reachabilityForInternetConnection] isReachable];
+    return reachable;
+}
+
+
+
++ (UIViewController *)getCurrentVC
+{
+    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;
+}
+
+
++(CGSize)getSize:(UILabel *)desLabel
+{
+    //可变的属性文本
+    NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc]initWithString:desLabel.text];
+    //设置段落样式 使用NSMutableParagraphStyle类
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    paragraphStyle.alignment = NSTextAlignmentLeft;//文本对齐方式
+    paragraphStyle.maximumLineHeight = 60;  //最大的行高
+    paragraphStyle.lineSpacing = 5;  //行自定义行高度
+    //  给可变的属性字符串 添加段落格式
+    [attributedText addAttribute: NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [desLabel.text length])];
+    //将带有段落格式的可变的属性字符串给label.attributedText
+    desLabel.lineBreakMode = NSLineBreakByTruncatingTail;//label的换行模式
+    desLabel.numberOfLines = 0;// 设置行数,0表示没有限制
+    desLabel.attributedText=attributedText;
+    CGSize maxSzie = CGSizeMake(desLabel.width, 1000);//设置label的最大SIZE
+    CGSize labelSize = [desLabel sizeThatFits:maxSzie];//最终自适应得到的label的尺寸。
+    return labelSize;
+}
+
+
++(CAGradientLayer *)gradient:(DirType)dirType withFrame:(CGRect)frame andArray:(NSArray *)colorArray;
+{
+    CAGradientLayer *gradient = [CAGradientLayer layer];
+    gradient.frame = frame;
+    gradient.colors = colorArray;
+    if(dirType==Horizontal) {
+        //水平
+        gradient.startPoint = CGPointMake(0, 0);
+        gradient.endPoint = CGPointMake(1, 0);
+    }else {
+        gradient.startPoint = CGPointMake(0, 0);
+        gradient.endPoint = CGPointMake(0, 1);
+    }
+    return gradient;
+}
+
+
++(CGFloat)dealFrameW:(NSString *)string
+{
+    CGSize contentSize = [string sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:20]}];
+    CGFloat contentW = contentSize.width;     // 内容的宽度
+    contentW = (contentW>=WIDTH-64-65)? WIDTH-64-65:contentW;
+    return contentW;
+}
+
+
+
+//添加手势
++(UITapGestureRecognizer *)addGestureSingleWithtarget:(id)target method:(SEL)select
+{
+    UITapGestureRecognizer *headerSingle = [[UITapGestureRecognizer alloc] initWithTarget:target action:select];
+    headerSingle.numberOfTapsRequired = 1; // 单击-手势
+    return headerSingle;
+}
+
+
++(NSInteger)getCurrentYMD:(NSInteger)index
+{
+    NSDate  *currentDate = [NSDate date];
+    NSCalendar *calendar = [NSCalendar currentCalendar];
+    NSDateComponents *components = [calendar components:NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay fromDate:currentDate];
+    NSInteger year=[components year];
+    NSInteger month=[components month];
+    NSInteger day=[components day];
+    
+    if(index==1) {
+        return year;
+    }else if (index==2) {
+        return month;
+    }else if (index==3) {
+        return day;
+    }else {
+        return 0;
+    }
+}
+
+
+@end