UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>

Developer documentation in an XCFramework

Forums > iOS

I've spent a while crafting developer documenattion in a framework I have created. Within my test app (in the smae workspace) I get the developer documentation dislayed fine. I then built the XCFramework and used it in another project. In there, I cannot see the documentation. Is there some trick to getting the documentation carried over to the other project? I've tried as many variations on the build process as I can some up with, but nothing seems to work.

If I examine the XCFramework, there is a file called "arm64-apple-ios.swiftdoc" that appears to have the documenattion in it, but Option-Clicking on one of my custom components just tells me there is "No Quick Help".

My build script for the framework is...

echo '*** Delete the iphone archive and rebuild'
rm -r './build/UtilityViews.framework-iphoneos.xcarchive'

echo 'Build the documentation'
xcodebuild docbuild \
-scheme UtilityViews \
-destination 'generic/platform=iOS' \
-quiet

echo 'Build the framework'
xcodebuild archive \
-scheme UtilityViews \
-configuration Release \
-destination 'generic/platform=iOS' \
-archivePath './build/UtilityViews.framework-iphoneos.xcarchive' \
-quiet \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

echo '*** Delete iphone simulator archive and rebuild'
rm -r './build/UtilityViews.framework-iphonesimulator.xcarchive'

echo 'Build the documentation'
xcodebuild docbuild \
-scheme UtilityViews \
-destination 'generic/platform=iOS Simulator' \
-quiet

echo 'Build the framework'
xcodebuild archive \
-scheme UtilityViews \
-configuration Release \
-destination 'generic/platform=iOS Simulator' \
-archivePath './build/UtilityViews.framework-iphonesimulator.xcarchive' \
-quiet \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES

echo '*** Delete xcframework and rebuild'
rm -r './build/UtilityViews.xcframework'
xcodebuild -create-xcframework \
-framework './build/UtilityViews.framework-iphoneos.xcarchive/Products/Library/Frameworks/UtilityViews.framework' \
-framework './build/UtilityViews.framework-iphonesimulator.xcarchive/Products/Library/Frameworks/UtilityViews.framework' \
-output './build/UtilityViews.xcframework'

This is my first attempt at creating a framework, so I'm rather blundering around in the dark. I've tried googling, but everything I find is about building the framework and doesn't go in to the developer documentation side.

Any help is much appreciated. Thanks Steve

3      

Odd, the forum says 2 replies but I can't see any.

3      

Same here, seems an Xcode bug. I created a radar for that: https://openradar.appspot.com/radar?id=5594869200322560

3      

Thank you for this. I lack the confidence to label anything I have problems with as anything more than my own ignorance. So having a second opinion makes all the difference.

3      

Hacking with Swift is sponsored by Essential Developer

SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.