Browse Source

引导图,启动图设置

zhangjidong 8 years ago
parent
commit
f816ffbd46
30 changed files with 348 additions and 80 deletions
  1. 12 19
      BingHaoBang.xcodeproj/project.pbxproj
  2. BIN
      BingHaoBang.xcworkspace/xcuserdata/zhangjidong.xcuserdatad/UserInterfaceState.xcuserstate
  3. 25 3
      BingHaoBang/AppDelegate.swift
  4. 6 0
      BingHaoBang/Assets.xcassets/Guide/Contents.json
  5. BIN
      BingHaoBang/Assets.xcassets/Guide/Guide_1.imageset/1@2x.png
  6. BIN
      BingHaoBang/Assets.xcassets/Guide/Guide_1.imageset/1@3x.png
  7. 22 0
      BingHaoBang/Assets.xcassets/Guide/Guide_1.imageset/Contents.json
  8. BIN
      BingHaoBang/Assets.xcassets/Guide/Guide_2.imageset/2@2x.png
  9. BIN
      BingHaoBang/Assets.xcassets/Guide/Guide_2.imageset/2@3x.png
  10. 22 0
      BingHaoBang/Assets.xcassets/Guide/Guide_2.imageset/Contents.json
  11. BIN
      BingHaoBang/Assets.xcassets/Guide/Guide_3.imageset/3@2x.png
  12. BIN
      BingHaoBang/Assets.xcassets/Guide/Guide_3.imageset/3@3x.png
  13. 22 0
      BingHaoBang/Assets.xcassets/Guide/Guide_3.imageset/Contents.json
  14. BIN
      BingHaoBang/Assets.xcassets/Guide/Guide_4.imageset/4@2x.png
  15. BIN
      BingHaoBang/Assets.xcassets/Guide/Guide_4.imageset/4@3x.png
  16. 22 0
      BingHaoBang/Assets.xcassets/Guide/Guide_4.imageset/Contents.json
  17. 65 0
      BingHaoBang/Assets.xcassets/LaunchImage.launchimage/Contents.json
  18. BIN
      BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-568h@2x-1.png
  19. BIN
      BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-568h@2x.png
  20. BIN
      BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-667h@2x.png
  21. BIN
      BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-Portrait-736h@3x.png
  22. BIN
      BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage.png
  23. BIN
      BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage@2x-1.png
  24. BIN
      BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage@2x.png
  25. 0 27
      BingHaoBang/Base.lproj/LaunchScreen.storyboard
  26. 0 2
      BingHaoBang/Info.plist
  27. 0 25
      BingHaoBang/ViewController.swift
  28. 62 0
      View/FPSLabel.swift
  29. 90 0
      View/GuideViewController.swift
  30. 0 4
      View/MainTabBarViewController.swift

+ 12 - 19
BingHaoBang.xcodeproj/project.pbxproj

@@ -8,9 +8,9 @@
 
 /* Begin PBXBuildFile section */
 		A01B62C21CAC362200477FFE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01B62C11CAC362200477FFE /* AppDelegate.swift */; };
-		A01B62C41CAC362200477FFE /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A01B62C31CAC362200477FFE /* ViewController.swift */; };
 		A01B62C91CAC362200477FFE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A01B62C81CAC362200477FFE /* Assets.xcassets */; };
-		A01B62CC1CAC362200477FFE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A01B62CA1CAC362200477FFE /* LaunchScreen.storyboard */; };
+		A0509C3A1CAD76560054B40C /* GuideViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0509C391CAD76560054B40C /* GuideViewController.swift */; };
+		A0E4C4541CAD6F1700F67F4E /* FPSLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0E4C4531CAD6F1700F67F4E /* FPSLabel.swift */; };
 		A0EA700F1CAC47C100FEF2E3 /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0EA700E1CAC47C100FEF2E3 /* Config.swift */; };
 		A0EA70111CAC485C00FEF2E3 /* MyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0EA70101CAC485C00FEF2E3 /* MyViewController.swift */; };
 		A0EA70131CAC488500FEF2E3 /* IndexViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0EA70121CAC488500FEF2E3 /* IndexViewController.swift */; };
