Skip to content

Commit f2bf805

Browse files
authored
Merge pull request #16 from bow-swift/tomas/integration
Documentation for integration in Xcode
2 parents 5d896d2 + 189c921 commit f2bf805

File tree

7 files changed

+36
-0
lines changed

7 files changed

+36
-0
lines changed

Documentation.app/Contents/MacOS/Consuming generated code.playground/Pages/Adding the module to your project.xcplaygroundpage/Contents.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,17 @@
77
/*:
88
# Adding the module to your project
99

10+
After generating a network client using Bow OpenAPI, you will get a folder that contains all files together with the Swift Package manifest that describes the provided artifacts. Adding it to your Xcode Project is as easy as dragging the folder to the left panel in Xcode, and Xcode will automatically trigger the Swift Package Manager to download the dependencies.
11+
12+
![](/assets/project-tree.png)
13+
14+
Then, you need to add the dependency to the target where you want to use the generated code:
15+
16+
![](/assets/add-frameworks.png)
17+
18+
Finally, you can import it in your Swift files as:
19+
20+
```swift
21+
import SampleAPI
22+
```
1023
*/

Documentation.app/Contents/MacOS/Quick start.playground/Pages/Integration in Xcode.xcplaygroundpage/Contents.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,27 @@
77
/*:
88
# Integration in Xcode
99

10+
Bow OpenAPI can be integrated in Xcode easily to regenerate your network client whenever the specification changes. Assuming you have already installed Bow OpenAPI in your computer, you can follow these steps.
11+
12+
## Add the specification file
13+
14+
Add the OpenAPI/Swagger specification file to the root of your project, as depicted in the image.
15+
16+
![](/assets/spec-file.png)
17+
18+
## Create an Aggregate
19+
20+
Add a new target to your project and select Aggregate, giving it the name you prefer.
21+
22+
![](/assets/aggregate.png)
23+
24+
## Run script
25+
26+
Select your recently created Aggregate and go to its Build Phases tab. Add a New Run Script Phase. There, you can invoke the Bow OpenAPI command, passing the values you need for your project.
27+
28+
![](/assets/build-phase.png)
29+
30+
## Build
31+
32+
From now on, if you run the scheme corresponding to this Aggregate, it will regenerate the network client based on the specification file. Drag the folder containing the generated code and drop it onto your project, and Swift Package Manager will start fetching your dependencies.
1033
*/

assets/add-frameworks.png

9.37 KB
Loading

assets/aggregate.png

116 KB
Loading

assets/build-phase.png

38.9 KB
Loading

assets/project-tree.png

61.2 KB
Loading

assets/spec-file.png

48.1 KB
Loading

0 commit comments

Comments
 (0)