मुझे संशोधनों के लिए PHAsset
की जांच करने के दो तरीके मिले हैं और मैंने इसे Gist के रूप में प्रकाशित किया है।
- (void)tb_checkForModificationsWithEditingInputMethodCompletion:(void (^)(BOOL))completion {
PHContentEditingInputRequestOptions *options = [PHContentEditingInputRequestOptions new];
options.canHandleAdjustmentData = ^BOOL(PHAdjustmentData *adjustmentData) { return YES; };
[self requestContentEditingInputWithOptions:options completionHandler:^(PHContentEditingInput *contentEditingInput, NSDictionary *info) {
if (completion) completion(contentEditingInput.adjustmentData != nil);
}];
}
- (void)tb_checkForModificationsWithAssetPathMethodCompletion:(void (^)(BOOL))completion {
PHVideoRequestOptions *options = [PHVideoRequestOptions new];
options.deliveryMode = PHVideoRequestOptionsDeliveryModeFastFormat;
[[PHImageManager defaultManager] requestAVAssetForVideo:self options:options resultHandler:^(AVAsset *asset, AVAudioMix *audioMix, NSDictionary *info) {
if (completion) completion([[asset description] containsString:@"/Mutations/"]);
}];
}
संपादित करें: मैं उस बिंदु पर था जहां मुझे एक छवि के साथ PHAsset के लिए समान कार्यक्षमता की आवश्यकता थी। मैंने इसका इस्तेमाल किया:
- (void)tb_checkForModificationsWithAssetPathMethodCompletion:(void (^)(BOOL))completion {
[self requestContentEditingInputWithOptions:nil completionHandler:^(PHContentEditingInput *contentEditingInput, NSDictionary *info) {
NSString *path = (contentEditingInput.avAsset) ? [contentEditingInput.avAsset description] : contentEditingInput.fullSizeImageURL.path;
completion([path containsString:@"/Mutations/"]);
}];
}
स्रोत
2014-11-03 12:54:47
मैंने प्रश्न अपडेट किया है, मुझे * PHImageRequestOptions * सही तरीके से बनाने के लिए जानकारी चाहिए। –
[प्रलेखन] (https://developer.apple.com/library/IOs/documentation/Photos/Reference/PHAsset_Class/index.html#//apple_ref/occ/instp/PHAsset/modificationDate): 'फोटो संशोधन दिनांक अपडेट करता है जब किसी संपत्ति की छवि या वीडियो सामग्री या मेटाडेटा बदलता है। 'इसलिए जब आप कोई चित्र पसंद करते हैं तो संशोधन दिनांक भी बदल जाएगा। –
क्या आपने उस पर एक परीक्षण किया है? – gabbler