@@ -25,10 +25,10 @@
 		9101E85183BB07FD008CA084 /* Pods-BingHaoBang.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BingHaoBang.debug.xcconfig"; path = "Pods/Target Support Files/Pods-BingHaoBang/Pods-BingHaoBang.debug.xcconfig"; sourceTree = "<group>"; };
 		A01B62BE1CAC362200477FFE /* BingHaoBang.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BingHaoBang.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		A01B62C11CAC362200477FFE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
-		A01B62C31CAC362200477FFE /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
 		A01B62C81CAC362200477FFE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
-		A01B62CB1CAC362200477FFE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
 		A01B62CD1CAC362200477FFE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		A0509C391CAD76560054B40C /* GuideViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GuideViewController.swift; path = View/GuideViewController.swift; sourceTree = "<group>"; };
+		A0E4C4531CAD6F1700F67F4E /* FPSLabel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = FPSLabel.swift; path = View/FPSLabel.swift; sourceTree = "<group>"; };
 		A0EA700E1CAC47C100FEF2E3 /* Config.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Config.swift; path = Common/Config.swift; sourceTree = "<group>"; };
 		A0EA70101CAC485C00FEF2E3 /* MyViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = MyViewController.swift; path = View/MyViewController.swift; sourceTree = "<group>"; };
 		A0EA70121CAC488500FEF2E3 /* IndexViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = IndexViewController.swift; path = View/IndexViewController.swift; sourceTree = "<group>"; };
@@ -74,9 +74,7 @@
 			isa = PBXGroup;
 			children = (
 				A01B62C11CAC362200477FFE /* AppDelegate.swift */,
-				A01B62C31CAC362200477FFE /* ViewController.swift */,
 				A01B62C81CAC362200477FFE /* Assets.xcassets */,
-				A01B62CA1CAC362200477FFE /* LaunchScreen.storyboard */,
 				A01B62CD1CAC362200477FFE /* Info.plist */,
 			);
 			path = BingHaoBang;
@@ -111,6 +109,8 @@
 				A0EA70121CAC488500FEF2E3 /* IndexViewController.swift */,
 				A0EA70141CAC489600FEF2E3 /* FindViewController.swift */,
 				A0EA70161CAC48BF00FEF2E3 /* MainTabBarViewController.swift */,
+				A0E4C4531CAD6F1700F67F4E /* FPSLabel.swift */,
+				A0509C391CAD76560054B40C /* GuideViewController.swift */,
 			);
 			name = View;
 			sourceTree = "<group>";
@@ -194,7 +194,6 @@
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				A01B62CC1CAC362200477FFE /* LaunchScreen.storyboard in Resources */,
 				A01B62C91CAC362200477FFE /* Assets.xcassets in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -254,8 +253,9 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				A01B62C41CAC362200477FFE /* ViewController.swift in Sources */,
 				A01B62C21CAC362200477FFE /* AppDelegate.swift in Sources */,
+				A0509C3A1CAD76560054B40C /* GuideViewController.swift in Sources */,
+				A0E4C4541CAD6F1700F67F4E /* FPSLabel.swift in Sources */,
 				A0EA70111CAC485C00FEF2E3 /* MyViewController.swift in Sources */,
 				A0EA70171CAC48BF00FEF2E3 /* MainTabBarViewController.swift in Sources */,
 				A0EA700F1CAC47C100FEF2E3 /* Config.swift in Sources */,
@@ -266,17 +266,6 @@
 		};
 /* End PBXSourcesBuildPhase section */
 
