Whilst we’re here, give this new window a name. In the Identity section, give it the Storyboard ID of “Help Window Controller”. Select the new Window Controller or Window, and switch to the Identity Inspector. Resize that PDF Kit View to fill the view, and set its autoresizing to full so that it grows and shrinks with the whole view and window.įor your code to be able to access the correct window, you now must give it a Storyboard ID. Select the Size Inspector, and resize the Window and then its View to something around 600 x 400, appropriate to the page size of the Help book.īack in the Library window, search using the term “PDF” to locate PDF Kit View, and drag and drop that onto the new View Controller. Then drag its View Controller, which is probably to the right of the new window, down below it. Holding the Option key down, open the Library, and type “Window” into its Find field at the top to locate Window Controller.ĭrag and drop this into the GUI view of your storyboard, to sit adjacent to the app’s existing Window. In your project, open Main.storyboard to add your Help window. If you add the whole folder, it may lead to the PDF file being put inside a Resources folder inside the Resources folder in your app, and the app then won’t be able to find it.Ĭheck that it has been added properly to the project file hierarchy at the left, then increment your app’s version number ready for this new build. Select the PDF file inside the Resources folder rather than the whole folder, as that file needs to appear alongside your Swift source files etc. Then open your project in Xcode, and add that PDF to your project using the Add Files… command in the File menu. Once happy with it, I exported it to PDF.Īrmed with your PDF Help book, create a folder inside your Xcode project named Resources and copy the Help book into that. The first page became a table of contents, with links to each subsequent page, and a return link to its contents page in the footer. To get the page size about right, I set this up with a ‘paper’ size of 184 x 260 mm in landscape orientation, with 0.5 cm side margins and 1 cm at top and bottom, to accommodate header and footer. Here, I used the wonderful Nisus Writer Pro which has a direct command to export to PDF. When your app’s features are stable and you’re looking at shipping it, create its PDF Help book. No doubt its supporters will say that this is even easier using Objective-C too. You can do much the same with almost any Swift app for macOS. In this article, I point a way for this using my PDF viewer sample app as a convenient base. With a bit of thought and careful design, you can create good PDF documentation which is both accessed through an app’s Help menu and can be read directly outside the app. PDF is one solution which has been adopted by many developers. But I like to provide separate PDF documentation too, and find myself maintaining two complete sets of docs for most apps, which is wasteful. For most of my apps, I have been using Help Crafter, which still works very well. There are few tools which create and maintain traditional Help books, and authoring them is becoming quite a pain. It’s becoming increasingly hard to provide apps with good documentation in the form of Help books.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |