From c00a058ff8625f6452a689ec998ea16b03100484 Mon Sep 17 00:00:00 2001 From: Chen-Hai Teng Date: Mon, 1 Apr 2024 17:08:56 +0800 Subject: [PATCH] Support Cocoapods --- GradientBuilder.podspec | 51 +++++++++++++++++++++++++++++++++++++++++ README.md | 13 +++++++++-- 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 GradientBuilder.podspec diff --git a/GradientBuilder.podspec b/GradientBuilder.podspec new file mode 100644 index 0000000..608cfd6 --- /dev/null +++ b/GradientBuilder.podspec @@ -0,0 +1,51 @@ +# +# Be sure to run `pod lib lint GradientBuilder.podspec' to ensure this is a +# valid spec before submitting. +# +# Any lines starting with a # are optional, but their use is encouraged +# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html +# + +Pod::Spec.new do |s| + s.name = 'GradientBuilder' + s.version = '1.1.1' + s.summary = 'A result builder to make create gradient easier' +# s.swift_version:begin + s.swift_version = '5.9.0' + # s.swift_version = '${SWIFT_VERSION}' + +# s.platform:begin + s.platform = :ios, '13.0' + s.ios.deployment_target = '13.0' + s.platform = :osx, '10.15' + s.osx.deployment_target = '10.15' + +# This description is used to generate tags and improve search results. +# * Think: What does it do? Why did you write it? What is the focus? +# * Try to keep it short, snappy and to the point. +# * Write the description between the DESC delimiters below. +# * Finally, don't worry about the indent, CocoaPods strips it! + + s.description = 'GradientBuilder is written with result builder. It provides a DSL(Domain Specific Language) style to create Gradient. With GradintBuilder, you can create a gradient just like swiftUI View.' + + s.homepage = 'https://github.com/chenhaiteng/GradientBuilder' + # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' + s.license = { :type => 'MIT', :file => 'LICENSE' } + s.author = { 'Chen-Hai Teng' => 'chenhaiteng@gmail.com' } + s.source = { :git => 'https://git@github.com/chenhaiteng/GradientBuilder.git', :tag => s.version.to_s } + # s.social_media_url = 'https://twitter.com/' + + s.source_files = 'Sources/GradientBuilder/**/*.swift' + + # s.resource_bundles = { + # 'GradientBuilder' => ['GradientBuilder/Assets/*.png'] + # } + + # s.public_header_files = 'Pod/Classes/**/*.h' + # s.frameworks = 'Cocoa' + + # s.dependency 'AFNetworking', '~> 2.3' + # parse and add dependency here + # s.dependency:begin + +end diff --git a/README.md b/README.md index d0d96a9..5fcba04 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,18 @@ For design detail, read [Go through swift result builders](https://chenhaiteng.github.io/swift/2021/08/16/go-through-swift-result-builders.html) ## Installation: + +### CocoaPods +GradientBuilder is now available through [CocoaPods](https://cocoapods.org). To install +it, simply add the following line to your Podfile: + +```ruby +pod 'GradientBuilder' +``` + +### Swift Package Manager GradientBuilder is published with Swift Package Manager, you can get more information at ![Swift Package Manager(GitHub)](https://github.com/apple/swift-package-manager), ![Package Manager(swift.org)](https://swift.org/package-manager/), and ![Swift Packages(Apple)](https://developer.apple.com/documentation/swift_packages) -### Install GradientBuilder Step by Step #### - Add to Xcode(To use this package in your application): 1. File > Swift Packages > Add Package Dependency... @@ -112,4 +121,4 @@ let g = createGradient { (255, 255, 255, 210) //RGBA8888 format, vlaue from 0 to 255 (.green, 0.7) // Invalid!!! show ambiguous error!!!! } -``` \ No newline at end of file +```