简体   繁体   English

如何使用Swift初始化Pixate Freestyle

[英]How to initialize Pixate Freestyle with Swift

How do I initialize Pixate Freestyle on iOS using Swift? 如何使用Swift在iOS上初始化Pixate Freestyle?

The documentation say to do 文件说要做

int main(int argc, char *argv[])
{
    @autoreleasepool {
        [PixateFreestyle initializePixateFreestyle];
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

How do I do that with Swift? 我如何使用Swift做到这一点?

In AppDelegate.swift, comment out or remove: 在AppDelegate.swift中,注释掉或删除:

//@UIApplicationMain

Create a main.swift that contains: 创建一个main.swift,其中包含:

import Foundation
import UIKit

// Override point for customization after application launch.
PixateFreestyle.initializePixateFreestyle()
UIApplicationMain(C_ARGC, C_ARGV, nil, NSStringFromClass(AppDelegate))

For XCode 6.3 and higher replace the UIApplicationMain line with: 对于XCode 6.3及更高版本,请将UIApplicationMain行替换为:

UIApplicationMain(Process.argc, Process.unsafeArgv, nil, NSStringFromClass(AppDelegate))

And for Cocoapod-based installs (at least) remember to create (and configure in the target Build Settings) a bridging header with the correct import line: 对于基于Cocoapod的安装(至少),请记住使用正确的导入行创建(并在目标Build Settings中配置)桥接头:

#import <PixateFreestyle/PixateFreestyle.h>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM