Hi all,
I am trying to use this guide to link directly to symbols in my documentation. But I am unable to get it to link to an Objective-C enum case. For example
``EnumNameType/EnumNameMyCase``
does not create a link. It works fine for method names, etc. I have tried all of the combinations I can think of, but I can't get it to work.
Any help is much appreciated!
DocC
RSS for tagAuthor and share great documentation for your Swift packages and frameworks.
Posts under DocC tag
16 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
The project setup is as follows:
Uses pods
Has swift bridging header as it uses both Objc and Swift
With Xcode Version 16.0 (16A242d), when building the project everything is fine but when I build the Documentation (Product > Build Documentation), I am getting this error via:
/.../Project/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRLoggerLevel.h:23:28: redefinition of 'FIRLoggerLevel'
...
Building the documentation of the same project with Xcode Version 15.4 works just fine, so the error must come from the new xcodebuild (Xcode 16.0 Build version 16A242d).
Here are the pods in the project:
pod 'Firebase/Crashlytics', '10.29.0'
pod 'Firebase/Performance', '10.29.0'
# (Recommended) Pod for Google Analytics
pod 'FirebaseAnalytics', '10.29.0'
pod 'GoogleAnalytics', '3.21'
pod 'GoogleTagManager', '7.4.3'
pod 'FirebaseRemoteConfig', '10.29.0'
pod 'GoogleUtilities', '7.13.0'
Tried with all latest, but the same issue persists.
Any ideas, on how to resolve this? I read that it is not possible to disable the pods being build by docc as they are dependencies of the target which is being build by the docc process, if that is not true, maybe I can disable docc from building the Pods.
Context
Hello everyone, I'm a freshly graduate engineer currently learning Swift and Apple ecosystem frameworks as I wish to become an Apple Developer / Engineer.
I made a very simple and light Swift package but I cannot build the documentation using DocC.
Issue
See my project here on github and explanations below.
Behavior
Building Documentation for my Swift package results in an empty page with only my Package name.
Adding a documentation catalog with a start page work but only the start page is displayed after building. None of my structs in any sources files appears in the built documentation.
Trying to add symbol linking to my sources files's structs in the start page (using double backquotes) results in the Topic section not built and a warning "MyStruct doesn't exist at '/MyPackage'"
What I tried
I found multiple information while looking for a solution, so I tried everything.
None of my structs / classes have the same name as the package
I did not remove the Topics section in the start page of the documentation catalog, neither I removed the Header 2 formatting.
My documentation catalog and my sources files lies within MyPackage/Sources/MyPackage/
I compared my starting page and folder architecture with the Sloth demo project
I did comment my structs / classes / functions with three slash /// using Xcode shortcut to pre-write documentation
Technical Specifications
macOS 14.5
MacBook Pro M3 Pro 18Go
Xcode Version 15.4 (15F31d)
swift-tools-version: 5.10
Images
Conclusion
I have no idea what else to do and if I am doing something wrong. Any feedback or solution on my issue would be really appreciated as I'm doing my best to learn the best practices to become an Apple developer.
Thank you.
if I want to document my color asset with DocC to help the development team use colors correctly in app development, how can I do it?
p.s. think about when you have to work in a team but there isn't a graphic repository, like Figma or Zeplin
I'm trying to figure out how to build DocC from other frameworks to Xcode's Developer Documentation.
I tried using the build documentation command, and it generates the DocC for my project and displays it in the Developer Documentation, but not libraries in the SPM.
The code documentation does appear in the Developer Documentation, but the contents of the DocC are not shown.
I am working on an sdk project and hope to find interface change information by comparing two doccarchive
Does anyone know of any documentation for the various directives in the guidebook?
Things like @GuideBook, @Guide, @Task, @SuccessMessage, etc.
Thanks,
David
How can I hide "App Frameworks" documentation? Seems like it's just cluttering my documentation, especially since I want to host on a website. O just want my imported documentation.
I want to hide this:
I have a workspace with my project and a Swift Macro. When I use the "Build Documentation" command the build fails with this error:
fatal error: module map file '/Users/me/Library/Developer/Xcode/DerivedData/Project-fmdkuqlofexbqdhhitpgjnoqzyrz/Build/Intermediates.noindex/GeneratedModuleMaps-iphoneos/Macros.modulemap' not found
Is there a way around this?
When performing xcodebuild docbuild I'm getting an error that I'm missing a module map for one of my Swift Packages I've included in the project. This is because I want to build the docbuild for iOS only, but have the Swift Package as a macOS only import
fatal error: module map file '/Users/administrator/Library/Developer/Xcode/DerivedData/AppName/Build/Intermediates.noindex/Build/Intermediates.noindex/GeneratedModuleMaps-iphoneos/SQLite.modulemap' not found
The docbuild is as follows
xcodebuild docbuild \
-scheme *** \
-derivedDataPath ${DD_LOCATION} \
-configuration Release \
-sdk iphoneos \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
BUILD_DIR=${WORKSPACE}/build \
DEVELOPMENT_TEAM=*** \
The Swift package mentioned is added as macOS only with an optional linkage
and I have excluded the paths from source files which makes me able to run the app via xcode.
Is there anything else I should be doing to exclude this from being added to the iOS side of our project? Thanks in advance for any help.
I'm posting on here as this is generic for any Swift Packages which support iOS and macOS but important as a single OS package.
In the case of an entire framework being deprecated, like ML Compute, is there a note left somewhere or a link that helps explain the direction and intended replacement?
When visiting the ML Compute page, there are just lots of "deprecated" badges, but no resource that provides explanation.
Hi, I am working on a visionOS Swift Package.
I'm trying to generate the documentation for preview and export with the following commands, however I keep getting the error:
/Users/chris/myfile.swift:6:8: error: no such module 'UIKit' import UIKit - I'm using UIKit for a color variable.
My Package has:
...
platforms: [.visionOS(.v1)]
...
Failing Commands:
swift package --disable-sandbox preview-documentation
and
PACKAGE_NAME=packageName
REPOSITORY_NAME=repoName
OUTPUT_PATH=./docs
swift package --allow-writing-to-directory $OUTPUT_PATH \
generate-documentation --target $PACKAGE_NAME \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path $REPOSITORY_NAME \
--output-path $OUTPUT_PATH
The documentation does build if I build it from within Xcode's Product->Build Documentation menu
Does anyone have any ideas what's wrong here?
I created a doccarchive that supports objc and swift using xcode build setting DOCC_EXTRACT_SWIFT_INFO_FOR_OBJC_SYMBOLS.
When I made a docc document, I can select objc or swift on Xcode documentation like the yellow box of the below image.
However, when I rendered to a web server, that selection link is gone.
Blue box of the 2nd image works different way with yellow box of 1st image.
The yellow one shows all functions. Even functions not written in that language are converted to other languages and displayed. But the blue one shows functions only written in the selected language.
Rendering follows.. https://developer.apple.com/documentation/xcode/distributing-documentation-to-other-developers#Host-a-documentation-archive-on-your-website
I am reluctant to admit that I only came to know that Swift provides a builtin documentation markup syntax just a few months ago.
/** Test func
Some description here.
- Parameters:
- b:Test
- d: Test
- f: Test
- Returns: Bool
*/
func myMethod(a b:Int, c d:Int, e f:Int) -> Bool { b > d }
It seems the markup is pretty simple and has only a few keywords. But, I want to read through the complete reference. Any useful pointers?
The idea is to make it easer to update documentation when API changes or when code is not correct.
Is it possible to make the code file declared like this:
@Code(name: "AppDelegate.swift", file: AppDelegate.swift)
And the content of the AppDelegate.swift file is:
import UIKit
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
compiler error should be raised here
return true
}
}
After doing "Product > Build Documentation" the output gives the following documentation and there is not warning or errors during the build:
Thank you for your answers.
As presented in the talks and documentation I’ve seen so far, DocC works for public and open Swift symbols. But how about stuff for internal use?
We are developing a fairly complex mixed source SDK with several components, that would benefit greatly from direct integration of auxiliary content for diagrams and so on. But since many of these parts are for internal use only, they have module or below level visibility.
Is there a way to build an internal documentation target that includes this information with DocC, and — if so — how?