Check the latest release here:
https://github.com/Clothparency/ios-widgets/releases/latest
There are two ways to install ClearFashionWidget in your project:
- Swift Package Manager
- cocoapods
Swift Package Manager
If you are working with Xcode, you can search for ios-widgets package
File > Add Packages…
ClearFashionWidget is also available as a Swift Package for the Swift Package Manager. Add it to your dependecies in your Package.swift
file.
After that you can build your project with the command swift build
, and eventually run you project (if it is an executable target) with the command swift run
.
If you want you can also run tests using swift test
.
// swift-tools-version:5.5
import PackageDescription
let package = Package(
name: "MyApp",
dependencies: [
.package(url: "https://github.com/Clothparency/ios-widgets.git", from: "1.0.0")
],
targets: [
.target(
name: "MyApp",
dependencies: ["ClearFashionWidget"]
)
]
)
CocoaPods
ClearFashionWidget is also available as a pod on CocoaPods. Add the dependency to your Podfile (choose the release version you prefer):
target 'MyApp' do
pod 'ClearFashionWidget', '~> 1.0'
end
and then run pod install (or pod update).
ClearFashionWidget is compatible with the following platforms:
- iOS
- MacOS
This package exposes a class ClearFashionWidget
returning a View
object.
You can easily use it in your application, once you added the package ios-widgets
to your dependencies.
import SwiftUI
import ClearFashionWidget
struct ContentView: View {
var body: some View {
ClearFashionWidget(
brandId: "The id of your brand as given by Clear Fashion",
productId: "The identifier of your product as given by Clear Fashion",
lang: "fr" // Must be either "fr" or "en"
)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
In case of trouble, you can always check server's status at https://status.clear-fashion.com