-/* Begin PBXVariantGroup section */
-		A01B62CA1CAC362200477FFE /* LaunchScreen.storyboard */ = {
-			isa = PBXVariantGroup;
-			children = (
-				A01B62CB1CAC362200477FFE /* Base */,
-			);
-			name = LaunchScreen.storyboard;
-			sourceTree = "<group>";
-		};
-/* End PBXVariantGroup section */
-
 /* Begin XCBuildConfiguration section */
 		A01B62CE1CAC362200477FFE /* Debug */ = {
 			isa = XCBuildConfiguration;
@@ -366,6 +355,8 @@
 			baseConfigurationReference = 9101E85183BB07FD008CA084 /* Pods-BingHaoBang.debug.xcconfig */;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+				CODE_SIGN_IDENTITY = "iPhone Developer";
 				INFOPLIST_FILE = BingHaoBang/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@@ -379,6 +370,8 @@
 			baseConfigurationReference = 092C49D19851971B9A4BF69E /* Pods-BingHaoBang.release.xcconfig */;
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+				CODE_SIGN_IDENTITY = "iPhone Developer";
 				INFOPLIST_FILE = BingHaoBang/Info.plist;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

BIN
BingHaoBang.xcworkspace/xcuserdata/zhangjidong.xcuserdatad/UserInterfaceState.xcuserstate


+ 25 - 3
BingHaoBang/AppDelegate.swift

@@ -18,11 +18,33 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         
         //创建窗口
         window = UIWindow(frame: SCREEN_BOUNDS)
-        //创建根视图控制器
-        let mainTabBarVC = MainTabBarController()
-        self.window?.rootViewController = mainTabBarVC
+
+        // 得到当前应用的版本号
+        let infoDictionary = NSBundle.mainBundle().infoDictionary
+        let currentAppVersion = infoDictionary!["CFBundleShortVersionString"] as! String
+        
+        // 取出之前保存的版本号
+        let userDefaults = NSUserDefaults.standardUserDefaults()
+        let appVersion = userDefaults.stringForKey("appVersion")
+        
+        //判断APP是否第一次启动,每版本是否第一次启动
+        if appVersion == nil || appVersion != currentAppVersion
+        {
+            //引导图
+            self.window?.rootViewController = GuideViewController()
+            // 保存最新的版本号
+            userDefaults.setValue(currentAppVersion, forKey: "appVersion")
+        }else{
+            //创建根视图
+            self.window?.rootViewController = MainTabBarController()
+        }
+        
         //显示窗口
         window?.makeKeyAndVisible()
+        
+        //FPS
+        let fpslabel = FPSLabel(frame: CGRectMake(50, 30, 55, 20))
+        self.window?.addSubview(fpslabel)
         return true
     }
 

+ 6 - 0
BingHaoBang/Assets.xcassets/Guide/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
BingHaoBang/Assets.xcassets/Guide/Guide_1.imageset/1@2x.png


BIN
BingHaoBang/Assets.xcassets/Guide/Guide_1.imageset/1@3x.png


+ 22 - 0
BingHaoBang/Assets.xcassets/Guide/Guide_1.imageset/Contents.json

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

BIN
BingHaoBang/Assets.xcassets/Guide/Guide_2.imageset/2@2x.png


BIN
BingHaoBang/Assets.xcassets/Guide/Guide_2.imageset/2@3x.png


+ 22 - 0
BingHaoBang/Assets.xcassets/Guide/Guide_2.imageset/Contents.json

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

BIN
BingHaoBang/Assets.xcassets/Guide/Guide_3.imageset/3@2x.png


BIN
BingHaoBang/Assets.xcassets/Guide/Guide_3.imageset/3@3x.png


+ 22 - 0
BingHaoBang/Assets.xcassets/Guide/Guide_3.imageset/Contents.json

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

BIN
BingHaoBang/Assets.xcassets/Guide/Guide_4.imageset/4@2x.png


BIN
BingHaoBang/Assets.xcassets/Guide/Guide_4.imageset/4@3x.png


+ 22 - 0
BingHaoBang/Assets.xcassets/Guide/Guide_4.imageset/Contents.json

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

+ 65 - 0
BingHaoBang/Assets.xcassets/LaunchImage.launchimage/Contents.json

