We Simplify, But We Perfect.


Demo 神器 Touchpose

2019-01-21


TouchPose 能够在你做 demo 工程演示的时候,把你的所有 FingerPoint 全部展示出来,良心推荐

![image](/images/blog/touchpose/touchpose.png)

安装方法(Swift 工程):

$ git clone https://github.com/toddreed/Touchpose.git
#import "QTouchposeApplication.h"
//
//  main.swift
//  TouchPoseDemo
//
//  Created by Feng Qiu on 2019/1/20.
//  Copyright © 2019 www.qiufeng.me. All rights reserved.
//

import Foundation
import UIKit

UIApplicationMain(CommandLine.argc, CommandLine.unsafeArgv, NSStringFromClass(QTouchposeApplication.self), NSStringFromClass(AppDelegate.self))

以上代码为 Swift 4 语言,如果无法编译,Google 一下对应的语言变化,主要是 CommandLine.argc, CommandLine.unsafeArgv 这两个参数

接着, 去你的 AppDelegate.swift 注释掉 @UIApplicationMain

import UIKit

//@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
}

修改 AppDelegate.swiftdidFinishLaunchingWithOptions 的方法,加入以下代码

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

    (application as! QTouchposeApplication).alwaysShowTouches = true
    //......
}


上一篇:ObjC 中 “== YES” 的愚蠢行为有多可怕