测试已测试 | ✗ |
Lang语言 | SwiftSwift |
许可证 | MIT |
发布上次发布 | 2017年2月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由Alex Fischer 维护。
首先,确保已安装 Cocoa Pods。您可能需要运行 pod repo update
,因为此 pod 非常新。在 XCode 中创建您的项目。在项目目录中运行 pod init
。在创建的 Podfile 中放入以下内容
platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
target 'YOUR_PROJECT_NAME_HERE’ do
pod 'DFIDSwift'
end
# Following lines make it compatible with Objective-C, you can remove them if you're using Swift.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
现在,在项目目录中执行 pod install
命令。这应该在当前的 XCode 项目中安装 DFIDSwift。请确保遵循 pod 提醒您的警告,即“请关闭任何当前 Xcode 会话,并从此使用 YOUR_PROJECT_NAME_HERE.xcworkspace
进行此项目。”
为了允许应用程序检查已安装的应用程序:编辑项目目录中的 info.plist 文件。在第一个 <dict>
行后添加以下内容
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fb</string>
<string>twitter</string>
<string>comgooglemaps</string>
<string>pcast</string>
<string>mgc</string>
<string>youtube</string>
<string>googlechrome</string>
<string>googledrive</string>
<string>googlevoice</string>
<string>ohttp</string>
<string>firefox</string>
</array>
要检查它是否工作,可以在某个文件中 import DFIDSwift
(或在 Objective-C 中使用 @import DFIDSwift;
)并尝试 NSLog("the raw string is: " + DFID.dfid());
(或在 Objective-C 中使用 NSLog(@"the raw string is: %@\n", [DFID dfid]);
)。