Instance Method インスタンスメソッド

url(forPublishingUbiquitousItemAt:expiration:)

Returns a URL that can be emailed to users to allow them to download a copy of a flat file item from iCloud. あるURLを返します、それはユーザにEメールされることで、彼らがiCloudからフラットファイル項目のコピーをダウンロードできるようにします。

Declaration 宣言

func url(forPublishingUbiquitousItemAt url: URL, 
expiration outDate: AutoreleasingUnsafeMutablePointer<NSDate?>?) throws -> URL

Parameters パラメータ

url

The URL of the item in the cloud that you want to share. The URL must be prefixed with the base URL returned from the url(forUbiquityContainerIdentifier:) method that corresponds to the item’s location. The file must be a flat file, not a bundle. The file at the specified URL must already be uploaded to iCloud when you call this method. クラウドにおける項目で、あなたが共有を望むもののURL。URLは、項目の場所に相当する、url(forUbiquityContainerIdentifier:)メソッドから返される基底URLで接頭辞を付けられなければなりません。ファイルは、フラットファイルでなければなりません、バンドルでなく。指定されたURLでのファイルは、あなたがこのメソッドを呼び出すとき既にiCloudにアップロードされていなければなりません。

outDate

On input, a pointer to a variable for a date object. On output, this parameter contains the date after which the item is no longer available at the returned URL. You may specify nil for this parameter if you are not interested in the date. 入力では、ある日付オブジェクトに対する変数へのポインタ。出力では、このパラメータは、その後では項目がもはや返されるURLで利用可能でない日付を含みます。あなたは、nilをこのパラメータに対して指定するかもしれません、もしあなたが日付に興味を持たないならば。

Return Value 戻り値

A URL with which users can download a copy of the item at url. それでユーザがurlでの項目のコピーをダウンロードできるURL。

Discussion 議論

This method creates a snapshot of the specified flat file and places that copy in a temporary iCloud location where it can be accessed by other users using the returned URL. The snapshot reflects the contents of the file at the time the URL was generated and is not updated when subsequent changes are made to the original file in the user’s iCloud storage. The snapshot file remains available at the specified URL until the date specified in the outDate parameter, after which it is automatically deleted. Explicitly deleting the item by calling the removeItem(at:) or removeItem(atPath:) method also deletes all old versions of the item, invalidating URLs to those versions returned by this method. このメソッドは、指定されたフラットファイルのスナップショットを作成します、そしてそのコピーを一時iCloud記憶場所に置きます、そこにおいてそれは返されるURLを使っている他のユーザによってアクセス可能です。スナップショットは、URLが生成された当時のファイルの内容を反映します、そしてその後に起こる変更がユーザのiCloudストレージ中の元のファイルになされた場合に更新されません。スナップショットファイルは、outDateパラメータで指定された日付まで、指定されたURLで利用可能なままです、それの後それは自動的に削除されます。removeItem(at:)またはremoveItem(atPath:)メソッドを呼び出すことによって明示的に項目を削除することはまた、項目のすべての古いバージョンを削除して、このメソッドによって返されるそれらのバージョンのURLを無効にします。

Your app must have access to the network for this call to succeed. If the specified file is in the process of being uploaded to iCloud, you must not call this method until the upload has finished. あなたのアプリは、この呼び出しを成功させるためにネットワークにアクセスする必要があります。指定されたファイルがiCloudにアップロードされる処理中ならば、あなたはアップロードが終わってしまうまでこのメソッドを呼びだしてはなりません。

See Also 参照

Managing iCloud-Based Items iCloud基盤の項目を管理する