However, these textbooks are more than just formatted text. They're interactive; they are essentially a specialized website of sorts. You can include your own HTML and JS based 'widgets' and presumably use Apple's HTML/JS based widgets. The inclusion of Apple source code embedded in the book I believe would technically make the book a derivative in the way the term is normally used.
Whether I personally believe in my gut if it is right that these books be deemed derivatives is a separate issue.. ;)