flashChapterNumber(_:chapterTitle:) Swift documentation has mismatched nullability

Originator:igeek1
Number:rdar://39693485 Date Originated:24-Apr-2018 03:31 PM
Status:Resolved Resolved:July 5 2018, 10:23 PM
Product:Documentation Product Version:Xcode 9.3 (9E145) on macOS 10.13.4 (17E199)
Classification:Other Bug Reproducible:Always
 
Summary:
The documentation for AVPlayerView’s flashChapterNumber(_:chapterTitle:) method shows the type of the chapterTitle parameter as `String`, but the documentation of the chapterTitle parameter says: “The chapter title. This value is optional and can be nil.” From this, it looks like the property is incorrectly annotated to be nonnull, since the intent was for it to be nullable.

Steps to Reproduce:
 

Expected Results:
 

Actual Results:
 

Version:
Xcode 9.3 (9E145) on macOS 10.13.4 (17E199)

Notes:

Comments

message by me

Confirmed in the documentation! I'm not running the beta, but assuming the docs match the code, it's closed as far as I'm concerned.

Apple Developer Relations

Please verify this issue with the macOS Mojave 10.14 beta 3 and update your bug report at https://bugreport.apple.com/ with your results.

macOS 10.14 beta 3 (18A326g)
https://developer.apple.com/download/
Posted Date: July 3rd, 2018

If the issue persists, please attach a new sysdiagnose captured in the latest build and attach it to the bug report.

macOS sysdiagnose Instructions:
https://developer.apple.com/services-account/download?path=/OS_X/OS_X_Logs/sysdiagnose_Logging_Instructions.pdf

____________________________________
For a complete list of logging instructions visit: https://developer.apple.com/bug-reporting/profiles-and-logs/

Apple Developer Relations

Thanks, we are working on the new information you provided. We appreciate your help!

Comment by me

This is not fixed in Xcode 10 beta 2 under High Sierra, even when looking at the 10.14 SDK header files. I have not been able to test it while running under 10.14, however. The header at /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVKit.framework/Versions/A/Headers contains the following:

@interface AVPlayerView (AVPlayerViewChapterIndicator)
  /*!
  @method	flashChapterNumber:chapterTitle:
  @param	chapterNumber
  The chapter number (required).
  @param	chapterTitle
  The chapter title (optional).
  @abstract	Display the provided chapter number and title momentarily.
  */
- (void)flashChapterNumber:(NSUInteger)chapterNumber chapterTitle:(nullable NSString *)chapterTitle;

@end

The chapterTitle parameter is marked as nullable, which is promising. However, the generated Swift interface for the same header contains this:

extension AVPlayerView {
  /*!
  @method	flashChapterNumber:chapterTitle:
  @param	chapterNumber
  The chapter number (required).
  @param	chapterTitle
  The chapter title (optional).
  @abstract	Display the provided chapter number and title momentarily.
  */
  open func flashChapterNumber(_ chapterNumber: Int, chapterTitle: String)
}

The documentation agrees with the Swift interface, marking the parameter as a non-optional String.

Apple Developer Relations - June 19 2018, 3:48 PM

We believe this issue has been resolved in the latest macOS 10.14 beta. Please test with the latest beta. If you still have issues, please update your bug report with any relevant logs or information that could help us investigate.

Apple Developer Relations

A solution is under investigation. We will follow up with you again when it is available.

Comment by me

If the code can't be changed, could the documentation be changed, at least for the Swift version of the docs? It's not a big deal; I was just reporting it because I noticed that it was inconsistent.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!