# Swift-DocC plugin for SwiftPM

**URL:** <https://forums.swift.org/t/swift-docc-plugin-for-swiftpm/54725>\
**Category:** Swift-DocC\
**Created:** [January 19, 2022, 7:35pm UTC](https://forums.swift.org/t/swift-docc-plugin-for-swiftpm/54725 "2022-01-19T19:35:55Z")\
**Posts on this page:** 1\
**Showing post:** 30

<div class="post-metadata">

**Author:** ![nonameplum](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/nonameplum/32/6450_2.png) [@nonameplum](https://forums.swift.org/u/nonameplum)\
**Post date:** [May 19, 2022, 6:58am UTC](https://forums.swift.org/t/swift-docc-plugin-for-swiftpm/54725/30 "2022-05-19T06:58:06Z")

</div>

Is it the current limitation that I cannot generate the documentation for my package that uses `UIKit`. While generating I get:

```swift
... error: no such module 'UIKit'
import UIKit

```

Same as when running `swift build` but in this case, I can pass options to properly build

```swift
swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator"

```

I tried to pass the same params to generate documentation but it didn't help

```swift
swift package generate-documentation -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator"

```

Update:  
After changing the order of the build options the build completes but the documentation is not generated (from Xcode works though)

```swift
swift package -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios15.3-simulator" --allow-writing-to-directory ./docs generate-documentation --target UIEnvironment
Building for debugging...
Build complete! (0.09s)
Generating documentation for 'UIEnvironment'...
Building for debugging...
Build complete! (0.07s)
error: 'UIEnvironment' does not contain any documentable symbols or a DocC catalog and will not produce documentation

```

---

_[View the full topic](https://forums.swift.org/t/swift-docc-plugin-for-swiftpm/54725)._
