小程序三方平台开发: 解析小程序开发的未来趋势和机遇
752
2022-10-12
用于响应式编程的一个Swift框架(swift的逻辑结构)
CwlSignal
An implementation of reactive programming. For details, see the article on Cocoa with Love, CwlSignal, a library for reactive programming.
Adding to your project
This project can be included in your projects in a number of different ways:
Manually included frameworkStatically included filesSwift Package ManagerCocoaPodsCarthage
The standard restrictions for each of these approaches apply so you'll need to pick an approach based on your situation and preferences.
Minimum requirements are iOS 8 or macOS 10.10.
Manual framework inclusion
In a subdirectory of your project's directory, run git clone https://github.com/mattgallagher/CwlSignal.gitDrag the "CwlSignal.xcodeproj" file from the Finder to somewhere your in own project's file tree in XcodeDrag the "CwlSignal.framework" and CwlUtils.framework" from the "Products" folder of the "CwlSignal" project to the "Copy Files (Frameworks)" build phases of any target that you want to include this module.
Statically included files
This approach generates two concatenated files (CwlUtils.swift, CwlSignal.swift) that can be added to another project – macOS or iOS – with no dynamic frameworks, libraries or other settings required.
Get the latest version of CwlSignal by running git clone https://github.com/mattgallagher/CwlSignal.git on the command-line.Open the CwlSignal.xcodeproj in Xcode and select the CwlSignalConcat scheme with a destination of "My Mac" (choose from the Scheme popup in the toolbar or from the "Product" → "Scheme" and "Product" → "Destination" menus in the menubar.Build the scheme (Command-B or "Product" → "Build")Open the "Products" folder by right-clicking (or Control-click) on the "Products" folder in the project's file tree in Xcode and select "Show in Finder" and open the "Debug" folder in the "Products" folder that this reveals.
Inside a folder located "Concat_internal" should be three files:
CwlUtils_internal.swiftCwlSignal_internal.swift
You can copy these files and include them in any of your own projects like any other files.
A folder named "Concat_public" should also be present. This version is almost identical to the "Concat_internal" version except that where the "Concat_internal" version strips public and open specifiers from files, the "Concat_public" version leaves these in-place. This allows the "Concat_public" version to be use in the "Sources" folder of Swift playgrounds or otherwise used where the features need to be exported from a module.
Swift Package Manager
Add the following to the dependencies array in your "Package.swift" file:
.Package(url: "https://github.com/mattgallagher/CwlSignal.git", majorVersion: 1),
Or, if you're using the swift-tools-version:4.0 package manager, add the following to the dependencies array in your "Package.swift" file:
.package(url: "https://github.com/mattgallagher/CwlSignal.git", majorVersion: 1)
NOTE: even though this git repository includes its dependencies in the Dependencies folder, building via the Swift Package manager fetches and builds these dependencies independently.
CocoaPods
Add the following lines to your target in your "Podfile":
pod 'CwlSignal', :git => 'https://github.com/mattgallagher/CwlSignal.git'pod 'CwlUtils', :git => 'https://github.com/mattgallagher/CwlUtils.git'
Carthage
Add the following line to your Cartfile:
git "https://github.com/mattgallagher/CwlSignal.git" "master"
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~