@@ -0,0 +1,65 @@
+{
+  "images" : [
+    {
+      "extent" : "full-screen",
+      "idiom" : "iphone",
+      "subtype" : "736h",
+      "filename" : "LaunchImage-800-Portrait-736h@3x.png",
+      "minimum-system-version" : "8.0",
+      "orientation" : "portrait",
+      "scale" : "3x"
+    },
+    {
+      "extent" : "full-screen",
+      "idiom" : "iphone",
+      "subtype" : "667h",
+      "filename" : "LaunchImage-800-667h@2x.png",
+      "minimum-system-version" : "8.0",
+      "orientation" : "portrait",
+      "scale" : "2x"
+    },
+    {
+      "orientation" : "portrait",
+      "idiom" : "iphone",
+      "filename" : "LaunchImage@2x.png",
+      "extent" : "full-screen",
+      "minimum-system-version" : "7.0",
+      "scale" : "2x"
+    },
+    {
+      "extent" : "full-screen",
+      "idiom" : "iphone",
+      "subtype" : "retina4",
+      "filename" : "LaunchImage-700-568h@2x.png",
+      "minimum-system-version" : "7.0",
+      "orientation" : "portrait",
+      "scale" : "2x"
+    },
+    {
+      "orientation" : "portrait",
+      "idiom" : "iphone",
+      "filename" : "LaunchImage.png",
+      "extent" : "full-screen",
+      "scale" : "1x"
+    },
+    {
+      "orientation" : "portrait",
+      "idiom" : "iphone",
+      "filename" : "LaunchImage@2x-1.png",
+      "extent" : "full-screen",
+      "scale" : "2x"
+    },
+    {
+      "orientation" : "portrait",
+      "idiom" : "iphone",
+      "filename" : "LaunchImage-700-568h@2x-1.png",
+      "extent" : "full-screen",
+      "subtype" : "retina4",
+      "scale" : "2x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-568h@2x-1.png


BIN
BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage-700-568h@2x.png


BIN
BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-667h@2x.png


BIN
BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage-800-Portrait-736h@3x.png


BIN
BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage.png


BIN
BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage@2x-1.png


BIN
BingHaoBang/Assets.xcassets/LaunchImage.launchimage/LaunchImage@2x.png


+ 0 - 27
BingHaoBang/Base.lproj/LaunchScreen.storyboard

@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
-    <dependencies>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
-    </dependencies>
-    <scenes>
-        <!--View Controller-->
-        <scene sceneID="EHf-IW-A2E">
-            <objects>
-                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
-                    <layoutGuides>
-                        <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
-                        <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
-                    </layoutGuides>
-                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
-                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <animations/>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
-                    </view>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="53" y="375"/>
-        </scene>
-    </scenes>
-</document>

+ 0 - 2
BingHaoBang/Info.plist

@@ -22,8 +22,6 @@
 	<string>1</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
-	<key>UILaunchStoryboardName</key>
-	<string>LaunchScreen</string>
 	<key>UIMainStoryboardFile</key>
 	<string></string>
 	<key>UIRequiredDeviceCapabilities</key>

+ 0 - 25
BingHaoBang/ViewController.swift

@@ -1,25 +0,0 @@
-//
-//  ViewController.swift
-//  BingHaoBang
-//
-//  Created by zhangjidong on 16/3/31.
-//  Copyright © 2016年 Zjdboy. All rights reserved.
-//
-
-import UIKit
-
-class ViewController: UIViewController {
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        // Do any additional setup after loading the view, typically from a nib.
-    }
-
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-        // Dispose of any resources that can be recreated.
-    }
-
-
-}
-

+ 62 - 0
View/FPSLabel.swift

@@ -0,0 +1,62 @@
+//
+//  FPSLabel.swift
+//  BingHaoBang
+//
+//  Created by zhangjidong on 16/3/31.
+//  Copyright © 2016年 Zjdboy. All rights reserved.
+//
+
+import UIKit
+
+class FPSLabel: UILabel {
+    
+    private var _link :CADisplayLink?
+    private var _count:Int = 0
+    private var _lastTime:NSTimeInterval = 0
+    
+    private let _defaultSize = CGSizeMake(55, 20);
+    
+    override init(frame: CGRect) {
+        var targetFrame = frame
+        if frame.size.width == 0 && frame.size.height == 0{
+            targetFrame.size = _defaultSize
+        }
+        super.init(frame: targetFrame)
+        self.layer.cornerRadius = 5
+        self.clipsToBounds = true
+        self.textAlignment = .Center
+        self.userInteractionEnabled = false
+        self.textColor = UIColor.whiteColor()
+        self.backgroundColor = UIColor(white: 0, alpha: 0.7)
+        self.font = UIFont(name: "Menlo", size: 14)
+        weak var weakSelf = self
+        _link = CADisplayLink(target: weakSelf!, selector:#selector(FPSLabel.tick(_:)) );
+        _link!.addToRunLoop(NSRunLoop .mainRunLoop(), forMode:NSRunLoopCommonModes)
+    }
+    required init?(coder aDecoder: NSCoder) {
+        super.init(coder: aDecoder)
+    }
+    
+    func tick(link:CADisplayLink) {
+        if _lastTime == 0  {
+            _lastTime = link.timestamp
+            return
+        }
+        
+        _count += 1
+        let delta = link.timestamp - _lastTime
+        if delta < 1 {
+            return
+        }
+        _lastTime = link.timestamp
+        let fps = Double(_count) / delta
+        _count = 0
+        
+        
+        
+        let progress = fps / 60.0;
+        self.textColor = UIColor(hue: CGFloat(0.27 * ( progress - 0.2 )) , saturation: 1, brightness: 0.9, alpha: 1)
+        self.text = "\(Int(fps+0.5))FPS"
+        
+    }
+}

+ 90 - 0
View/GuideViewController.swift

@@ -0,0 +1,90 @@
+//
+//  GuideViewController.swift
+//  BingHaoBang
+//
+//  Created by zhangjidong on 16/3/31.
+//  Copyright © 2016年 Zjdboy. All rights reserved.
+//
+
+import UIKit
+
+class GuideViewController: UIViewController,UIScrollViewDelegate {
+    
+    var scrollView = UIScrollView()
+    var pageControl = UIPageControl()
+    var btn = UIButton()
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        
+        //配置pageControl
+        pageControl.center = CGPointMake(self.view.frame.width/2, self.view.frame.height-30)
+        pageControl.currentPageIndicatorTintColor = UIColor.redColor()
+        pageControl.pageIndicatorTintColor = UIColor.whiteColor()
+        pageControl.numberOfPages = 4
+        pageControl.addTarget(self, action: #selector(UIScrollViewDelegate.scrollViewDidEndDecelerating(_:)), forControlEvents: UIControlEvents.ValueChanged)
+        
+        //配置scrollView
+        scrollView.frame = self.view.bounds
+        scrollView.contentSize = CGSizeMake(4*self.view.frame.width, 0)
+        scrollView.pagingEnabled = true
+        scrollView.bounces = false
+        scrollView.showsHorizontalScrollIndicator = false
+        scrollView.delegate = self
+        self.view.addSubview(scrollView)
+        for i in 0 ..< 4
+        {
+            let image = UIImage(named: "Guide_\(i+1)")
+            let imageView = UIImageView(frame: CGRectMake(0, 0, self.view.frame.width, self.view.frame.height))
+            imageView.image = image
+            var frame = imageView.frame
+            frame.origin.x = CGFloat(i)*frame.size.width
+            imageView.frame = frame
+            scrollView.addSubview(imageView)
+            self.view.addSubview(pageControl)
+        }
+    }
+    
+    /**
+     按钮点击事件
+     
+     - parameter button: UIButton
+     */
+    func buttonClick(button:UIButton)
+    {
+        //跳转页面
+        self.presentViewController(MainTabBarController(), animated: true, completion: nil)
+    }
+    
+    /**
+     导航处理
+     
+     - parameter scrollView: UIScrollView
+     */
+    func scrollViewDidEndDecelerating(scrollView: UIScrollView) {
+        let index = Int(scrollView.contentOffset.x / self.view.frame.size.width)    //获取当前页数
+        pageControl.currentPage = index
+        //在这里添加按钮的渐入效果,当页面滑到第4页时出现
+        if(index == 3)
+        {
+            self.btn.frame = CGRectMake(3*self.view.frame.width, self.view.frame.height, self.view.frame.width, 50)
+            self.btn.setTitle("开启旅程", forState: UIControlState.Normal)
+            self.btn.titleLabel?.font = UIFont.systemFontOfSize(20)
+            self.btn.setTitleColor(UIColor.grayColor(), forState: UIControlState.Highlighted)
+            self.btn.backgroundColor = UIColor.orangeColor()
+            self.btn.alpha = 0
+            self.btn.addTarget(self, action: #selector(GuideViewController.buttonClick(_:)), forControlEvents: UIControlEvents.TouchUpInside)
+            UIView.animateWithDuration(1.5, delay: 0.5, options: UIViewAnimationOptions.CurveEaseInOut, animations: { () -> Void in
+                self.btn.frame = CGRectMake(3*self.view.frame.width, self.view.frame.height-100, self.view.frame.width, 50)
+                self.btn.alpha = 1
+                //注意把按钮添加到scrollView上,不要添加到imageView上,会无法点击
+                self.scrollView.addSubview(self.btn)
+                }, completion: nil)
+        }
+    }
+    
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+        // Dispose of any resources that can be recreated.
+    }
+}

+ 0 - 4
View/MainTabBarViewController.swift

@@ -9,10 +9,6 @@
 import UIKit
 
 class MainTabBarController: UITabBarController {
-    let tabbarBigImageLength: CGFloat = 43
-    let centerButtonIndex = 2
-    var button: UIButton!
-    
     override func viewDidLoad() {
         super.viewDidLoad()
         addAllChildViewController()