Author and share great documentation for your Swift packages and frameworks.

Posts under DocC tag

24 Posts
Sort by:
Post not yet marked as solved
5 Replies
1.2k Views
I've been using Xcode and Objective-C for years, and rely heavily on the built-in documentation, which is for the most part good.There's an issue that's always bothered me. Today I was looking up a function called class_getName. I found its documentation page, and was also able to navigate to the page showing the overview of the runtime system, all of which is fine.When I typed "class_getName" into my program, the compiler immediately flagged it as an unknown symbol.I knew I probably had to include a header, but none of the documentation pages I looked at mentioned the name of the header file. I had to end up searching the internet for examples until I hit one that showed <objc/runtime.h> being imported.Why isn't this very small, simple and extremely useful bit of information included in the documentation?Frank
Posted
by
Post marked as Apple Recommended
4.4k Views
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?
Posted
by
Post not yet marked as solved
2 Replies
1.2k Views
Can DocC exclude some struct like swiftUI previews?
Posted
by
Post not yet marked as solved
2 Replies
701 Views
Hello, everyone. I'm new here, so I'm unsure if this is the right place for this inquiry. I'm Mauricio Paternina, a beginner iOS Developer, interested in bringing Swift Development closer to Spanish speakers. I created the site for the Spanish translation of The Swift Programming Language book (which can check here) and I'm interested in translating the Apple Developer Documentation if that's possible. I noticed that the site already has Korean and Chinese translations. Are those provided by Apple directly or by some Korean/Chinese community members? Is it even possible to consider an initiative to translate into Spanish? I appreciate any information you might be able to provide for me to guide through this initiative.
Posted
by
Post not yet marked as solved
1 Replies
658 Views
Hello, everybody. I'm Mauricio Paternina, an aspiring iOS Developer from Colombia. I have a strong interest in translating the Apple Developer Documentation into Spanish for two reasons: on one hand, I'd be able to dive deeper into the documentation itself and cement my knowledge, and on another hand, non-English speakers will be able to navigate and consume the contents of the Documentation, thus, reaching a wider audience. I'm currently the owner/maintainer of an ongoing effort to translate The Swift Programming Language book into Spanish as well. You can check the live site at https://swiftbook.es/. The site has been accepted by The Swift.org Working Development Group as the "official" Spanish translation and it's currently linked on their website. Back to my initial point, I'd tried reaching out to all possible channels to get guidance on how to request or proceed with this, or at least to know if this is even possible/allowed by Apple and I've found myself with no other clue than posting here hoping to find some clarity. I'd like to thank you in advance for any help you might be able to provide. P.S. I used a random tag for the sake of compliance with the posting requirements.
Posted
by
Post not yet marked as solved
0 Replies
751 Views
I'm trying to find a more efficient way to generate the Apple-style /// code comments in Xcode. Although I can use Cmd + Option + Enter to automatically generate ///, it's not as convenient when copying(press option to select specific area) and pasting code. Is there a more streamlined approach to generate these comments, especially when pasting existing code? It's convenient to generate doc with old /** */
Posted
by
Post not yet marked as solved
1 Replies
621 Views
For some reason, when I try to command + click on a link in certain parts of the documentation, it does not open it in a new tab. Link here: Getting Started with Scrumdinger The incorrect behavior occurs with the first two links: The Basics and Closures Command+Click to open in a new window works in other parts of the page, and every where else in Safari. I have verified that my settings are correct. This is not user error.
Posted
by
Post not yet marked as solved
1 Replies
631 Views
DocC is a documentation compiler. Being a compiler, it would make sense that when moving from the Markdown representation to a HTML representation there would be some intermediate output -- an AST, etc. I am wondering if and how one could get access to the AST, for example, representation of the documentation...?
Posted
by
Post not yet marked as solved
0 Replies
622 Views
Hello! I have a static lib project in Objective-C, in the project I have set... Build Documentation During 'Build' -> Yes Build Multi-Language Documentation for Objective-C ony Targets -> Yes The documentation viewer opens after that, but the target is not present under Objective-C?
Posted
by
Post not yet marked as solved
2 Replies
1k Views
Hi, I see that @_documentation(visibility: ...) is available and I have it working for swift source files when using DocC. My question is how to do the same thing for c source (the .h header files specifically)? I haven't been able to find a way to exclude methods or variables in c code from the documentation DocC creates. I'd also be fine with excluding c header files entirely from DocC. Is this available? If so, how could it be done? Mark
Posted
by
Post not yet marked as solved
1 Replies
1.2k Views
Does anyone know of an ePub link to the 5.9 version of the Swift Programming Language docs? While I appreciate them supporting the documentation in DocC format, it would still nice if I could import an ePub (or PDF) copy into iBooks, for the times that I'm disconnected. Would help with bookmarking as well.
Posted
by
Post marked as solved
3 Replies
810 Views
Intro I have a framework A and its dependency B. I wrote some documentation using DocC syntax for only framework A and would like to compile documentation for only this framework using Xcode and doing the following steps: Choose a right scheme of framework A Product → Build Documentation (⌃ ⇧ ⌘ D) Expected A generated documentation for only framework A. In fact It tries to compile a doc not only for framework A but for dependency B as well. Problem Unknown reason of failure. It happens because Xcode tries to create a doc for dependency B as well. Questions Is there any way to configure the process of building a doc excluding unnecessary files and paths? If 1st question yes, so where and how? Does a selected scheme affect on DocC compiler process at all? Or the compiler tries to handle all sources he has within .xcworkspace including all .xcodeproj and their dependencies inside workspace? Details Build Documentation_2023-10-20.txt.txt FYI Software: Version: Xcode → 15.0 Swift → 5.9 Dependency B (Realm) → 10.43.1 All the best, Ivan. P.S. I'd been happy to see support Markdown's tables here with more rich visual experience.
Posted
by
Post marked as solved
1 Replies
389 Views
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.
Posted
by
Post marked as solved
2 Replies
445 Views
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?
Posted
by
Post not yet marked as solved
0 Replies
325 Views
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
Posted
by
Post not yet marked as solved
1 Replies
356 Views
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?
Posted
by
Post not yet marked as solved
1 Replies
323 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
494 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
310 Views
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?
Posted
by