macOS、iOS UI控件定制
- Mac OS X 10.14
- Xcode 11.0+
- Swift 5.0+
- If you need help, use cnblogs. (Tag 'CocoaUIKit')
- If you'd like to ask a general question, use cnblogs.
- If you found a bug, open an issue.
- If you have a feature request, open an issue.
- If you want to contribute, submit a pull request.
CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:
$ gem install cocoapods
To integrate CocoaUIKit into your Xcode project using CocoaPods, specify it in your Podfile
:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'CocoaUIKit', '~> 0.0.1'
end
Then, run the following command:
$ pod install
Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
Xcode 11+ is required to build CocoaUIKit using Swift Package Manager.
To integrate CocoaUIKit into your Xcode project using Swift Package Manager, add it to the dependencies value of your Package.swift
:
dependencies: [
.package(url: "https://github.com/nenhall/CocoaUI.git", .upToNextMajor(from: "0.0.1"))
]
If you prefer not to use either of the aforementioned dependency managers, you can integrate CocoaUIKit into your project manually.
import CocoaUIKit
class MyViewController: UIViewController {
lazy var cWindow: CoWindow = ...
override func viewDidLoad() {
super.viewDidLoad()
cWindow.titlebarColor = .blue
}
}
You can try CocoaUIKit in Playground.
Note:
To try CocoaUIKit, open
CocoaUI.xcworkspace
and build CocoaUIKit.framework for any simulator first.
- Robert Payne (@nenhall)
CocoaUIKit is released under the MIT license. See LICENSE for details.