<commit_before>//
//  DKPhotoGalleryItem.swift
//  DKPhotoGallery
//
//  Created by ZhangAo on 08/09/2017.
//  Copyright © 2017 ZhangAo. All rights reserved.
//

import UIKit
import Photos

public let DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalURL: String = "DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalURL"    // URL.
public let DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalSize: String = "DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalSize"  // (Optional)UInt. The number of bytes of the image.

@objc
public class DKPhotoGalleryItemConstant: NSObject {
    
    @objc public class func extraInfoKeyRemoteImageOriginalURL() -> String {
        return DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalURL
    }
    
    @objc public class func extraInfoKeyRemoteImageOriginalSize() -> String {
        return DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalSize
    }
    
}

//////////////////////////////////////////////////////////////////

@objc
open class DKPhotoGalleryItem: NSObject {
    
    /// The image to be set initially, until the image request finishes.
    @objc open var thumbnail: UIImage?
    
    @objc open var image: UIImage?
    @objc open var imageURL: URL?
    
    @objc open var videoURL: URL?
    @objc open var pdfURL: URL?

    /**
     DKPhotoGallery will automatically decide whether to create ImagePreview or PlayerPreview via the mediaType of the asset.
     
     See more: DKPhotoPreviewFactory.swift
     */
    @objc open var asset: PHAsset?
    @objc open var assetLocalIdentifier: String?
    
    /**
     Used for some optional features.
     
     For ImagePreview, you can enable the original image download feature with a key named DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalURL.
     */
    @objc open var extraInfo: [String: Any]?
    
    @objc convenience public init(image: UIImage) {
        self.init()
        
        self.image = image
    }
    
    @objc convenience public init(imageURL: URL) {
        self.init()
        
        self.imageURL = imageURL
    }
    
    @objc convenience public init(videoURL: URL) {
        self.init()
        
        self.videoURL = videoURL
    }
    
    @objc convenience public init(pdfURL: URL) {
        self.init()
        
        self.pdfURL = pdfURL
    }
<commit_msg>- limit pdf item init for iOS 11 only<commit_after>//
//  DKPhotoGalleryItem.swift
//  DKPhotoGallery
//
//  Created by ZhangAo on 08/09/2017.
//  Copyright © 2017 ZhangAo. All rights reserved.
//

import UIKit
import Photos

public let DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalURL: String = "DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalURL"    // URL.
public let DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalSize: String = "DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalSize"  // (Optional)UInt. The number of bytes of the image.

@objc
public class DKPhotoGalleryItemConstant: NSObject {
    
    @objc public class func extraInfoKeyRemoteImageOriginalURL() -> String {
        return DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalURL
    }
    
    @objc public class func extraInfoKeyRemoteImageOriginalSize() -> String {
        return DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalSize
    }
    
}

//////////////////////////////////////////////////////////////////

@objc
open class DKPhotoGalleryItem: NSObject {
    
    /// The image to be set initially, until the image request finishes.
    @objc open var thumbnail: UIImage?
    
    @objc open var image: UIImage?
    @objc open var imageURL: URL?
    
    @objc open var videoURL: URL?
    
    @objc open var pdfURL: URL?

    /**
     DKPhotoGallery will automatically decide whether to create ImagePreview or PlayerPreview via the mediaType of the asset.
     
     See more: DKPhotoPreviewFactory.swift
     */
    @objc open var asset: PHAsset?
    @objc open var assetLocalIdentifier: String?
    
    /**
     Used for some optional features.
     
     For ImagePreview, you can enable the original image download feature with a key named DKPhotoGalleryItemExtraInfoKeyRemoteImageOriginalURL.
     */
    @objc open var extraInfo: [String: Any]?
    
    @objc convenience public init(image: UIImage) {
        self.init()
        
        self.image = image
    }
    
    @objc convenience public init(imageURL: URL) {
        self.init()
        
        self.imageURL = imageURL
    }
    
    @objc convenience public init(videoURL: URL) {
        self.init()
        
        self.videoURL = videoURL
    }
    
    @available(iOS 11.0, *)
    @objc convenience public init(pdfURL: URL) {
        self.init()
        
        self.pdfURL = pdfURL
    }

{'fraction_non_alphanumeric': 0.09590216691697061, 'fraction_numerical': 0.006221840806693842, 'mean_word_length': 2.4817027632561612, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3505005', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1306, 'n_words': 384}