Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover Foundation / UIKit extensions in documentation comments #14

Open
mpospese opened this issue Oct 19, 2022 · 0 comments
Open

Cover Foundation / UIKit extensions in documentation comments #14

mpospese opened this issue Oct 19, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@mpospese
Copy link
Contributor

Intro

In our generated documentation, the top-level pages for extensions look very sparse. Like this:
image

By adding documentation comments to public extensions, we could improve the readability of both the source code and the generated documentation. The documentation shown above with extension comments added, becomes this:
image

Task

  1. Add documentation comments to the following public extensions:
  • Foundation/CGFloat+rounded.swift
  • Foundation/CGSize+inset.swift
  • Foundation/String+Localizable.swift
  • UIKit/UIScreen+scaleFactor.swift
  • UIKit/UITraitCollection+colorSpaces.swift
  • UIKit/UIView+constrainEdges.swift (NSDirectionalRectEdge extension only)
  1. Unify how we declare these extensions: move the public declaration to the extension itself and remove it from the individual public methods (any properties/methods declared as internal/private need to remain so) Do this only for the extensions you document in Step 1 above

AC

  • Task (above) completed
  • 0 SwiftLint violations
  • compiles with 0 warnings for iOS and tvOS
  • unit tests pass for iOS and tvOS
  • 100% documentation coverage as per Jazzy

Discussion

Jazzy combines all extended properties / methods from multiple extensions into a single documentation page. e.g. for UIColor we have 8 properties / methods spread across 5 separate extensions but they are all documented together on a single page. In this case Jazzy will not generate documentation for the extension (how would it know to combine the comments from the 5 extensions?). Documenting the extensions still has value though, but for now we will focus on classes that only have a single extension in our package. In a later ticket we can document the multiple extensions for UIColor, UIView, etc.

@mpospese mpospese added the good first issue Good for newcomers label Oct 19, 2022
@mpospese mpospese added the documentation Improvements or additions to documentation label Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Development

No branches or pull requests

1 participant