Hints Property List
ヒントプロパティリスト
The optional hints property list contains an array of dictionaries with information about each hint. The property list file is called Hints.plist
and is located in the PrivateResources
folder of a page at the following path:
任意のヒントプロパティリストは、各ヒントについての情報を持つディクショナリからなるある配列を含みます。そのプロパティリストはHints.plist
と呼ばれ、以下のバスでのページのPrivateResources
フォルダに位置します:
<book name>.playgroundbook/Contents/<chapter name>.playgroundchapter/Pages/<page name>.playgroundpage/PrivateResources/Hints.plist
You can localize hints by enclosing the hints property list file in a localization folder within the PrivateResources
folder.
あなたは、ヒントプロパティリストファイルをPrivateResources
フォルダ内のローカライズフォルダの中に納めることによってヒントをローカライズできます。
Adding a Hints.plist
file to a page adds a Hint button to the page. A page may have one or more hints. Each hint displays either text in the property list or the contents of a referenced file key. A hint may optionally have a spoiler button, which causes the content of the hint to be hidden until the spoiler button is tapped.
Hints.plist
ファイルをページに加えることは、Hintボタンをそのページに加えます。ページは、ひとつ以上のヒントを持てます。各ヒントは、プロパティリストの中のテキストか、参照されたファイルキーの内容のどちらかを表示します。ヒントは、随意にスポイラーボタンを持てます、それはヒントの内容がスポイラーボタンがタップされるまで隠されるようにします。
Listing 16-1 shows an example Hints
property list.
コード出力 16-1 は、例のHints
プロパティリストを示します。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Hints</key>
<array>
<dict>
<key>Content</key>
<string>This is an inline hint.</string>
</dict>
<dict>
<key>Content</key>
<string>This is an inline hint with a spoiler button.</string>
<key>SpoilerButtonTitle</key>
<string>Show Spoiler</string>
</dict>
<dict>
<key>FileReference</key>
<string>OutOfBandHint.txt</string>
</dict>
<dict>
<key>FileReference</key>
<string>OutOfBandHintWithSpoilerButton.txt</string>
<key>SpoilerButtonTitle</key>
<string>Show Spoiler</string>
</dict>
</array>
</dict>
</plist>
Hints are shown in a popover, in the same order in which they occur in the array. Each hint is represented by a dictionary in the array. Hints are formatted using markup, and no special comment delimiters are required. For more information on markup, see Markup Formatting Reference.
ヒントはポップオーバーにおいて、それらが配列に現れるのと同じ順序で、表示されます。各ヒントは、配列の中の1つのディクショナリによって表されます。ヒントはマークアップを使って書式設定され、特別なコメント区切り記号は必要とされません。マークアップに関するさらなる情報として、Markup Formatting Referenceを見てください。
Key List
キーのリスト
A hint dictionary specifies the text for a hint and an optional spoiler button title.
ヒントディクショナリは、ヒントのためのテキストおよび任意のスポイラーボタンタイトルを指定します。
Each hint dictionary must specify either a Content Key
キー
or a FileReference Key, as shown in Table 16-1.
Key |
Type
|
Description
|
---|---|---|
|
String |
The formatted text for the hint shown in the popover. See Content Key.
|
|
String |
A file in the |
|
String |
The title for a spoiler button. See SpoilerButtonTitle Key.
|
Content Key
Contentキー
The text for the hint shown in the popover. A hint dictionary with a Content
key can't also contain a FileReference
key.
ポップオーバーにおいて表示されるヒントのためのテキスト。Content
キーを持つヒントディクショナリは、さらにまたFileReference
キーを含むことはできません。
FileReference Key
FileReferenceキー
The file path for a text file in the Resources
folder that contains the hint text shown in the popover. The text is formatted using markup, and no special comment delimiters are required. A hint dictionary with a FileReference
key can't also contain a Content
key. The file path is relative to the Resources
folder of the page.
Resources
フォルダの中のあるファイルに対するファイルパスで、ポップオーバーにおいて表示されるヒントテキストを含みます。テキストはマークアップを使って書式設定され、特別なコメント区切り記号は必要とされません。FileReference
キーを持つヒントディクショナリは、さらにまたContent
キーを含むことはできません。ファイルパスはページのResources
フォルダに相対的です。
SpoilerButtonTitle Key
SpoilerButtonTitleキー
The title for a spoiler button. Including this key shows a spoiler button with the specified title in the popover instead of the hint. Touching the spoiler button displays the hint. Any hint can have a spoiler button.
スポイラーボタンのタイトル。このキーを含むことで、ヒントではなくポップオーバーにおいて指定されたタイトルを持つスポイラーボタンが現れます。スポイラーボタンにタッチするとヒントが表示されます。どんなヒントもスポイラーボタンを持つことができます。
Copyright © 2018 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2018-04-30