The Swift Package can be opened directly in Xcode. As an alternative, the Package can be also converted into a Xcode project. Open the CumulocityCoreLibrary root directory in your terminal and run the following command:
swift package generate-xcodeproj
or run the shell script located in the root directory:
sh xcodeproj.sh
Additional information can be passed to each API class using the URLRequestBuilder
. It provides dedicated methods to configure URL scheme, host name or additional headers:
let builder = URLRequestBuilder()
builder.set(scheme: "http")
builder.set(host: "host")
After configuring use the builder
as argument for creating service instances:
let service = SystemOptionsApi(requestBuilder: builder)
Each API class contains initializers to configure the URLSession
used for each request. The session object can be used to register a URLSessionDelegate
.
let session = URLSession.shared
let service = SystemOptionsApi(session: session)
The client sends HTTP requests with the Authorization
header that contains the word Basic
followed by a space and a base64-encoded string username:password
. To include your credentials in API calls, use the init(requestBuilder: URLRequestBuilder)
initializer and pass credentials using URLRequestBuilder
as described below:
let builder = URLRequestBuilder()
// configure credentials using the Authorization header
builder.add(header: "Authorization", value: "")
// or pass userName and password explicitly
builder.set(authorization: "userName", password: "password")
These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.
link |
Stars: 4 |
Last commit: 6 days ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics