diff --git a/.DS_Store b/.DS_Store new file mode 100755 index 0000000..15705fc Binary files /dev/null and b/.DS_Store differ diff --git a/AFNetworking.framework/.DS_Store b/AFNetworking.framework/.DS_Store new file mode 100755 index 0000000..e700711 Binary files /dev/null and b/AFNetworking.framework/.DS_Store differ diff --git a/AFNetworking.framework/AFNetworking b/AFNetworking.framework/AFNetworking new file mode 100755 index 0000000..924a878 Binary files /dev/null and b/AFNetworking.framework/AFNetworking differ diff --git a/AFNetworking.framework/Headers/AFAutoPurgingImageCache.h b/AFNetworking.framework/Headers/AFAutoPurgingImageCache.h new file mode 100755 index 0000000..9bdc15c --- /dev/null +++ b/AFNetworking.framework/Headers/AFAutoPurgingImageCache.h @@ -0,0 +1,149 @@ +// AFAutoPurgingImageCache.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import + +#if TARGET_OS_IOS || TARGET_OS_TV +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + The `AFImageCache` protocol defines a set of APIs for adding, removing and fetching images from a cache synchronously. + */ +@protocol AFImageCache + +/** + Adds the image to the cache with the given identifier. + + @param image The image to cache. + @param identifier The unique identifier for the image in the cache. + */ +- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier; + +/** + Removes the image from the cache matching the given identifier. + + @param identifier The unique identifier for the image in the cache. + + @return A BOOL indicating whether or not the image was removed from the cache. + */ +- (BOOL)removeImageWithIdentifier:(NSString *)identifier; + +/** + Removes all images from the cache. + + @return A BOOL indicating whether or not all images were removed from the cache. + */ +- (BOOL)removeAllImages; + +/** + Returns the image in the cache associated with the given identifier. + + @param identifier The unique identifier for the image in the cache. + + @return An image for the matching identifier, or nil. + */ +- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier; +@end + + +/** + The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding methods for adding, removing and fetching images from a cache given an `NSURLRequest` and additional identifier. + */ +@protocol AFImageRequestCache + +/** + Adds the image to the cache using an identifier created from the request and additional identifier. + + @param image The image to cache. + @param request The unique URL request identifing the image asset. + @param identifier The additional identifier to apply to the URL request to identify the image. + */ +- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; + +/** + Removes the image from the cache using an identifier created from the request and additional identifier. + + @param request The unique URL request identifing the image asset. + @param identifier The additional identifier to apply to the URL request to identify the image. + + @return A BOOL indicating whether or not all images were removed from the cache. + */ +- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; + +/** + Returns the image from the cache associated with an identifier created from the request and additional identifier. + + @param request The unique URL request identifing the image asset. + @param identifier The additional identifier to apply to the URL request to identify the image. + + @return An image for the matching request and identifier, or nil. + */ +- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier; + +@end + +/** + The `AutoPurgingImageCache` in an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated. + */ +@interface AFAutoPurgingImageCache : NSObject + +/** + The total memory capacity of the cache in bytes. + */ +@property (nonatomic, assign) UInt64 memoryCapacity; + +/** + The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory capacity drops below this limit. + */ +@property (nonatomic, assign) UInt64 preferredMemoryUsageAfterPurge; + +/** + The current total memory usage in bytes of all images stored within the cache. + */ +@property (nonatomic, assign, readonly) UInt64 memoryUsage; + +/** + Initialies the `AutoPurgingImageCache` instance with default values for memory capacity and preferred memory usage after purge limit. `memoryCapcity` defaults to `100 MB`. `preferredMemoryUsageAfterPurge` defaults to `60 MB`. + + @return The new `AutoPurgingImageCache` instance. + */ +- (instancetype)init; + +/** + Initialies the `AutoPurgingImageCache` instance with the given memory capacity and preferred memory usage + after purge limit. + + @param memoryCapacity The total memory capacity of the cache in bytes. + @param preferredMemoryCapacity The preferred memory usage after purge in bytes. + + @return The new `AutoPurgingImageCache` instance. + */ +- (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity; + +@end + +NS_ASSUME_NONNULL_END + +#endif + diff --git a/AFNetworking.framework/Headers/AFHTTPSessionManager.h b/AFNetworking.framework/Headers/AFHTTPSessionManager.h new file mode 100755 index 0000000..5ce279a --- /dev/null +++ b/AFNetworking.framework/Headers/AFHTTPSessionManager.h @@ -0,0 +1,295 @@ +// AFHTTPSessionManager.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#if !TARGET_OS_WATCH +#import +#endif +#import + +#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV +#import +#else +#import +#endif + +#import "AFURLSessionManager.h" + +/** + `AFHTTPSessionManager` is a subclass of `AFURLSessionManager` with convenience methods for making HTTP requests. When a `baseURL` is provided, requests made with the `GET` / `POST` / et al. convenience methods can be made with relative paths. + + ## Subclassing Notes + + Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application. + + For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect. + + ## Methods to Override + + To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:completionHandler:`. + + ## Serialization + + Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to ``. + + Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `` + + ## URL Construction Using Relative Paths + + For HTTP convenience methods, the request serializer constructs URLs from the path relative to the `-baseURL`, using `NSURL +URLWithString:relativeToURL:`, when provided. If `baseURL` is `nil`, `path` needs to resolve to a valid `NSURL` object using `NSURL +URLWithString:`. + + Below are a few examples of how `baseURL` and relative paths interact: + + NSURL *baseURL = [NSURL URLWithString:@"http://example.com/v1/"]; + [NSURL URLWithString:@"foo" relativeToURL:baseURL]; // http://example.com/v1/foo + [NSURL URLWithString:@"foo?bar=baz" relativeToURL:baseURL]; // http://example.com/v1/foo?bar=baz + [NSURL URLWithString:@"/foo" relativeToURL:baseURL]; // http://example.com/foo + [NSURL URLWithString:@"foo/" relativeToURL:baseURL]; // http://example.com/v1/foo + [NSURL URLWithString:@"/foo/" relativeToURL:baseURL]; // http://example.com/foo/ + [NSURL URLWithString:@"http://example2.com/" relativeToURL:baseURL]; // http://example2.com/ + + Also important to note is that a trailing slash will be added to any `baseURL` without one. This would otherwise cause unexpected behavior when constructing URLs using paths without a leading slash. + + @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance. + */ + +NS_ASSUME_NONNULL_BEGIN + +@interface AFHTTPSessionManager : AFURLSessionManager + +/** + The URL used to construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods. + */ +@property (readonly, nonatomic, strong, nullable) NSURL *baseURL; + +/** + Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies. + + @warning `requestSerializer` must not be `nil`. + */ +@property (nonatomic, strong) AFHTTPRequestSerializer * requestSerializer; + +/** + Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`. + + @warning `responseSerializer` must not be `nil`. + */ +@property (nonatomic, strong) AFHTTPResponseSerializer * responseSerializer; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Creates and returns an `AFHTTPSessionManager` object. + */ ++ (instancetype)manager; + +/** + Initializes an `AFHTTPSessionManager` object with the specified base URL. + + @param url The base URL for the HTTP client. + + @return The newly-initialized HTTP client + */ +- (instancetype)initWithBaseURL:(nullable NSURL *)url; + +/** + Initializes an `AFHTTPSessionManager` object with the specified base URL. + + This is the designated initializer. + + @param url The base URL for the HTTP client. + @param configuration The configuration used to create the managed session. + + @return The newly-initialized HTTP client + */ +- (instancetype)initWithBaseURL:(nullable NSURL *)url + sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; + +///--------------------------- +/// @name Making HTTP Requests +///--------------------------- + +/** + Creates and runs an `NSURLSessionDataTask` with a `GET` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; + + +/** + Creates and runs an `NSURLSessionDataTask` with a `GET` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: + */ +- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString + parameters:(nullable id)parameters + progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `HEAD` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; + +/** + Creates and runs an `NSURLSessionDataTask` with a `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + constructingBodyWithBlock:(nullable void (^)(id formData))block + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; + +/** + Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. + @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: + */ +- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString + parameters:(nullable id)parameters + constructingBodyWithBlock:(nullable void (^)(id formData))block + progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `PUT` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `PATCH` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +/** + Creates and runs an `NSURLSessionDataTask` with a `DELETE` request. + + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded according to the client request serializer. + @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. + @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. + + @see -dataTaskWithRequest:completionHandler: + */ +- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString + parameters:(nullable id)parameters + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; + +@end + +NS_ASSUME_NONNULL_END diff --git a/AFNetworking.framework/Headers/AFImageDownloader.h b/AFNetworking.framework/Headers/AFImageDownloader.h new file mode 100755 index 0000000..3903eec --- /dev/null +++ b/AFNetworking.framework/Headers/AFImageDownloader.h @@ -0,0 +1,157 @@ +// AFImageDownloader.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import +#import "AFAutoPurgingImageCache.h" +#import "AFHTTPSessionManager.h" + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) { + AFImageDownloadPrioritizationFIFO, + AFImageDownloadPrioritizationLIFO +}; + +/** + The `AFImageDownloadReceipt` is an object vended by the `AFImageDownloader` when starting a data task. It can be used to cancel active tasks running on the `AFImageDownloader` session. As a general rule, image data tasks should be cancelled using the `AFImageDownloadReceipt` instead of calling `cancel` directly on the `task` itself. The `AFImageDownloader` is optimized to handle duplicate task scenarios as well as pending versus active downloads. + */ +@interface AFImageDownloadReceipt : NSObject + +/** + The data task created by the `AFImageDownloader`. +*/ +@property (nonatomic, strong) NSURLSessionDataTask *task; + +/** + The unique identifier for the success and failure blocks when duplicate requests are made. + */ +@property (nonatomic, strong) NSUUID *receiptID; +@end + +/** The `AFImageDownloader` class is responsible for downloading images in parallel on a prioritized queue. Incoming downloads are added to the front or back of the queue depending on the download prioritization. Each downloaded image is cached in the underlying `NSURLCache` as well as the in-memory image cache. By default, any download request with a cached image equivalent in the image cache will automatically be served the cached image representation. + */ +@interface AFImageDownloader : NSObject + +/** + The image cache used to store all downloaded images in. `AFAutoPurgingImageCache` by default. + */ +@property (nonatomic, strong, nullable) id imageCache; + +/** + The `AFHTTPSessionManager` used to download images. By default, this is configured with an `AFImageResponseSerializer`, and a shared `NSURLCache` for all image downloads. + */ +@property (nonatomic, strong) AFHTTPSessionManager *sessionManager; + +/** + Defines the order prioritization of incoming download requests being inserted into the queue. `AFImageDownloadPrioritizationFIFO` by default. + */ +@property (nonatomic, assign) AFImageDownloadPrioritization downloadPrioritizaton; + +/** + The shared default instance of `AFImageDownloader` initialized with default values. + */ ++ (instancetype)defaultInstance; + +/** + Creates a default `NSURLCache` with common usage parameter values. + + @returns The default `NSURLCache` instance. + */ ++ (NSURLCache *)defaultURLCache; + +/** + Default initializer + + @return An instance of `AFImageDownloader` initialized with default values. + */ +- (instancetype)init; + +/** + Initializes the `AFImageDownloader` instance with the given session manager, download prioritization, maximum active download count and image cache. + + @param sessionManager The session manager to use to download images. + @param downloadPrioritization The download prioritization of the download queue. + @param maximumActiveDownloads The maximum number of active downloads allowed at any given time. Recommend `4`. + @param imageCache The image cache used to store all downloaded images in. + + @return The new `AFImageDownloader` instance. + */ +- (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager + downloadPrioritization:(AFImageDownloadPrioritization)downloadPrioritization + maximumActiveDownloads:(NSInteger)maximumActiveDownloads + imageCache:(nullable id )imageCache; + +/** + Creates a data task using the `sessionManager` instance for the specified URL request. + + If the same data task is already in the queue or currently being downloaded, the success and failure blocks are + appended to the already existing task. Once the task completes, all success or failure blocks attached to the + task are executed in the order they were added. + + @param request The URL request. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + + @return The image download receipt for the data task if available. `nil` if the image is stored in the cache. + cache and the URL request cache policy allows the cache to be used. + */ +- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + +/** + Creates a data task using the `sessionManager` instance for the specified URL request. + + If the same data task is already in the queue or currently being downloaded, the success and failure blocks are + appended to the already existing task. Once the task completes, all success or failure blocks attached to the + task are executed in the order they were added. + + @param request The URL request. + @param receiptID The identifier to use for the download receipt that will be created for this request. This must be a unique identifier that does not represent any other request. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + + @return The image download receipt for the data task if available. `nil` if the image is stored in the cache. + cache and the URL request cache policy allows the cache to be used. + */ +- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request + withReceiptID:(NSUUID *)receiptID + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *responseObject))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + +/** + Cancels the data task in the receipt by removing the corresponding success and failure blocks and cancelling the data task if necessary. + + If the data task is pending in the queue, it will be cancelled if no other success and failure blocks are registered with the data task. If the data task is currently executing or is already completed, the success and failure blocks are removed and will not be called when the task finishes. + + @param imageDownloadReceipt The image download receipt to cancel. + */ +- (void)cancelTaskForImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt; + +@end + +#endif + +NS_ASSUME_NONNULL_END diff --git a/AFNetworking.framework/Headers/AFNetworkActivityIndicatorManager.h b/AFNetworking.framework/Headers/AFNetworkActivityIndicatorManager.h new file mode 100755 index 0000000..3bcf289 --- /dev/null +++ b/AFNetworking.framework/Headers/AFNetworkActivityIndicatorManager.h @@ -0,0 +1,103 @@ +// AFNetworkActivityIndicatorManager.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#import + +#if TARGET_OS_IOS + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a session task has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero. + + You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code: + + [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES]; + + By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself. + + See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information: + http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44 + */ +NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.") +@interface AFNetworkActivityIndicatorManager : NSObject + +/** + A Boolean value indicating whether the manager is enabled. + + If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO. + */ +@property (nonatomic, assign, getter = isEnabled) BOOL enabled; + +/** + A Boolean value indicating whether the network activity indicator manager is currently active. +*/ +@property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible; + +/** + A time interval indicating the minimum duration of networking activity that should occur before the activity indicator is displayed. The default value 1 second. If the network activity indicator should be displayed immediately when network activity occurs, this value should be set to 0 seconds. + + Apple's HIG describes the following: + + > Display the network activity indicator to provide feedback when your app accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator is likely to disappear before users notice its presence. + + */ +@property (nonatomic, assign) NSTimeInterval activationDelay; + +/** + A time interval indicating the duration of time of no networking activity required before the activity indicator is disabled. This allows for continuous display of the network activity indicator across multiple requests. The default value is 0.17 seconds. + */ + +@property (nonatomic, assign) NSTimeInterval completionDelay; + +/** + Returns the shared network activity indicator manager object for the system. + + @return The systemwide network activity indicator manager. + */ ++ (instancetype)sharedManager; + +/** + Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator. + */ +- (void)incrementActivityCount; + +/** + Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator. + */ +- (void)decrementActivityCount; + +/** + Set the a custom method to be executed when the network activity indicator manager should be hidden/shown. By default, this is null, and the UIApplication Network Activity Indicator will be managed automatically. If this block is set, it is the responsiblity of the caller to manager the network activity indicator going forward. + + @param block A block to be executed when the network activity indicator status changes. + */ +- (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/AFNetworking.framework/Headers/AFNetworkReachabilityManager.h b/AFNetworking.framework/Headers/AFNetworkReachabilityManager.h new file mode 100755 index 0000000..0feb18d --- /dev/null +++ b/AFNetworking.framework/Headers/AFNetworkReachabilityManager.h @@ -0,0 +1,206 @@ +// AFNetworkReachabilityManager.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#if !TARGET_OS_WATCH +#import + +typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) { + AFNetworkReachabilityStatusUnknown = -1, + AFNetworkReachabilityStatusNotReachable = 0, + AFNetworkReachabilityStatusReachableViaWWAN = 1, + AFNetworkReachabilityStatusReachableViaWiFi = 2, +}; + +NS_ASSUME_NONNULL_BEGIN + +/** + `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces. + + Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability. + + See Apple's Reachability Sample Code ( https://developer.apple.com/library/ios/samplecode/reachability/ ) + + @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined. + */ +@interface AFNetworkReachabilityManager : NSObject + +/** + The current network reachability status. + */ +@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus; + +/** + Whether or not the network is currently reachable. + */ +@property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable; + +/** + Whether or not the network is currently reachable via WWAN. + */ +@property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN; + +/** + Whether or not the network is currently reachable via WiFi. + */ +@property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Returns the shared network reachability manager. + */ ++ (instancetype)sharedManager; + +/** + Creates and returns a network reachability manager with the default socket address. + + @return An initialized network reachability manager, actively monitoring the default socket address. + */ ++ (instancetype)manager; + +/** + Creates and returns a network reachability manager for the specified domain. + + @param domain The domain used to evaluate network reachability. + + @return An initialized network reachability manager, actively monitoring the specified domain. + */ ++ (instancetype)managerForDomain:(NSString *)domain; + +/** + Creates and returns a network reachability manager for the socket address. + + @param address The socket address (`sockaddr_in6`) used to evaluate network reachability. + + @return An initialized network reachability manager, actively monitoring the specified socket address. + */ ++ (instancetype)managerForAddress:(const void *)address; + +/** + Initializes an instance of a network reachability manager from the specified reachability object. + + @param reachability The reachability object to monitor. + + @return An initialized network reachability manager, actively monitoring the specified reachability. + */ +- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER; + +///-------------------------------------------------- +/// @name Starting & Stopping Reachability Monitoring +///-------------------------------------------------- + +/** + Starts monitoring for changes in network reachability status. + */ +- (void)startMonitoring; + +/** + Stops monitoring for changes in network reachability status. + */ +- (void)stopMonitoring; + +///------------------------------------------------- +/// @name Getting Localized Reachability Description +///------------------------------------------------- + +/** + Returns a localized string representation of the current network reachability status. + */ +- (NSString *)localizedNetworkReachabilityStatusString; + +///--------------------------------------------------- +/// @name Setting Network Reachability Change Callback +///--------------------------------------------------- + +/** + Sets a callback to be executed when the network availability of the `baseURL` host changes. + + @param block A block object to be executed when the network availability of the `baseURL` host changes.. This block has no return value and takes a single argument which represents the various reachability states from the device to the `baseURL`. + */ +- (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block; + +@end + +///---------------- +/// @name Constants +///---------------- + +/** + ## Network Reachability + + The following constants are provided by `AFNetworkReachabilityManager` as possible network reachability statuses. + + enum { + AFNetworkReachabilityStatusUnknown, + AFNetworkReachabilityStatusNotReachable, + AFNetworkReachabilityStatusReachableViaWWAN, + AFNetworkReachabilityStatusReachableViaWiFi, + } + + `AFNetworkReachabilityStatusUnknown` + The `baseURL` host reachability is not known. + + `AFNetworkReachabilityStatusNotReachable` + The `baseURL` host cannot be reached. + + `AFNetworkReachabilityStatusReachableViaWWAN` + The `baseURL` host can be reached via a cellular connection, such as EDGE or GPRS. + + `AFNetworkReachabilityStatusReachableViaWiFi` + The `baseURL` host can be reached via a Wi-Fi connection. + + ### Keys for Notification UserInfo Dictionary + + Strings that are used as keys in a `userInfo` dictionary in a network reachability status change notification. + + `AFNetworkingReachabilityNotificationStatusItem` + A key in the userInfo dictionary in a `AFNetworkingReachabilityDidChangeNotification` notification. + The corresponding value is an `NSNumber` object representing the `AFNetworkReachabilityStatus` value for the current reachability status. + */ + +///-------------------- +/// @name Notifications +///-------------------- + +/** + Posted when network reachability changes. + This notification assigns no notification object. The `userInfo` dictionary contains an `NSNumber` object under the `AFNetworkingReachabilityNotificationStatusItem` key, representing the `AFNetworkReachabilityStatus` value for the current network reachability. + + @warning In order for network reachability to be monitored, include the `SystemConfiguration` framework in the active target's "Link Binary With Library" build phase, and add `#import ` to the header prefix of the project (`Prefix.pch`). + */ +FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityDidChangeNotification; +FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusItem; + +///-------------------- +/// @name Functions +///-------------------- + +/** + Returns a localized string representation of an `AFNetworkReachabilityStatus` value. + */ +FOUNDATION_EXPORT NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status); + +NS_ASSUME_NONNULL_END +#endif diff --git a/AFNetworking.framework/Headers/AFNetworking.h b/AFNetworking.framework/Headers/AFNetworking.h new file mode 100755 index 0000000..468fd72 --- /dev/null +++ b/AFNetworking.framework/Headers/AFNetworking.h @@ -0,0 +1,66 @@ +// AFNetworking.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +//! Project version number for AFNetworking. +FOUNDATION_EXPORT double AFNetworkingVersionNumber; + +//! Project version string for AFNetworking. +FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import + +#ifndef _AFNETWORKING_ +#define _AFNETWORKING_ + +#import +#import +#import + +#if !TARGET_OS_WATCH +#import +#endif + +#import +#import + +#if TARGET_OS_IOS || TARGET_OS_TV +#import +#import +#import +#import +#import +#import +#import +#endif + +#if TARGET_OS_IOS +#import +#import +#import +#endif + + +#endif /* _AFNETWORKING_ */ diff --git a/AFNetworking.framework/Headers/AFSecurityPolicy.h b/AFNetworking.framework/Headers/AFSecurityPolicy.h new file mode 100755 index 0000000..c005efa --- /dev/null +++ b/AFNetworking.framework/Headers/AFSecurityPolicy.h @@ -0,0 +1,154 @@ +// AFSecurityPolicy.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import + +typedef NS_ENUM(NSUInteger, AFSSLPinningMode) { + AFSSLPinningModeNone, + AFSSLPinningModePublicKey, + AFSSLPinningModeCertificate, +}; + +/** + `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections. + + Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled. + */ + +NS_ASSUME_NONNULL_BEGIN + +@interface AFSecurityPolicy : NSObject + +/** + The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`. + */ +@property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode; + +/** + The certificates used to evaluate server trust according to the SSL pinning mode. + + By default, this property is set to any (`.cer`) certificates included in the target compiling AFNetworking. Note that if you are using AFNetworking as embedded framework, no certificates will be pinned by default. Use `certificatesInBundle` to load certificates from your target, and then create a new policy by calling `policyWithPinningMode:withPinnedCertificates`. + + Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches. + */ +@property (nonatomic, strong, nullable) NSSet *pinnedCertificates; + +/** + Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`. + */ +@property (nonatomic, assign) BOOL allowInvalidCertificates; + +/** + Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`. + */ +@property (nonatomic, assign) BOOL validatesDomainName; + +///----------------------------------------- +/// @name Getting Certificates from the Bundle +///----------------------------------------- + +/** + Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`. + + @return The certificates included in the given bundle. + */ ++ (NSSet *)certificatesInBundle:(NSBundle *)bundle; + +///----------------------------------------- +/// @name Getting Specific Security Policies +///----------------------------------------- + +/** + Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys. + + @return The default security policy. + */ ++ (instancetype)defaultPolicy; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Creates and returns a security policy with the specified pinning mode. + + @param pinningMode The SSL pinning mode. + + @return A new security policy. + */ ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode; + +/** + Creates and returns a security policy with the specified pinning mode. + + @param pinningMode The SSL pinning mode. + @param pinnedCertificates The certificates to pin against. + + @return A new security policy. + */ ++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet *)pinnedCertificates; + +///------------------------------ +/// @name Evaluating Server Trust +///------------------------------ + +/** + Whether or not the specified server trust should be accepted, based on the security policy. + + This method should be used when responding to an authentication challenge from a server. + + @param serverTrust The X.509 certificate trust of the server. + @param domain The domain of serverTrust. If `nil`, the domain will not be validated. + + @return Whether or not to trust the server. + */ +- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust + forDomain:(nullable NSString *)domain; + +@end + +NS_ASSUME_NONNULL_END + +///---------------- +/// @name Constants +///---------------- + +/** + ## SSL Pinning Modes + + The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes. + + enum { + AFSSLPinningModeNone, + AFSSLPinningModePublicKey, + AFSSLPinningModeCertificate, + } + + `AFSSLPinningModeNone` + Do not used pinned certificates to validate servers. + + `AFSSLPinningModePublicKey` + Validate host certificates against public keys of pinned certificates. + + `AFSSLPinningModeCertificate` + Validate host certificates against pinned certificates. +*/ diff --git a/AFNetworking.framework/Headers/AFURLRequestSerialization.h b/AFNetworking.framework/Headers/AFURLRequestSerialization.h new file mode 100755 index 0000000..694696b --- /dev/null +++ b/AFNetworking.framework/Headers/AFURLRequestSerialization.h @@ -0,0 +1,479 @@ +// AFURLRequestSerialization.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import + +#if TARGET_OS_IOS || TARGET_OS_TV +#import +#elif TARGET_OS_WATCH +#import +#endif + +NS_ASSUME_NONNULL_BEGIN + +/** + Returns a percent-escaped string following RFC 3986 for a query string key or value. + RFC 3986 states that the following characters are "reserved" characters. + - General Delimiters: ":", "#", "[", "]", "@", "?", "/" + - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" + + In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow + query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" + should be percent-escaped in the query string. + + @param string The string to be percent-escaped. + + @return The percent-escaped string. + */ +FOUNDATION_EXPORT NSString * AFPercentEscapedStringFromString(NSString *string); + +/** + A helper method to generate encoded url query parameters for appending to the end of a URL. + + @param parameters A dictionary of key/values to be encoded. + + @return A url encoded query string + */ +FOUNDATION_EXPORT NSString * AFQueryStringFromParameters(NSDictionary *parameters); + +/** + The `AFURLRequestSerialization` protocol is adopted by an object that encodes parameters for a specified HTTP requests. Request serializers may encode parameters as query strings, HTTP bodies, setting the appropriate HTTP header fields as necessary. + + For example, a JSON request serializer may set the HTTP body of the request to a JSON representation, and set the `Content-Type` HTTP header field value to `application/json`. + */ +@protocol AFURLRequestSerialization + +/** + Returns a request with the specified parameters encoded into a copy of the original request. + + @param request The original request. + @param parameters The parameters to be encoded. + @param error The error that occurred while attempting to encode the request parameters. + + @return A serialized request. + */ +- (nullable NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(nullable id)parameters + error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW; + +@end + +#pragma mark - + +/** + + */ +typedef NS_ENUM(NSUInteger, AFHTTPRequestQueryStringSerializationStyle) { + AFHTTPRequestQueryStringDefaultStyle = 0, +}; + +@protocol AFMultipartFormData; + +/** + `AFHTTPRequestSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation. + + Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPRequestSerializer` in order to ensure consistent default behavior. + */ +@interface AFHTTPRequestSerializer : NSObject + +/** + The string encoding used to serialize parameters. `NSUTF8StringEncoding` by default. + */ +@property (nonatomic, assign) NSStringEncoding stringEncoding; + +/** + Whether created requests can use the device’s cellular radio (if present). `YES` by default. + + @see NSMutableURLRequest -setAllowsCellularAccess: + */ +@property (nonatomic, assign) BOOL allowsCellularAccess; + +/** + The cache policy of created requests. `NSURLRequestUseProtocolCachePolicy` by default. + + @see NSMutableURLRequest -setCachePolicy: + */ +@property (nonatomic, assign) NSURLRequestCachePolicy cachePolicy; + +/** + Whether created requests should use the default cookie handling. `YES` by default. + + @see NSMutableURLRequest -setHTTPShouldHandleCookies: + */ +@property (nonatomic, assign) BOOL HTTPShouldHandleCookies; + +/** + Whether created requests can continue transmitting data before receiving a response from an earlier transmission. `NO` by default + + @see NSMutableURLRequest -setHTTPShouldUsePipelining: + */ +@property (nonatomic, assign) BOOL HTTPShouldUsePipelining; + +/** + The network service type for created requests. `NSURLNetworkServiceTypeDefault` by default. + + @see NSMutableURLRequest -setNetworkServiceType: + */ +@property (nonatomic, assign) NSURLRequestNetworkServiceType networkServiceType; + +/** + The timeout interval, in seconds, for created requests. The default timeout interval is 60 seconds. + + @see NSMutableURLRequest -setTimeoutInterval: + */ +@property (nonatomic, assign) NSTimeInterval timeoutInterval; + +///--------------------------------------- +/// @name Configuring HTTP Request Headers +///--------------------------------------- + +/** + Default HTTP header field values to be applied to serialized requests. By default, these include the following: + + - `Accept-Language` with the contents of `NSLocale +preferredLanguages` + - `User-Agent` with the contents of various bundle identifiers and OS designations + + @discussion To add or remove default request headers, use `setValue:forHTTPHeaderField:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *HTTPRequestHeaders; + +/** + Creates and returns a serializer with default configuration. + */ ++ (instancetype)serializer; + +/** + Sets the value for the HTTP headers set in request objects made by the HTTP client. If `nil`, removes the existing value for that header. + + @param field The HTTP header to set a default value for + @param value The value set as default for the specified header, or `nil` + */ +- (void)setValue:(nullable NSString *)value +forHTTPHeaderField:(NSString *)field; + +/** + Returns the value for the HTTP headers set in the request serializer. + + @param field The HTTP header to retrieve the default value for + + @return The value set as default for the specified header, or `nil` + */ +- (nullable NSString *)valueForHTTPHeaderField:(NSString *)field; + +/** + Sets the "Authorization" HTTP header set in request objects made by the HTTP client to a basic authentication value with Base64-encoded username and password. This overwrites any existing value for this header. + + @param username The HTTP basic auth username + @param password The HTTP basic auth password + */ +- (void)setAuthorizationHeaderFieldWithUsername:(NSString *)username + password:(NSString *)password; + +/** + Clears any existing value for the "Authorization" HTTP header. + */ +- (void)clearAuthorizationHeader; + +///------------------------------------------------------- +/// @name Configuring Query String Parameter Serialization +///------------------------------------------------------- + +/** + HTTP methods for which serialized requests will encode parameters as a query string. `GET`, `HEAD`, and `DELETE` by default. + */ +@property (nonatomic, strong) NSSet *HTTPMethodsEncodingParametersInURI; + +/** + Set the method of query string serialization according to one of the pre-defined styles. + + @param style The serialization style. + + @see AFHTTPRequestQueryStringSerializationStyle + */ +- (void)setQueryStringSerializationWithStyle:(AFHTTPRequestQueryStringSerializationStyle)style; + +/** + Set the a custom method of query string serialization according to the specified block. + + @param block A block that defines a process of encoding parameters into a query string. This block returns the query string and takes three arguments: the request, the parameters to encode, and the error that occurred when attempting to encode parameters for the given request. + */ +- (void)setQueryStringSerializationWithBlock:(nullable NSString * (^)(NSURLRequest *request, id parameters, NSError * __autoreleasing *error))block; + +///------------------------------- +/// @name Creating Request Objects +///------------------------------- + +/** + Creates an `NSMutableURLRequest` object with the specified HTTP method and URL string. + + If the HTTP method is `GET`, `HEAD`, or `DELETE`, the parameters will be used to construct a url-encoded query string that is appended to the request's URL. Otherwise, the parameters will be encoded according to the value of the `parameterEncoding` property, and set as the request body. + + @param method The HTTP method for the request, such as `GET`, `POST`, `PUT`, or `DELETE`. This parameter must not be `nil`. + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be either set as a query string for `GET` requests, or the request HTTP body. + @param error The error that occurred while constructing the request. + + @return An `NSMutableURLRequest` object. + */ +- (NSMutableURLRequest *)requestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(nullable id)parameters + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Creates an `NSMutableURLRequest` object with the specified HTTP method and URLString, and constructs a `multipart/form-data` HTTP body, using the specified parameters and multipart form data block. See http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.2 + + Multipart form requests are automatically streamed, reading files directly from disk along with in-memory data in a single HTTP body. The resulting `NSMutableURLRequest` object has an `HTTPBodyStream` property, so refrain from setting `HTTPBodyStream` or `HTTPBody` on this request object, as it will clear out the multipart form body stream. + + @param method The HTTP method for the request. This parameter must not be `GET` or `HEAD`, or `nil`. + @param URLString The URL string used to create the request URL. + @param parameters The parameters to be encoded and set in the request HTTP body. + @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. + @param error The error that occurred while constructing the request. + + @return An `NSMutableURLRequest` object + */ +- (NSMutableURLRequest *)multipartFormRequestWithMethod:(NSString *)method + URLString:(NSString *)URLString + parameters:(nullable NSDictionary *)parameters + constructingBodyWithBlock:(nullable void (^)(id formData))block + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Creates an `NSMutableURLRequest` by removing the `HTTPBodyStream` from a request, and asynchronously writing its contents into the specified file, invoking the completion handler when finished. + + @param request The multipart form request. The `HTTPBodyStream` property of `request` must not be `nil`. + @param fileURL The file URL to write multipart form contents to. + @param handler A handler block to execute. + + @discussion There is a bug in `NSURLSessionTask` that causes requests to not send a `Content-Length` header when streaming contents from an HTTP body, which is notably problematic when interacting with the Amazon S3 webservice. As a workaround, this method takes a request constructed with `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:error:`, or any other request with an `HTTPBodyStream`, writes the contents to the specified file and returns a copy of the original request with the `HTTPBodyStream` property set to `nil`. From here, the file can either be passed to `AFURLSessionManager -uploadTaskWithRequest:fromFile:progress:completionHandler:`, or have its contents read into an `NSData` that's assigned to the `HTTPBody` property of the request. + + @see https://github.com/AFNetworking/AFNetworking/issues/1398 + */ +- (NSMutableURLRequest *)requestWithMultipartFormRequest:(NSURLRequest *)request + writingStreamContentsToFile:(NSURL *)fileURL + completionHandler:(nullable void (^)(NSError * _Nullable error))handler; + +@end + +#pragma mark - + +/** + The `AFMultipartFormData` protocol defines the methods supported by the parameter in the block argument of `AFHTTPRequestSerializer -multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:`. + */ +@protocol AFMultipartFormData + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{generated filename}; name=#{name}"` and `Content-Type: #{generated mimeType}`, followed by the encoded file data and the multipart form boundary. + + The filename and MIME type for this data in the form will be automatically generated, using the last path component of the `fileURL` and system associated MIME type for the `fileURL` extension, respectively. + + @param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + @param error If an error occurs, upon return contains an `NSError` object that describes the problem. + + @return `YES` if the file data was successfully appended, otherwise `NO`. + */ +- (BOOL)appendPartWithFileURL:(NSURL *)fileURL + name:(NSString *)name + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary. + + @param fileURL The URL corresponding to the file whose content will be appended to the form. This parameter must not be `nil`. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + @param fileName The file name to be used in the `Content-Disposition` header. This parameter must not be `nil`. + @param mimeType The declared MIME type of the file data. This parameter must not be `nil`. + @param error If an error occurs, upon return contains an `NSError` object that describes the problem. + + @return `YES` if the file data was successfully appended otherwise `NO`. + */ +- (BOOL)appendPartWithFileURL:(NSURL *)fileURL + name:(NSString *)name + fileName:(NSString *)fileName + mimeType:(NSString *)mimeType + error:(NSError * _Nullable __autoreleasing *)error; + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the data from the input stream and the multipart form boundary. + + @param inputStream The input stream to be appended to the form data + @param name The name to be associated with the specified input stream. This parameter must not be `nil`. + @param fileName The filename to be associated with the specified input stream. This parameter must not be `nil`. + @param length The length of the specified input stream in bytes. + @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`. + */ +- (void)appendPartWithInputStream:(nullable NSInputStream *)inputStream + name:(NSString *)name + fileName:(NSString *)fileName + length:(int64_t)length + mimeType:(NSString *)mimeType; + +/** + Appends the HTTP header `Content-Disposition: file; filename=#{filename}; name=#{name}"` and `Content-Type: #{mimeType}`, followed by the encoded file data and the multipart form boundary. + + @param data The data to be encoded and appended to the form data. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + @param fileName The filename to be associated with the specified data. This parameter must not be `nil`. + @param mimeType The MIME type of the specified data. (For example, the MIME type for a JPEG image is image/jpeg.) For a list of valid MIME types, see http://www.iana.org/assignments/media-types/. This parameter must not be `nil`. + */ +- (void)appendPartWithFileData:(NSData *)data + name:(NSString *)name + fileName:(NSString *)fileName + mimeType:(NSString *)mimeType; + +/** + Appends the HTTP headers `Content-Disposition: form-data; name=#{name}"`, followed by the encoded data and the multipart form boundary. + + @param data The data to be encoded and appended to the form data. + @param name The name to be associated with the specified data. This parameter must not be `nil`. + */ + +- (void)appendPartWithFormData:(NSData *)data + name:(NSString *)name; + + +/** + Appends HTTP headers, followed by the encoded data and the multipart form boundary. + + @param headers The HTTP headers to be appended to the form data. + @param body The data to be encoded and appended to the form data. This parameter must not be `nil`. + */ +- (void)appendPartWithHeaders:(nullable NSDictionary *)headers + body:(NSData *)body; + +/** + Throttles request bandwidth by limiting the packet size and adding a delay for each chunk read from the upload stream. + + When uploading over a 3G or EDGE connection, requests may fail with "request body stream exhausted". Setting a maximum packet size and delay according to the recommended values (`kAFUploadStream3GSuggestedPacketSize` and `kAFUploadStream3GSuggestedDelay`) lowers the risk of the input stream exceeding its allocated bandwidth. Unfortunately, there is no definite way to distinguish between a 3G, EDGE, or LTE connection over `NSURLConnection`. As such, it is not recommended that you throttle bandwidth based solely on network reachability. Instead, you should consider checking for the "request body stream exhausted" in a failure block, and then retrying the request with throttled bandwidth. + + @param numberOfBytes Maximum packet size, in number of bytes. The default packet size for an input stream is 16kb. + @param delay Duration of delay each time a packet is read. By default, no delay is set. + */ +- (void)throttleBandwidthWithPacketSize:(NSUInteger)numberOfBytes + delay:(NSTimeInterval)delay; + +@end + +#pragma mark - + +/** + `AFJSONRequestSerializer` is a subclass of `AFHTTPRequestSerializer` that encodes parameters as JSON using `NSJSONSerialization`, setting the `Content-Type` of the encoded request to `application/json`. + */ +@interface AFJSONRequestSerializer : AFHTTPRequestSerializer + +/** + Options for writing the request JSON data from Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONWritingOptions". `0` by default. + */ +@property (nonatomic, assign) NSJSONWritingOptions writingOptions; + +/** + Creates and returns a JSON serializer with specified reading and writing options. + + @param writingOptions The specified JSON writing options. + */ ++ (instancetype)serializerWithWritingOptions:(NSJSONWritingOptions)writingOptions; + +@end + +#pragma mark - + +/** + `AFPropertyListRequestSerializer` is a subclass of `AFHTTPRequestSerializer` that encodes parameters as JSON using `NSPropertyListSerializer`, setting the `Content-Type` of the encoded request to `application/x-plist`. + */ +@interface AFPropertyListRequestSerializer : AFHTTPRequestSerializer + +/** + The property list format. Possible values are described in "NSPropertyListFormat". + */ +@property (nonatomic, assign) NSPropertyListFormat format; + +/** + @warning The `writeOptions` property is currently unused. + */ +@property (nonatomic, assign) NSPropertyListWriteOptions writeOptions; + +/** + Creates and returns a property list serializer with a specified format, read options, and write options. + + @param format The property list format. + @param writeOptions The property list write options. + + @warning The `writeOptions` property is currently unused. + */ ++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format + writeOptions:(NSPropertyListWriteOptions)writeOptions; + +@end + +#pragma mark - + +///---------------- +/// @name Constants +///---------------- + +/** + ## Error Domains + + The following error domain is predefined. + + - `NSString * const AFURLRequestSerializationErrorDomain` + + ### Constants + + `AFURLRequestSerializationErrorDomain` + AFURLRequestSerializer errors. Error codes for `AFURLRequestSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFURLRequestSerializationErrorDomain; + +/** + ## User info dictionary keys + + These keys may exist in the user info dictionary, in addition to those defined for NSError. + + - `NSString * const AFNetworkingOperationFailingURLRequestErrorKey` + + ### Constants + + `AFNetworkingOperationFailingURLRequestErrorKey` + The corresponding value is an `NSURLRequest` containing the request of the operation associated with an error. This key is only present in the `AFURLRequestSerializationErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLRequestErrorKey; + +/** + ## Throttling Bandwidth for HTTP Request Input Streams + + @see -throttleBandwidthWithPacketSize:delay: + + ### Constants + + `kAFUploadStream3GSuggestedPacketSize` + Maximum packet size, in number of bytes. Equal to 16kb. + + `kAFUploadStream3GSuggestedDelay` + Duration of delay each time a packet is read. Equal to 0.2 seconds. + */ +FOUNDATION_EXPORT NSUInteger const kAFUploadStream3GSuggestedPacketSize; +FOUNDATION_EXPORT NSTimeInterval const kAFUploadStream3GSuggestedDelay; + +NS_ASSUME_NONNULL_END diff --git a/AFNetworking.framework/Headers/AFURLResponseSerialization.h b/AFNetworking.framework/Headers/AFURLResponseSerialization.h new file mode 100755 index 0000000..a9430ad --- /dev/null +++ b/AFNetworking.framework/Headers/AFURLResponseSerialization.h @@ -0,0 +1,311 @@ +// AFURLResponseSerialization.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data. + + For example, a JSON response serializer may check for an acceptable status code (`2XX` range) and content type (`application/json`), decoding a valid JSON response into an object. + */ +@protocol AFURLResponseSerialization + +/** + The response object decoded from the data associated with a specified response. + + @param response The response to be processed. + @param data The response data to be decoded. + @param error The error that occurred while attempting to decode the response data. + + @return The object decoded from the specified response data. + */ +- (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response + data:(nullable NSData *)data + error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW; + +@end + +#pragma mark - + +/** + `AFHTTPResponseSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation. + + Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPResponseSerializer` in order to ensure consistent default behavior. + */ +@interface AFHTTPResponseSerializer : NSObject + +- (instancetype)init; + +/** + The string encoding used to serialize data received from the server, when no string encoding is specified by the response. `NSUTF8StringEncoding` by default. + */ +@property (nonatomic, assign) NSStringEncoding stringEncoding; + +/** + Creates and returns a serializer with default configuration. + */ ++ (instancetype)serializer; + +///----------------------------------------- +/// @name Configuring Response Serialization +///----------------------------------------- + +/** + The acceptable HTTP status codes for responses. When non-`nil`, responses with status codes not contained by the set will result in an error during validation. + + See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html + */ +@property (nonatomic, copy, nullable) NSIndexSet *acceptableStatusCodes; + +/** + The acceptable MIME types for responses. When non-`nil`, responses with a `Content-Type` with MIME types that do not intersect with the set will result in an error during validation. + */ +@property (nonatomic, copy, nullable) NSSet *acceptableContentTypes; + +/** + Validates the specified response and data. + + In its base implementation, this method checks for an acceptable status code and content type. Subclasses may wish to add other domain-specific checks. + + @param response The response to be validated. + @param data The data associated with the response. + @param error The error that occurred while attempting to validate the response. + + @return `YES` if the response is valid, otherwise `NO`. + */ +- (BOOL)validateResponse:(nullable NSHTTPURLResponse *)response + data:(nullable NSData *)data + error:(NSError * _Nullable __autoreleasing *)error; + +@end + +#pragma mark - + + +/** + `AFJSONResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes JSON responses. + + By default, `AFJSONResponseSerializer` accepts the following MIME types, which includes the official standard, `application/json`, as well as other commonly-used types: + + - `application/json` + - `text/json` + - `text/javascript` + */ +@interface AFJSONResponseSerializer : AFHTTPResponseSerializer + +- (instancetype)init; + +/** + Options for reading the response JSON data and creating the Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. + */ +@property (nonatomic, assign) NSJSONReadingOptions readingOptions; + +/** + Whether to remove keys with `NSNull` values from response JSON. Defaults to `NO`. + */ +@property (nonatomic, assign) BOOL removesKeysWithNullValues; + +/** + Creates and returns a JSON serializer with specified reading and writing options. + + @param readingOptions The specified JSON reading options. + */ ++ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions; + +@end + +#pragma mark - + +/** + `AFXMLParserResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLParser` objects. + + By default, `AFXMLParserResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types: + + - `application/xml` + - `text/xml` + */ +@interface AFXMLParserResponseSerializer : AFHTTPResponseSerializer + +@end + +#pragma mark - + +#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED + +/** + `AFXMLDocumentResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects. + + By default, `AFXMLDocumentResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types: + + - `application/xml` + - `text/xml` + */ +@interface AFXMLDocumentResponseSerializer : AFHTTPResponseSerializer + +- (instancetype)init; + +/** + Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default. + */ +@property (nonatomic, assign) NSUInteger options; + +/** + Creates and returns an XML document serializer with the specified options. + + @param mask The XML document options. + */ ++ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask; + +@end + +#endif + +#pragma mark - + +/** + `AFPropertyListResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects. + + By default, `AFPropertyListResponseSerializer` accepts the following MIME types: + + - `application/x-plist` + */ +@interface AFPropertyListResponseSerializer : AFHTTPResponseSerializer + +- (instancetype)init; + +/** + The property list format. Possible values are described in "NSPropertyListFormat". + */ +@property (nonatomic, assign) NSPropertyListFormat format; + +/** + The property list reading options. Possible values are described in "NSPropertyListMutabilityOptions." + */ +@property (nonatomic, assign) NSPropertyListReadOptions readOptions; + +/** + Creates and returns a property list serializer with a specified format, read options, and write options. + + @param format The property list format. + @param readOptions The property list reading options. + */ ++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format + readOptions:(NSPropertyListReadOptions)readOptions; + +@end + +#pragma mark - + +/** + `AFImageResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes image responses. + + By default, `AFImageResponseSerializer` accepts the following MIME types, which correspond to the image formats supported by UIImage or NSImage: + + - `image/tiff` + - `image/jpeg` + - `image/gif` + - `image/png` + - `image/ico` + - `image/x-icon` + - `image/bmp` + - `image/x-bmp` + - `image/x-xbitmap` + - `image/x-win-bitmap` + */ +@interface AFImageResponseSerializer : AFHTTPResponseSerializer + +#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH +/** + The scale factor used when interpreting the image data to construct `responseImage`. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance. + */ +@property (nonatomic, assign) CGFloat imageScale; + +/** + Whether to automatically inflate response image data for compressed formats (such as PNG or JPEG). Enabling this can significantly improve drawing performance on iOS when used with `setCompletionBlockWithSuccess:failure:`, as it allows a bitmap representation to be constructed in the background rather than on the main thread. `YES` by default. + */ +@property (nonatomic, assign) BOOL automaticallyInflatesResponseImage; +#endif + +@end + +#pragma mark - + +/** + `AFCompoundSerializer` is a subclass of `AFHTTPResponseSerializer` that delegates the response serialization to the first `AFHTTPResponseSerializer` object that returns an object for `responseObjectForResponse:data:error:`, falling back on the default behavior of `AFHTTPResponseSerializer`. This is useful for supporting multiple potential types and structures of server responses with a single serializer. + */ +@interface AFCompoundResponseSerializer : AFHTTPResponseSerializer + +/** + The component response serializers. + */ +@property (readonly, nonatomic, copy) NSArray > *responseSerializers; + +/** + Creates and returns a compound serializer comprised of the specified response serializers. + + @warning Each response serializer specified must be a subclass of `AFHTTPResponseSerializer`, and response to `-validateResponse:data:error:`. + */ ++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray > *)responseSerializers; + +@end + +///---------------- +/// @name Constants +///---------------- + +/** + ## Error Domains + + The following error domain is predefined. + + - `NSString * const AFURLResponseSerializationErrorDomain` + + ### Constants + + `AFURLResponseSerializationErrorDomain` + AFURLResponseSerializer errors. Error codes for `AFURLResponseSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFURLResponseSerializationErrorDomain; + +/** + ## User info dictionary keys + + These keys may exist in the user info dictionary, in addition to those defined for NSError. + + - `NSString * const AFNetworkingOperationFailingURLResponseErrorKey` + - `NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey` + + ### Constants + + `AFNetworkingOperationFailingURLResponseErrorKey` + The corresponding value is an `NSURLResponse` containing the response of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`. + + `AFNetworkingOperationFailingURLResponseDataErrorKey` + The corresponding value is an `NSData` containing the original data of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseErrorKey; + +FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey; + +NS_ASSUME_NONNULL_END diff --git a/AFNetworking.framework/Headers/AFURLSessionManager.h b/AFNetworking.framework/Headers/AFURLSessionManager.h new file mode 100755 index 0000000..89909fe --- /dev/null +++ b/AFNetworking.framework/Headers/AFURLSessionManager.h @@ -0,0 +1,500 @@ +// AFURLSessionManager.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + + +#import + +#import "AFURLResponseSerialization.h" +#import "AFURLRequestSerialization.h" +#import "AFSecurityPolicy.h" +#if !TARGET_OS_WATCH +#import "AFNetworkReachabilityManager.h" +#endif + +/** + `AFURLSessionManager` creates and manages an `NSURLSession` object based on a specified `NSURLSessionConfiguration` object, which conforms to ``, ``, ``, and ``. + + ## Subclassing Notes + + This is the base class for `AFHTTPSessionManager`, which adds functionality specific to making HTTP requests. If you are looking to extend `AFURLSessionManager` specifically for HTTP, consider subclassing `AFHTTPSessionManager` instead. + + ## NSURLSession & NSURLSessionTask Delegate Methods + + `AFURLSessionManager` implements the following delegate methods: + + ### `NSURLSessionDelegate` + + - `URLSession:didBecomeInvalidWithError:` + - `URLSession:didReceiveChallenge:completionHandler:` + - `URLSessionDidFinishEventsForBackgroundURLSession:` + + ### `NSURLSessionTaskDelegate` + + - `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:` + - `URLSession:task:didReceiveChallenge:completionHandler:` + - `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:` + - `URLSession:task:needNewBodyStream:` + - `URLSession:task:didCompleteWithError:` + + ### `NSURLSessionDataDelegate` + + - `URLSession:dataTask:didReceiveResponse:completionHandler:` + - `URLSession:dataTask:didBecomeDownloadTask:` + - `URLSession:dataTask:didReceiveData:` + - `URLSession:dataTask:willCacheResponse:completionHandler:` + + ### `NSURLSessionDownloadDelegate` + + - `URLSession:downloadTask:didFinishDownloadingToURL:` + - `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:` + - `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:` + + If any of these methods are overridden in a subclass, they _must_ call the `super` implementation first. + + ## Network Reachability Monitoring + + Network reachability status and change monitoring is available through the `reachabilityManager` property. Applications may choose to monitor network reachability conditions in order to prevent or suspend any outbound requests. See `AFNetworkReachabilityManager` for more details. + + ## NSCoding Caveats + + - Encoded managers do not include any block properties. Be sure to set delegate callback blocks when using `-initWithCoder:` or `NSKeyedUnarchiver`. + + ## NSCopying Caveats + + - `-copy` and `-copyWithZone:` return a new manager with a new `NSURLSession` created from the configuration of the original. + - Operation copies do not include any delegate callback blocks, as they often strongly captures a reference to `self`, which would otherwise have the unintuitive side-effect of pointing to the _original_ session manager when copied. + + @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance. + */ + +NS_ASSUME_NONNULL_BEGIN + +@interface AFURLSessionManager : NSObject + +/** + The managed session. + */ +@property (readonly, nonatomic, strong) NSURLSession *session; + +/** + The operation queue on which delegate callbacks are run. + */ +@property (readonly, nonatomic, strong) NSOperationQueue *operationQueue; + +/** + Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`. + + @warning `responseSerializer` must not be `nil`. + */ +@property (nonatomic, strong) id responseSerializer; + +///------------------------------- +/// @name Managing Security Policy +///------------------------------- + +/** + The security policy used by created session to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified. + */ +@property (nonatomic, strong) AFSecurityPolicy *securityPolicy; + +#if !TARGET_OS_WATCH +///-------------------------------------- +/// @name Monitoring Network Reachability +///-------------------------------------- + +/** + The network reachability manager. `AFURLSessionManager` uses the `sharedManager` by default. + */ +@property (readwrite, nonatomic, strong) AFNetworkReachabilityManager *reachabilityManager; +#endif + +///---------------------------- +/// @name Getting Session Tasks +///---------------------------- + +/** + The data, upload, and download tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *tasks; + +/** + The data tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *dataTasks; + +/** + The upload tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *uploadTasks; + +/** + The download tasks currently run by the managed session. + */ +@property (readonly, nonatomic, strong) NSArray *downloadTasks; + +///------------------------------- +/// @name Managing Callback Queues +///------------------------------- + +/** + The dispatch queue for `completionBlock`. If `NULL` (default), the main queue is used. + */ +@property (nonatomic, strong, nullable) dispatch_queue_t completionQueue; + +/** + The dispatch group for `completionBlock`. If `NULL` (default), a private dispatch group is used. + */ +@property (nonatomic, strong, nullable) dispatch_group_t completionGroup; + +///--------------------------------- +/// @name Working Around System Bugs +///--------------------------------- + +/** + Whether to attempt to retry creation of upload tasks for background sessions when initial call returns `nil`. `NO` by default. + + @bug As of iOS 7.0, there is a bug where upload tasks created for background tasks are sometimes `nil`. As a workaround, if this property is `YES`, AFNetworking will follow Apple's recommendation to try creating the task again. + + @see https://github.com/AFNetworking/AFNetworking/issues/1675 + */ +@property (nonatomic, assign) BOOL attemptsToRecreateUploadTasksForBackgroundSessions; + +///--------------------- +/// @name Initialization +///--------------------- + +/** + Creates and returns a manager for a session created with the specified configuration. This is the designated initializer. + + @param configuration The configuration used to create the managed session. + + @return A manager for a newly-created session. + */ +- (instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; + +/** + Invalidates the managed session, optionally canceling pending tasks. + + @param cancelPendingTasks Whether or not to cancel pending tasks. + */ +- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks; + +///------------------------- +/// @name Running Data Tasks +///------------------------- + +/** + Creates an `NSURLSessionDataTask` with the specified request. + + @param request The HTTP request for the request. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionDataTask` with the specified request. + + @param request The HTTP request for the request. + @param uploadProgressBlock A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param downloadProgressBlock A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request + uploadProgress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock + downloadProgress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +///--------------------------- +/// @name Running Upload Tasks +///--------------------------- + +/** + Creates an `NSURLSessionUploadTask` with the specified request for a local file. + + @param request The HTTP request for the request. + @param fileURL A URL to the local file to be uploaded. + @param uploadProgressBlock A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + + @see `attemptsToRecreateUploadTasksForBackgroundSessions` + */ +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromFile:(NSURL *)fileURL + progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionUploadTask` with the specified request for an HTTP body. + + @param request The HTTP request for the request. + @param bodyData A data object containing the HTTP body to be uploaded. + @param uploadProgressBlock A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request + fromData:(nullable NSData *)bodyData + progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionUploadTask` with the specified streaming request. + + @param request The HTTP request for the request. + @param uploadProgressBlock A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. + @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. + */ +- (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request + progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgressBlock + completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler; + +///----------------------------- +/// @name Running Download Tasks +///----------------------------- + +/** + Creates an `NSURLSessionDownloadTask` with the specified request. + + @param request The HTTP request for the request. + @param downloadProgressBlock A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL. + @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any. + + @warning If using a background `NSURLSessionConfiguration` on iOS, these blocks will be lost when the app is terminated. Background sessions may prefer to use `-setDownloadTaskDidFinishDownloadingBlock:` to specify the URL for saving the downloaded file, rather than the destination block of this method. + */ +- (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request + progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock + destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler; + +/** + Creates an `NSURLSessionDownloadTask` with the specified resume data. + + @param resumeData The data used to resume downloading. + @param downloadProgressBlock A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. + @param destination A block object to be executed in order to determine the destination of the downloaded file. This block takes two arguments, the target path & the server response, and returns the desired file URL of the resulting download. The temporary file used during the download will be automatically deleted after being moved to the returned URL. + @param completionHandler A block to be executed when a task finishes. This block has no return value and takes three arguments: the server response, the path of the downloaded file, and the error describing the network or parsing error that occurred, if any. + */ +- (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData + progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgressBlock + destination:(nullable NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination + completionHandler:(nullable void (^)(NSURLResponse *response, NSURL * _Nullable filePath, NSError * _Nullable error))completionHandler; + +///--------------------------------- +/// @name Getting Progress for Tasks +///--------------------------------- + +/** + Returns the upload progress of the specified task. + + @param task The session task. Must not be `nil`. + + @return An `NSProgress` object reporting the upload progress of a task, or `nil` if the progress is unavailable. + */ +- (nullable NSProgress *)uploadProgressForTask:(NSURLSessionTask *)task; + +/** + Returns the download progress of the specified task. + + @param task The session task. Must not be `nil`. + + @return An `NSProgress` object reporting the download progress of a task, or `nil` if the progress is unavailable. + */ +- (nullable NSProgress *)downloadProgressForTask:(NSURLSessionTask *)task; + +///----------------------------------------- +/// @name Setting Session Delegate Callbacks +///----------------------------------------- + +/** + Sets a block to be executed when the managed session becomes invalid, as handled by the `NSURLSessionDelegate` method `URLSession:didBecomeInvalidWithError:`. + + @param block A block object to be executed when the managed session becomes invalid. The block has no return value, and takes two arguments: the session, and the error related to the cause of invalidation. + */ +- (void)setSessionDidBecomeInvalidBlock:(nullable void (^)(NSURLSession *session, NSError *error))block; + +/** + Sets a block to be executed when a connection level authentication challenge has occurred, as handled by the `NSURLSessionDelegate` method `URLSession:didReceiveChallenge:completionHandler:`. + + @param block A block object to be executed when a connection level authentication challenge has occurred. The block returns the disposition of the authentication challenge, and takes three arguments: the session, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. + */ +- (void)setSessionDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; + +///-------------------------------------- +/// @name Setting Task Delegate Callbacks +///-------------------------------------- + +/** + Sets a block to be executed when a task requires a new request body stream to send to the remote server, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:needNewBodyStream:`. + + @param block A block object to be executed when a task requires a new request body stream. + */ +- (void)setTaskNeedNewBodyStreamBlock:(nullable NSInputStream * (^)(NSURLSession *session, NSURLSessionTask *task))block; + +/** + Sets a block to be executed when an HTTP request is attempting to perform a redirection to a different URL, as handled by the `NSURLSessionTaskDelegate` method `URLSession:willPerformHTTPRedirection:newRequest:completionHandler:`. + + @param block A block object to be executed when an HTTP request is attempting to perform a redirection to a different URL. The block returns the request to be made for the redirection, and takes four arguments: the session, the task, the redirection response, and the request corresponding to the redirection response. + */ +- (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block; + +/** + Sets a block to be executed when a session task has received a request specific authentication challenge, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didReceiveChallenge:completionHandler:`. + + @param block A block object to be executed when a session task has received a request specific authentication challenge. The block returns the disposition of the authentication challenge, and takes four arguments: the session, the task, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. + */ +- (void)setTaskDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block; + +/** + Sets a block to be executed periodically to track upload progress, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:`. + + @param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes five arguments: the session, the task, the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times, and will execute on the main thread. + */ +- (void)setTaskDidSendBodyDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block; + +/** + Sets a block to be executed as the last message related to a specific task, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didCompleteWithError:`. + + @param block A block object to be executed when a session task is completed. The block has no return value, and takes three arguments: the session, the task, and any error that occurred in the process of executing the task. + */ +- (void)setTaskDidCompleteBlock:(nullable void (^)(NSURLSession *session, NSURLSessionTask *task, NSError * _Nullable error))block; + +///------------------------------------------- +/// @name Setting Data Task Delegate Callbacks +///------------------------------------------- + +/** + Sets a block to be executed when a data task has received a response, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveResponse:completionHandler:`. + + @param block A block object to be executed when a data task has received a response. The block returns the disposition of the session response, and takes three arguments: the session, the data task, and the received response. + */ +- (void)setDataTaskDidReceiveResponseBlock:(nullable NSURLSessionResponseDisposition (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLResponse *response))block; + +/** + Sets a block to be executed when a data task has become a download task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didBecomeDownloadTask:`. + + @param block A block object to be executed when a data task has become a download task. The block has no return value, and takes three arguments: the session, the data task, and the download task it has become. + */ +- (void)setDataTaskDidBecomeDownloadTaskBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSURLSessionDownloadTask *downloadTask))block; + +/** + Sets a block to be executed when a data task receives data, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:didReceiveData:`. + + @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the session, the data task, and the data received. This block may be called multiple times, and will execute on the session manager operation queue. + */ +- (void)setDataTaskDidReceiveDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSData *data))block; + +/** + Sets a block to be executed to determine the caching behavior of a data task, as handled by the `NSURLSessionDataDelegate` method `URLSession:dataTask:willCacheResponse:completionHandler:`. + + @param block A block object to be executed to determine the caching behavior of a data task. The block returns the response to cache, and takes three arguments: the session, the data task, and the proposed cached URL response. + */ +- (void)setDataTaskWillCacheResponseBlock:(nullable NSCachedURLResponse * (^)(NSURLSession *session, NSURLSessionDataTask *dataTask, NSCachedURLResponse *proposedResponse))block; + +/** + Sets a block to be executed once all messages enqueued for a session have been delivered, as handled by the `NSURLSessionDataDelegate` method `URLSessionDidFinishEventsForBackgroundURLSession:`. + + @param block A block object to be executed once all messages enqueued for a session have been delivered. The block has no return value and takes a single argument: the session. + */ +- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block; + +///----------------------------------------------- +/// @name Setting Download Task Delegate Callbacks +///----------------------------------------------- + +/** + Sets a block to be executed when a download task has completed a download, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didFinishDownloadingToURL:`. + + @param block A block object to be executed when a download task has completed. The block returns the URL the download should be moved to, and takes three arguments: the session, the download task, and the temporary location of the downloaded file. If the file manager encounters an error while attempting to move the temporary file to the destination, an `AFURLSessionDownloadTaskDidFailToMoveFileNotification` will be posted, with the download task as its object, and the user info of the error. + */ +- (void)setDownloadTaskDidFinishDownloadingBlock:(nullable NSURL * _Nullable (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, NSURL *location))block; + +/** + Sets a block to be executed periodically to track download progress, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesWritten:totalBytesExpectedToWrite:`. + + @param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes five arguments: the session, the download task, the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times, and will execute on the session manager operation queue. + */ +- (void)setDownloadTaskDidWriteDataBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t bytesWritten, int64_t totalBytesWritten, int64_t totalBytesExpectedToWrite))block; + +/** + Sets a block to be executed when a download task has been resumed, as handled by the `NSURLSessionDownloadDelegate` method `URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:`. + + @param block A block object to be executed when a download task has been resumed. The block has no return value and takes four arguments: the session, the download task, the file offset of the resumed download, and the total number of bytes expected to be downloaded. + */ +- (void)setDownloadTaskDidResumeBlock:(nullable void (^)(NSURLSession *session, NSURLSessionDownloadTask *downloadTask, int64_t fileOffset, int64_t expectedTotalBytes))block; + +@end + +///-------------------- +/// @name Notifications +///-------------------- + +/** + Posted when a task resumes. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidResumeNotification; + +/** + Posted when a task finishes executing. Includes a userInfo dictionary with additional information about the task. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteNotification; + +/** + Posted when a task suspends its execution. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidSuspendNotification; + +/** + Posted when a session is invalidated. + */ +FOUNDATION_EXPORT NSString * const AFURLSessionDidInvalidateNotification; + +/** + Posted when a session download task encountered an error when moving the temporary download file to a specified destination. + */ +FOUNDATION_EXPORT NSString * const AFURLSessionDownloadTaskDidFailToMoveFileNotification; + +/** + The raw response data of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if response data exists for the task. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseDataKey; + +/** + The serialized response object of the task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the response was serialized. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteSerializedResponseKey; + +/** + The response serializer used to serialize the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if the task has an associated response serializer. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteResponseSerializerKey; + +/** + The file path associated with the download task. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an the response data has been stored directly to disk. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteAssetPathKey; + +/** + Any error associated with the task, or the serialization of the response. Included in the userInfo dictionary of the `AFNetworkingTaskDidCompleteNotification` if an error exists. + */ +FOUNDATION_EXPORT NSString * const AFNetworkingTaskDidCompleteErrorKey; + +NS_ASSUME_NONNULL_END diff --git a/AFNetworking.framework/Headers/UIActivityIndicatorView+AFNetworking.h b/AFNetworking.framework/Headers/UIActivityIndicatorView+AFNetworking.h new file mode 100755 index 0000000..d424c9b --- /dev/null +++ b/AFNetworking.framework/Headers/UIActivityIndicatorView+AFNetworking.h @@ -0,0 +1,48 @@ +// UIActivityIndicatorView+AFNetworking.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +/** + This category adds methods to the UIKit framework's `UIActivityIndicatorView` class. The methods in this category provide support for automatically starting and stopping animation depending on the loading state of a session task. + */ +@interface UIActivityIndicatorView (AFNetworking) + +///---------------------------------- +/// @name Animating for Session Tasks +///---------------------------------- + +/** + Binds the animating state to the state of the specified task. + + @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. + */ +- (void)setAnimatingWithStateOfTask:(nullable NSURLSessionTask *)task; + +@end + +#endif diff --git a/AFNetworking.framework/Headers/UIButton+AFNetworking.h b/AFNetworking.framework/Headers/UIButton+AFNetworking.h new file mode 100755 index 0000000..d33e0d4 --- /dev/null +++ b/AFNetworking.framework/Headers/UIButton+AFNetworking.h @@ -0,0 +1,175 @@ +// UIButton+AFNetworking.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFImageDownloader; + +/** + This category adds methods to the UIKit framework's `UIButton` class. The methods in this category provide support for loading remote images and background images asynchronously from a URL. + + @warning Compound values for control `state` (such as `UIControlStateHighlighted | UIControlStateDisabled`) are unsupported. + */ +@interface UIButton (AFNetworking) + +///------------------------------------ +/// @name Accessing the Image Downloader +///------------------------------------ + +/** + Set the shared image downloader used to download images. + + @param imageDownloader The shared image downloader used to download images. +*/ ++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; + +/** + The shared image downloader used to download images. + */ ++ (AFImageDownloader *)sharedImageDownloader; + +///-------------------- +/// @name Setting Image +///-------------------- + +/** + Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the image request. + */ +- (void)setImageForState:(UIControlState)state + withURL:(NSURL *)url; + +/** + Asynchronously downloads an image from the specified URL, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes. + */ +- (void)setImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage; + +/** + Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setImage:forState:` is applied. + + @param state The control state. + @param urlRequest The URL request used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the button will not change its image until the image request finishes. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + */ +- (void)setImageForState:(UIControlState)state + withURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + + +///------------------------------- +/// @name Setting Background Image +///------------------------------- + +/** + Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous background image request for the receiver will be cancelled. + + If the background image is cached locally, the background image is set immediately, otherwise the specified placeholder background image will be set immediately, and then the remote background image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the background image request. + */ +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url; + +/** + Asynchronously downloads an image from the specified URL, and sets it as the background image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + @param state The control state. + @param url The URL used for the background image request. + @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes. + */ +- (void)setBackgroundImageForState:(UIControlState)state + withURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage; + +/** + Asynchronously downloads an image from the specified URL request, and sets it as the image for the specified state once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + If a success block is specified, it is the responsibility of the block to set the image of the button before returning. If no success block is specified, the default behavior of setting the image with `setBackgroundImage:forState:` is applied. + + @param state The control state. + @param urlRequest The URL request used for the image request. + @param placeholderImage The background image to be set initially, until the background image request finishes. If `nil`, the button will not change its background image until the background image request finishes. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + */ +- (void)setBackgroundImageForState:(UIControlState)state + withURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + + +///------------------------------ +/// @name Canceling Image Loading +///------------------------------ + +/** + Cancels any executing image task for the specified control state of the receiver, if one exists. + + @param state The control state. + */ +- (void)cancelImageDownloadTaskForState:(UIControlState)state; + +/** + Cancels any executing background image task for the specified control state of the receiver, if one exists. + + @param state The control state. + */ +- (void)cancelBackgroundImageDownloadTaskForState:(UIControlState)state; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/AFNetworking.framework/Headers/UIImage+AFNetworking.h b/AFNetworking.framework/Headers/UIImage+AFNetworking.h new file mode 100755 index 0000000..14744cd --- /dev/null +++ b/AFNetworking.framework/Headers/UIImage+AFNetworking.h @@ -0,0 +1,35 @@ +// +// UIImage+AFNetworking.h +// +// +// Created by Paulo Ferreira on 08/07/15. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +@interface UIImage (AFNetworking) + ++ (UIImage*) safeImageWithData:(NSData*)data; + +@end + +#endif diff --git a/AFNetworking.framework/Headers/UIImageView+AFNetworking.h b/AFNetworking.framework/Headers/UIImageView+AFNetworking.h new file mode 100755 index 0000000..8929252 --- /dev/null +++ b/AFNetworking.framework/Headers/UIImageView+AFNetworking.h @@ -0,0 +1,109 @@ +// UIImageView+AFNetworking.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFImageDownloader; + +/** + This category adds methods to the UIKit framework's `UIImageView` class. The methods in this category provide support for loading remote images asynchronously from a URL. + */ +@interface UIImageView (AFNetworking) + +///------------------------------------ +/// @name Accessing the Image Downloader +///------------------------------------ + +/** + Set the shared image downloader used to download images. + + @param imageDownloader The shared image downloader used to download images. + */ ++ (void)setSharedImageDownloader:(AFImageDownloader *)imageDownloader; + +/** + The shared image downloader used to download images. + */ ++ (AFImageDownloader *)sharedImageDownloader; + +///-------------------- +/// @name Setting Image +///-------------------- + +/** + Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` + + @param url The URL used for the image request. + */ +- (void)setImageWithURL:(NSURL *)url; + +/** + Asynchronously downloads an image from the specified URL, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + By default, URL requests have a `Accept` header field value of "image / *", a cache policy of `NSURLCacheStorageAllowed` and a timeout interval of 30 seconds, and are set not handle cookies. To configure URL requests differently, use `setImageWithURLRequest:placeholderImage:success:failure:` + + @param url The URL used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. + */ +- (void)setImageWithURL:(NSURL *)url + placeholderImage:(nullable UIImage *)placeholderImage; + +/** + Asynchronously downloads an image from the specified URL request, and sets it once the request is finished. Any previous image request for the receiver will be cancelled. + + If the image is cached locally, the image is set immediately, otherwise the specified placeholder image will be set immediately, and then the remote image will be set once the request is finished. + + If a success block is specified, it is the responsibility of the block to set the image of the image view before returning. If no success block is specified, the default behavior of setting the image with `self.image = image` is applied. + + @param urlRequest The URL request used for the image request. + @param placeholderImage The image to be set initially, until the image request finishes. If `nil`, the image view will not change its image until the image request finishes. + @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`. + @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred. + */ +- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest + placeholderImage:(nullable UIImage *)placeholderImage + success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, UIImage *image))success + failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure; + +/** + Cancels any executing image operation for the receiver, if one exists. + */ +- (void)cancelImageDownloadTask; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/AFNetworking.framework/Headers/UIProgressView+AFNetworking.h b/AFNetworking.framework/Headers/UIProgressView+AFNetworking.h new file mode 100755 index 0000000..8ea0a73 --- /dev/null +++ b/AFNetworking.framework/Headers/UIProgressView+AFNetworking.h @@ -0,0 +1,64 @@ +// UIProgressView+AFNetworking.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#import + +#if TARGET_OS_IOS || TARGET_OS_TV + +#import + +NS_ASSUME_NONNULL_BEGIN + + +/** + This category adds methods to the UIKit framework's `UIProgressView` class. The methods in this category provide support for binding the progress to the upload and download progress of a session task. + */ +@interface UIProgressView (AFNetworking) + +///------------------------------------ +/// @name Setting Session Task Progress +///------------------------------------ + +/** + Binds the progress to the upload progress of the specified session task. + + @param task The session task. + @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. + */ +- (void)setProgressWithUploadProgressOfTask:(NSURLSessionUploadTask *)task + animated:(BOOL)animated; + +/** + Binds the progress to the download progress of the specified session task. + + @param task The session task. + @param animated `YES` if the change should be animated, `NO` if the change should happen immediately. + */ +- (void)setProgressWithDownloadProgressOfTask:(NSURLSessionDownloadTask *)task + animated:(BOOL)animated; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/AFNetworking.framework/Headers/UIRefreshControl+AFNetworking.h b/AFNetworking.framework/Headers/UIRefreshControl+AFNetworking.h new file mode 100755 index 0000000..215eafc --- /dev/null +++ b/AFNetworking.framework/Headers/UIRefreshControl+AFNetworking.h @@ -0,0 +1,53 @@ +// UIRefreshControl+AFNetworking.m +// +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#import + +#if TARGET_OS_IOS + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + This category adds methods to the UIKit framework's `UIRefreshControl` class. The methods in this category provide support for automatically beginning and ending refreshing depending on the loading state of a session task. + */ +@interface UIRefreshControl (AFNetworking) + +///----------------------------------- +/// @name Refreshing for Session Tasks +///----------------------------------- + +/** + Binds the refreshing state to the state of the specified task. + + @param task The task. If `nil`, automatic updating from any previously specified operation will be disabled. + */ +- (void)setRefreshingWithStateOfTask:(NSURLSessionTask *)task; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/AFNetworking.framework/Headers/UIWebView+AFNetworking.h b/AFNetworking.framework/Headers/UIWebView+AFNetworking.h new file mode 100755 index 0000000..b9a56af --- /dev/null +++ b/AFNetworking.framework/Headers/UIWebView+AFNetworking.h @@ -0,0 +1,80 @@ +// UIWebView+AFNetworking.h +// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ ) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#import + +#import + +#if TARGET_OS_IOS + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class AFHTTPSessionManager; + +/** + This category adds methods to the UIKit framework's `UIWebView` class. The methods in this category provide increased control over the request cycle, including progress monitoring and success / failure handling. + + @discussion When using these category methods, make sure to assign `delegate` for the web view, which implements `–webView:shouldStartLoadWithRequest:navigationType:` appropriately. This allows for tapped links to be loaded through AFNetworking, and can ensure that `canGoBack` & `canGoForward` update their values correctly. + */ +@interface UIWebView (AFNetworking) + +/** + The session manager used to download all requests. + */ +@property (nonatomic, strong) AFHTTPSessionManager *sessionManager; + +/** + Asynchronously loads the specified request. + + @param request A URL request identifying the location of the content to load. This must not be `nil`. + @param progress A progress object monitoring the current download progress. + @param success A block object to be executed when the request finishes loading successfully. This block returns the HTML string to be loaded by the web view, and takes two arguments: the response, and the response string. + @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. + */ +- (void)loadRequest:(NSURLRequest *)request + progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress + success:(nullable NSString * (^)(NSHTTPURLResponse *response, NSString *HTML))success + failure:(nullable void (^)(NSError *error))failure; + +/** + Asynchronously loads the data associated with a particular request with a specified MIME type and text encoding. + + @param request A URL request identifying the location of the content to load. This must not be `nil`. + @param MIMEType The MIME type of the content. Defaults to the content type of the response if not specified. + @param textEncodingName The IANA encoding name, as in `utf-8` or `utf-16`. Defaults to the response text encoding if not specified. +@param progress A progress object monitoring the current download progress. + @param success A block object to be executed when the request finishes loading successfully. This block returns the data to be loaded by the web view and takes two arguments: the response, and the downloaded data. + @param failure A block object to be executed when the data task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a single argument: the error that occurred. + */ +- (void)loadRequest:(NSURLRequest *)request + MIMEType:(nullable NSString *)MIMEType + textEncodingName:(nullable NSString *)textEncodingName + progress:(NSProgress * _Nullable __autoreleasing * _Nullable)progress + success:(nullable NSData * (^)(NSHTTPURLResponse *response, NSData *data))success + failure:(nullable void (^)(NSError *error))failure; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/AFNetworking.framework/Info.plist b/AFNetworking.framework/Info.plist new file mode 100755 index 0000000..ab5bd8a Binary files /dev/null and b/AFNetworking.framework/Info.plist differ diff --git a/AFNetworking.framework/Modules/module.modulemap b/AFNetworking.framework/Modules/module.modulemap new file mode 100755 index 0000000..a9200e1 --- /dev/null +++ b/AFNetworking.framework/Modules/module.modulemap @@ -0,0 +1,5 @@ +framework module AFNetworking { + umbrella header "AFNetworking.h" + export * + module * { export * } +} \ No newline at end of file diff --git a/Podfile b/Podfile new file mode 100755 index 0000000..f22b6c1 --- /dev/null +++ b/Podfile @@ -0,0 +1,9 @@ +# Uncomment this line to define a global platform for your project +platform :ios, '8.0' +# Uncomment this line if you're using Swift +# use_frameworks! + +target 'SohaPlayerDemo' do + pod 'SohaPlayer', :path => 'SohaPlayer.podspec' +end + diff --git a/Podfile.lock b/Podfile.lock new file mode 100755 index 0000000..1ba111f --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,16 @@ +PODS: + - SohaPlayer (1.0.1) + +DEPENDENCIES: + - SohaPlayer (from `SohaPlayer.podspec`) + +EXTERNAL SOURCES: + SohaPlayer: + :path: SohaPlayer.podspec + +SPEC CHECKSUMS: + SohaPlayer: 0239bba54e2e8edd6cde79a62afadaba8eff6c8a + +PODFILE CHECKSUM: 74e7cbcbfa01ffa56e80d827db28b3a4e4849e68 + +COCOAPODS: 1.0.1 diff --git a/Pods/Headers/Public/SohaPlayer/SohaPlayer/ChromecastDeviceController.h b/Pods/Headers/Public/SohaPlayer/SohaPlayer/ChromecastDeviceController.h new file mode 120000 index 0000000..a9972e8 --- /dev/null +++ b/Pods/Headers/Public/SohaPlayer/SohaPlayer/ChromecastDeviceController.h @@ -0,0 +1 @@ +../../../../../SohaPlayer.framework/Versions/A/Headers/ChromecastDeviceController.h \ No newline at end of file diff --git a/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHController.h b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHController.h new file mode 120000 index 0000000..8fa0f0f --- /dev/null +++ b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHController.h @@ -0,0 +1 @@ +../../../../../SohaPlayer.framework/Versions/A/Headers/SHController.h \ No newline at end of file diff --git a/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHLog.h b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHLog.h new file mode 120000 index 0000000..651ca47 --- /dev/null +++ b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHLog.h @@ -0,0 +1 @@ +../../../../../SohaPlayer.framework/Versions/A/Headers/SHLog.h \ No newline at end of file diff --git a/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHLogManager.h b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHLogManager.h new file mode 120000 index 0000000..c6d773b --- /dev/null +++ b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHLogManager.h @@ -0,0 +1 @@ +../../../../../SohaPlayer.framework/Versions/A/Headers/SHLogManager.h \ No newline at end of file diff --git a/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHMediaPlayback.h b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHMediaPlayback.h new file mode 120000 index 0000000..6cc13b6 --- /dev/null +++ b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHMediaPlayback.h @@ -0,0 +1 @@ +../../../../../SohaPlayer.framework/Versions/A/Headers/SHMediaPlayback.h \ No newline at end of file diff --git a/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHMediaPlayerDefines.h b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHMediaPlayerDefines.h new file mode 120000 index 0000000..1d62f1d --- /dev/null +++ b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHMediaPlayerDefines.h @@ -0,0 +1 @@ +../../../../../SohaPlayer.framework/Versions/A/Headers/SHMediaPlayerDefines.h \ No newline at end of file diff --git a/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHPlayerConfig.h b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHPlayerConfig.h new file mode 120000 index 0000000..54d3de9 --- /dev/null +++ b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHPlayerConfig.h @@ -0,0 +1 @@ +../../../../../SohaPlayer.framework/Versions/A/Headers/SHPlayerConfig.h \ No newline at end of file diff --git a/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHViewController.h b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHViewController.h new file mode 120000 index 0000000..42cee2e --- /dev/null +++ b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHViewController.h @@ -0,0 +1 @@ +../../../../../SohaPlayer.framework/Versions/A/Headers/SHViewController.h \ No newline at end of file diff --git a/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHViewControllerProtocols.h b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHViewControllerProtocols.h new file mode 120000 index 0000000..b06fa7e --- /dev/null +++ b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SHViewControllerProtocols.h @@ -0,0 +1 @@ +../../../../../SohaPlayer.framework/Versions/A/Headers/SHViewControllerProtocols.h \ No newline at end of file diff --git a/Pods/Headers/Public/SohaPlayer/SohaPlayer/SohaPlayer.h b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SohaPlayer.h new file mode 120000 index 0000000..4c2337b --- /dev/null +++ b/Pods/Headers/Public/SohaPlayer/SohaPlayer/SohaPlayer.h @@ -0,0 +1 @@ +../../../../../SohaPlayer.framework/Versions/A/Headers/SohaPlayer.h \ No newline at end of file diff --git a/Pods/Local Podspecs/SohaPlayer.podspec.json b/Pods/Local Podspecs/SohaPlayer.podspec.json new file mode 100644 index 0000000..d4a2bf5 --- /dev/null +++ b/Pods/Local Podspecs/SohaPlayer.podspec.json @@ -0,0 +1,44 @@ +{ + "name": "SohaPlayer", + "version": "1.0.1", + "summary": "The SohaPlayerSDK iOS SDK, play video into your iOS application.", + "authors": { + "lecuong": "jackylmao@gmail.com" + }, + "homepage": "http => \"https://github.com/duplicater/SohaPlayer-Origin", + "description": "The SohaPlayerSDK iOS SDK, for play video into your iOS application. The SDK supports iOS7, iOS 8, iOS 9 and iOS 10", + "frameworks": [ + "SystemConfiguration", + "QuartzCore", + "CoreMedia", + "AVFoundation", + "AudioToolbox", + "AdSupport", + "ImageIO", + "WebKit", + "Social", + "MediaAccessibility" + ], + "libraries": [ + "z", + "System", + "stdc++", + "stdc++.6", + "stdc++.6.0.9", + "xml2", + "xml2.2", + "c++" + ], + "requires_arc": true, + "source": { + "http": "https://github.com/duplicater/SohaPlayer-Origin.git/releases/download/1.0.1/CocoaPods.zip" + }, + "platforms": { + "ios": "7.0" + }, + "preserve_paths": "SohaPlayer.framework", + "public_header_files": "SohaPlayer.framework/Versions/A/Headers/*{.h}", + "source_files": "SohaPlayer.framework/Versions/A/Headers/*{.h}", + "resources": "SohaPlayer.bundle", + "vendored_frameworks": "SohaPlayer.framework" +} diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock new file mode 100644 index 0000000..1ba111f --- /dev/null +++ b/Pods/Manifest.lock @@ -0,0 +1,16 @@ +PODS: + - SohaPlayer (1.0.1) + +DEPENDENCIES: + - SohaPlayer (from `SohaPlayer.podspec`) + +EXTERNAL SOURCES: + SohaPlayer: + :path: SohaPlayer.podspec + +SPEC CHECKSUMS: + SohaPlayer: 0239bba54e2e8edd6cde79a62afadaba8eff6c8a + +PODFILE CHECKSUM: 74e7cbcbfa01ffa56e80d827db28b3a4e4849e68 + +COCOAPODS: 1.0.1 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..abef220 --- /dev/null +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,388 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 3784431EF0386AAD7492141814658C28 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */; }; + 486D719CF75FE81BD59210D824A242B7 /* Pods-SohaPlayerDemo-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A0BA05DFDC200FEBDC2450BCF3DA3C2E /* Pods-SohaPlayerDemo-dummy.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 010EABF4B2D71AD3BE583A47E6682137 /* SHMediaPlayback.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = SHMediaPlayback.h; sourceTree = ""; }; + 065787D7DD78A86B5C60C7AA5D26DA96 /* SHViewController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = SHViewController.h; sourceTree = ""; }; + 220240ED9EB3103BDF0E5FA3BF510C88 /* Pods-SohaPlayerDemo-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SohaPlayerDemo-frameworks.sh"; sourceTree = ""; }; + 3E306B0D02503E5778658175B1234A6E /* SohaPlayer.bundle */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = "wrapper.plug-in"; path = SohaPlayer.bundle; sourceTree = ""; }; + 40A5AD19B68A5D82FE1EC9EE3B08C2FB /* Pods-SohaPlayerDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SohaPlayerDemo.debug.xcconfig"; sourceTree = ""; }; + 43C01A7D99B3077A50AA1C2E099912F6 /* SohaPlayer.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = SohaPlayer.h; sourceTree = ""; }; + 724945901C6D760378ECC447E599408F /* Pods-SohaPlayerDemo-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SohaPlayerDemo-acknowledgements.markdown"; sourceTree = ""; }; + 756085067FB1EF71753B343C57148961 /* SHLogManager.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = SHLogManager.h; sourceTree = ""; }; + 85DF6575C79FA29D98DA1BB2B9B0B9C2 /* SHViewControllerProtocols.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = SHViewControllerProtocols.h; sourceTree = ""; }; + 86B6E90729ED3C0BCB534AC65A983ECD /* SohaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SohaPlayer.framework; sourceTree = ""; }; + 879EF984657C907BFFDD42105B8E86ED /* ChromecastDeviceController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = ChromecastDeviceController.h; sourceTree = ""; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + A0BA05DFDC200FEBDC2450BCF3DA3C2E /* Pods-SohaPlayerDemo-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SohaPlayerDemo-dummy.m"; sourceTree = ""; }; + BB66F861721A0F4A051E0BB64D985AB3 /* SHController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = SHController.h; sourceTree = ""; }; + C7202773B2F699C480C890F91C61C74F /* Pods-SohaPlayerDemo-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SohaPlayerDemo-resources.sh"; sourceTree = ""; }; + C735E7CA9BF2AD186D5AF684C2DFFB63 /* SHPlayerConfig.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = SHPlayerConfig.h; sourceTree = ""; }; + CC12D58E2A807951EC265231C47D9512 /* SHLog.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = SHLog.h; sourceTree = ""; }; + CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + D1E6967657711139A5172475FA2BFD7B /* libPods-SohaPlayerDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SohaPlayerDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + D3CA3848CB9F7BD749798ADA55ECD967 /* Pods-SohaPlayerDemo-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SohaPlayerDemo-acknowledgements.plist"; sourceTree = ""; }; + D6987458B7C856C97C4A562A0E437FAB /* Pods-SohaPlayerDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SohaPlayerDemo.release.xcconfig"; sourceTree = ""; }; + FAD8CEF22D928A94EAE98BC79440222A /* SHMediaPlayerDefines.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = SHMediaPlayerDefines.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 53C3C912C98F6AFC008D3E0FB46F43DE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3784431EF0386AAD7492141814658C28 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */ = { + isa = PBXGroup; + children = ( + CEC22C73C1608DFA5D5D78BDCB218219 /* Foundation.framework */, + ); + name = iOS; + sourceTree = ""; + }; + 42EB540068894B790C7004DEB45B6DF1 /* Development Pods */ = { + isa = PBXGroup; + children = ( + 9379BB4A1F97C168BB245B744087EAF4 /* SohaPlayer */, + ); + name = "Development Pods"; + sourceTree = ""; + }; + 70EF7C0D7F3272BA8D6BA4E121687ADC /* Versions */ = { + isa = PBXGroup; + children = ( + CEA7065DDE5D81BDE10388FF9DA43DEF /* A */, + ); + path = Versions; + sourceTree = ""; + }; + 76EABD7D8DB67564D96F121F000687BA /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + A4E130F1FDBA9AED02C7E6C20FA44355 /* Pods-SohaPlayerDemo */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 7BB531CFC2AA6821D331D819065E699D /* Resources */ = { + isa = PBXGroup; + children = ( + 3E306B0D02503E5778658175B1234A6E /* SohaPlayer.bundle */, + ); + name = Resources; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, + 42EB540068894B790C7004DEB45B6DF1 /* Development Pods */, + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */, + DAB1DD9866FDE041040F3CF1C51804BF /* Products */, + 76EABD7D8DB67564D96F121F000687BA /* Targets Support Files */, + ); + sourceTree = ""; + }; + 9379BB4A1F97C168BB245B744087EAF4 /* SohaPlayer */ = { + isa = PBXGroup; + children = ( + DC098FDD9CFE61E32B011D6B0DC60E35 /* Frameworks */, + 7BB531CFC2AA6821D331D819065E699D /* Resources */, + 94DFB7474AF21BB06969617FEA88417B /* SohaPlayer.framework */, + ); + name = SohaPlayer; + path = ..; + sourceTree = ""; + }; + 94DFB7474AF21BB06969617FEA88417B /* SohaPlayer.framework */ = { + isa = PBXGroup; + children = ( + 70EF7C0D7F3272BA8D6BA4E121687ADC /* Versions */, + ); + path = SohaPlayer.framework; + sourceTree = ""; + }; + 9A9AA2D343B7942F4B0AA8527628DADF /* Headers */ = { + isa = PBXGroup; + children = ( + 879EF984657C907BFFDD42105B8E86ED /* ChromecastDeviceController.h */, + BB66F861721A0F4A051E0BB64D985AB3 /* SHController.h */, + CC12D58E2A807951EC265231C47D9512 /* SHLog.h */, + 756085067FB1EF71753B343C57148961 /* SHLogManager.h */, + 010EABF4B2D71AD3BE583A47E6682137 /* SHMediaPlayback.h */, + FAD8CEF22D928A94EAE98BC79440222A /* SHMediaPlayerDefines.h */, + C735E7CA9BF2AD186D5AF684C2DFFB63 /* SHPlayerConfig.h */, + 065787D7DD78A86B5C60C7AA5D26DA96 /* SHViewController.h */, + 85DF6575C79FA29D98DA1BB2B9B0B9C2 /* SHViewControllerProtocols.h */, + 43C01A7D99B3077A50AA1C2E099912F6 /* SohaPlayer.h */, + ); + path = Headers; + sourceTree = ""; + }; + A4E130F1FDBA9AED02C7E6C20FA44355 /* Pods-SohaPlayerDemo */ = { + isa = PBXGroup; + children = ( + 724945901C6D760378ECC447E599408F /* Pods-SohaPlayerDemo-acknowledgements.markdown */, + D3CA3848CB9F7BD749798ADA55ECD967 /* Pods-SohaPlayerDemo-acknowledgements.plist */, + A0BA05DFDC200FEBDC2450BCF3DA3C2E /* Pods-SohaPlayerDemo-dummy.m */, + 220240ED9EB3103BDF0E5FA3BF510C88 /* Pods-SohaPlayerDemo-frameworks.sh */, + C7202773B2F699C480C890F91C61C74F /* Pods-SohaPlayerDemo-resources.sh */, + 40A5AD19B68A5D82FE1EC9EE3B08C2FB /* Pods-SohaPlayerDemo.debug.xcconfig */, + D6987458B7C856C97C4A562A0E437FAB /* Pods-SohaPlayerDemo.release.xcconfig */, + ); + name = "Pods-SohaPlayerDemo"; + path = "Target Support Files/Pods-SohaPlayerDemo"; + sourceTree = ""; + }; + BC3CA7F9E30CC8F7E2DD044DD34432FC /* Frameworks */ = { + isa = PBXGroup; + children = ( + 3DCAB2B7CDE207B3958B6CB957FCC758 /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + CEA7065DDE5D81BDE10388FF9DA43DEF /* A */ = { + isa = PBXGroup; + children = ( + 9A9AA2D343B7942F4B0AA8527628DADF /* Headers */, + ); + path = A; + sourceTree = ""; + }; + DAB1DD9866FDE041040F3CF1C51804BF /* Products */ = { + isa = PBXGroup; + children = ( + D1E6967657711139A5172475FA2BFD7B /* libPods-SohaPlayerDemo.a */, + ); + name = Products; + sourceTree = ""; + }; + DC098FDD9CFE61E32B011D6B0DC60E35 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 86B6E90729ED3C0BCB534AC65A983ECD /* SohaPlayer.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 99B738380F367BAD6F136FCB8432B118 /* Pods-SohaPlayerDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 140E29A61EA793E3E28009FAAFBB1E12 /* Build configuration list for PBXNativeTarget "Pods-SohaPlayerDemo" */; + buildPhases = ( + EC551B5E8456D42FC53785E46C98ECD1 /* Sources */, + 53C3C912C98F6AFC008D3E0FB46F43DE /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Pods-SohaPlayerDemo"; + productName = "Pods-SohaPlayerDemo"; + productReference = D1E6967657711139A5172475FA2BFD7B /* libPods-SohaPlayerDemo.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0730; + LastUpgradeCheck = 0700; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = DAB1DD9866FDE041040F3CF1C51804BF /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 99B738380F367BAD6F136FCB8432B118 /* Pods-SohaPlayerDemo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + EC551B5E8456D42FC53785E46C98ECD1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 486D719CF75FE81BD59210D824A242B7 /* Pods-SohaPlayerDemo-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 0CBA412E73B6C0AC73EBD5AA68C58281 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 40A5AD19B68A5D82FE1EC9EE3B08C2FB /* Pods-SohaPlayerDemo.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACH_O_TYPE = staticlib; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 150410C0375D267DEEF23F943B5948B4 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D6987458B7C856C97C4A562A0E437FAB /* Pods-SohaPlayerDemo.release.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MACH_O_TYPE = staticlib; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + }; + name = Release; + }; + 47BEF9D903506B003EA5C2B249729489 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + ONLY_ACTIVE_ARCH = YES; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + AAF678CED40D3499169D10F63CA0719E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 140E29A61EA793E3E28009FAAFBB1E12 /* Build configuration list for PBXNativeTarget "Pods-SohaPlayerDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0CBA412E73B6C0AC73EBD5AA68C58281 /* Debug */, + 150410C0375D267DEEF23F943B5948B4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 47BEF9D903506B003EA5C2B249729489 /* Debug */, + AAF678CED40D3499169D10F63CA0719E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/Pods/Pods.xcodeproj/xcuserdata/jackylmao.xcuserdatad/xcschemes/Pods-SohaPlayerDemo.xcscheme b/Pods/Pods.xcodeproj/xcuserdata/jackylmao.xcuserdatad/xcschemes/Pods-SohaPlayerDemo.xcscheme new file mode 100644 index 0000000..a0df891 --- /dev/null +++ b/Pods/Pods.xcodeproj/xcuserdata/jackylmao.xcuserdatad/xcschemes/Pods-SohaPlayerDemo.xcscheme @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Pods/Pods.xcodeproj/xcuserdata/jackylmao.xcuserdatad/xcschemes/xcschememanagement.plist b/Pods/Pods.xcodeproj/xcuserdata/jackylmao.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..b5104ce --- /dev/null +++ b/Pods/Pods.xcodeproj/xcuserdata/jackylmao.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + Pods-SohaPlayerDemo.xcscheme + + isShown + + + + SuppressBuildableAutocreation + + 99B738380F367BAD6F136FCB8432B118 + + primary + + + + + diff --git a/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-acknowledgements.markdown b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-acknowledgements.markdown new file mode 100644 index 0000000..102af75 --- /dev/null +++ b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - https://cocoapods.org diff --git a/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-acknowledgements.plist b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-acknowledgements.plist new file mode 100644 index 0000000..7acbad1 --- /dev/null +++ b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-dummy.m b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-dummy.m new file mode 100644 index 0000000..7011e62 --- /dev/null +++ b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SohaPlayerDemo : NSObject +@end +@implementation PodsDummy_Pods_SohaPlayerDemo +@end diff --git a/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-frameworks.sh b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-frameworks.sh new file mode 100755 index 0000000..893c16a --- /dev/null +++ b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-frameworks.sh @@ -0,0 +1,84 @@ +#!/bin/sh +set -e + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # use filter instead of exclude so missing patterns dont' throw errors + echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" + /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current file + archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" + stripped="" + for arch in $archs; do + if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi +} + diff --git a/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-resources.sh b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-resources.sh new file mode 100755 index 0000000..2c324ab --- /dev/null +++ b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-resources.sh @@ -0,0 +1,108 @@ +#!/bin/sh +set -e + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +case "${TARGETED_DEVICE_FAMILY}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +realpath() { + DIRECTORY="$(cd "${1%/*}" && pwd)" + FILENAME="${1##*/}" + echo "$DIRECTORY/$FILENAME" +} + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_resource "../SohaPlayer.bundle" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_resource "../SohaPlayer.bundle" +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "`realpath $PODS_ROOT`*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi diff --git a/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo.debug.xcconfig b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo.debug.xcconfig new file mode 100644 index 0000000..b43d69a --- /dev/null +++ b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo.debug.xcconfig @@ -0,0 +1,8 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/.." +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SohaPlayer" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SohaPlayer" +OTHER_LDFLAGS = $(inherited) -ObjC -l"System" -l"c++" -l"stdc++" -l"stdc++.6" -l"stdc++.6.0.9" -l"xml2" -l"xml2.2" -l"z" -framework "AVFoundation" -framework "AdSupport" -framework "AudioToolbox" -framework "CoreMedia" -framework "ImageIO" -framework "MediaAccessibility" -framework "QuartzCore" -framework "Social" -framework "SohaPlayer" -framework "SystemConfiguration" -framework "WebKit" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo.release.xcconfig b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo.release.xcconfig new file mode 100644 index 0000000..b43d69a --- /dev/null +++ b/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo.release.xcconfig @@ -0,0 +1,8 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/.." +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SohaPlayer" +OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SohaPlayer" +OTHER_LDFLAGS = $(inherited) -ObjC -l"System" -l"c++" -l"stdc++" -l"stdc++.6" -l"stdc++.6.0.9" -l"xml2" -l"xml2.2" -l"z" -framework "AVFoundation" -framework "AdSupport" -framework "AudioToolbox" -framework "CoreMedia" -framework "ImageIO" -framework "MediaAccessibility" -framework "QuartzCore" -framework "Social" -framework "SohaPlayer" -framework "SystemConfiguration" -framework "WebKit" +PODS_BUILD_DIR = $BUILD_DIR +PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT}/Pods diff --git a/SohaPlayer.bundle/ControlsPlayer.nib b/SohaPlayer.bundle/ControlsPlayer.nib new file mode 100644 index 0000000..5f7fc3a Binary files /dev/null and b/SohaPlayer.bundle/ControlsPlayer.nib differ diff --git a/SohaPlayer.bundle/Info.plist b/SohaPlayer.bundle/Info.plist new file mode 100644 index 0000000..7c8abee Binary files /dev/null and b/SohaPlayer.bundle/Info.plist differ diff --git a/SohaPlayer.bundle/SHBrowserViewController~iphone.nib/objects-8.0+.nib b/SohaPlayer.bundle/SHBrowserViewController~iphone.nib/objects-8.0+.nib new file mode 100644 index 0000000..e80b548 Binary files /dev/null and b/SohaPlayer.bundle/SHBrowserViewController~iphone.nib/objects-8.0+.nib differ diff --git a/SohaPlayer.bundle/SHBrowserViewController~iphone.nib/objects.nib b/SohaPlayer.bundle/SHBrowserViewController~iphone.nib/objects.nib new file mode 100644 index 0000000..dddd3aa Binary files /dev/null and b/SohaPlayer.bundle/SHBrowserViewController~iphone.nib/objects.nib differ diff --git a/SohaPlayer.bundle/SHBrowserViewController~iphone.nib/runtime.nib b/SohaPlayer.bundle/SHBrowserViewController~iphone.nib/runtime.nib new file mode 100644 index 0000000..d004e8e Binary files /dev/null and b/SohaPlayer.bundle/SHBrowserViewController~iphone.nib/runtime.nib differ diff --git a/SohaPlayer.bundle/SHWebKitBrowserViewController.nib b/SohaPlayer.bundle/SHWebKitBrowserViewController.nib new file mode 100644 index 0000000..162b5de Binary files /dev/null and b/SohaPlayer.bundle/SHWebKitBrowserViewController.nib differ diff --git a/SohaPlayer.bundle/VKScrubber_max.tiff b/SohaPlayer.bundle/VKScrubber_max.tiff new file mode 100644 index 0000000..76e5b68 Binary files /dev/null and b/SohaPlayer.bundle/VKScrubber_max.tiff differ diff --git a/SohaPlayer.bundle/VKScrubber_min.tiff b/SohaPlayer.bundle/VKScrubber_min.tiff new file mode 100644 index 0000000..5d6460c Binary files /dev/null and b/SohaPlayer.bundle/VKScrubber_min.tiff differ diff --git a/SohaPlayer.bundle/VKScrubber_thumb.tiff b/SohaPlayer.bundle/VKScrubber_thumb.tiff new file mode 100644 index 0000000..6ef2ee2 Binary files /dev/null and b/SohaPlayer.bundle/VKScrubber_thumb.tiff differ diff --git a/SohaPlayer.bundle/VKVideoPlayer_close.tiff b/SohaPlayer.bundle/VKVideoPlayer_close.tiff new file mode 100644 index 0000000..05fe39d Binary files /dev/null and b/SohaPlayer.bundle/VKVideoPlayer_close.tiff differ diff --git a/SohaPlayer.bundle/VKVideoPlayer_cross.tiff b/SohaPlayer.bundle/VKVideoPlayer_cross.tiff new file mode 100644 index 0000000..eb130b8 Binary files /dev/null and b/SohaPlayer.bundle/VKVideoPlayer_cross.tiff differ diff --git a/SohaPlayer.bundle/VKVideoPlayer_next.tiff b/SohaPlayer.bundle/VKVideoPlayer_next.tiff new file mode 100644 index 0000000..3b95312 Binary files /dev/null and b/SohaPlayer.bundle/VKVideoPlayer_next.tiff differ diff --git a/SohaPlayer.bundle/VKVideoPlayer_pause.tiff b/SohaPlayer.bundle/VKVideoPlayer_pause.tiff new file mode 100644 index 0000000..74d7f01 Binary files /dev/null and b/SohaPlayer.bundle/VKVideoPlayer_pause.tiff differ diff --git a/SohaPlayer.bundle/VKVideoPlayer_pause_big.tiff b/SohaPlayer.bundle/VKVideoPlayer_pause_big.tiff new file mode 100644 index 0000000..862f92e Binary files /dev/null and b/SohaPlayer.bundle/VKVideoPlayer_pause_big.tiff differ diff --git a/SohaPlayer.bundle/VKVideoPlayer_play.tiff b/SohaPlayer.bundle/VKVideoPlayer_play.tiff new file mode 100644 index 0000000..af35e4c Binary files /dev/null and b/SohaPlayer.bundle/VKVideoPlayer_play.tiff differ diff --git a/SohaPlayer.bundle/VKVideoPlayer_play_big.tiff b/SohaPlayer.bundle/VKVideoPlayer_play_big.tiff new file mode 100644 index 0000000..21f6481 Binary files /dev/null and b/SohaPlayer.bundle/VKVideoPlayer_play_big.tiff differ diff --git a/SohaPlayer.bundle/VKVideoPlayer_rewind.tiff b/SohaPlayer.bundle/VKVideoPlayer_rewind.tiff new file mode 100644 index 0000000..662345f Binary files /dev/null and b/SohaPlayer.bundle/VKVideoPlayer_rewind.tiff differ diff --git a/SohaPlayer.bundle/VKVideoPlayer_zoom_in.tiff b/SohaPlayer.bundle/VKVideoPlayer_zoom_in.tiff new file mode 100644 index 0000000..e9c02d1 Binary files /dev/null and b/SohaPlayer.bundle/VKVideoPlayer_zoom_in.tiff differ diff --git a/SohaPlayer.bundle/VKVideoPlayer_zoom_out.tiff b/SohaPlayer.bundle/VKVideoPlayer_zoom_out.tiff new file mode 100644 index 0000000..f2bacfc Binary files /dev/null and b/SohaPlayer.bundle/VKVideoPlayer_zoom_out.tiff differ diff --git a/SohaPlayer.framework/.DS_Store b/SohaPlayer.framework/.DS_Store new file mode 100644 index 0000000..88fd964 Binary files /dev/null and b/SohaPlayer.framework/.DS_Store differ diff --git a/SohaPlayer.framework/Headers b/SohaPlayer.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/SohaPlayer.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/SohaPlayer.framework/SohaPlayer b/SohaPlayer.framework/SohaPlayer new file mode 120000 index 0000000..4f7946e --- /dev/null +++ b/SohaPlayer.framework/SohaPlayer @@ -0,0 +1 @@ +Versions/Current/SohaPlayer \ No newline at end of file diff --git a/SohaPlayer.framework/Versions/.DS_Store b/SohaPlayer.framework/Versions/.DS_Store new file mode 100644 index 0000000..1c2d4bd Binary files /dev/null and b/SohaPlayer.framework/Versions/.DS_Store differ diff --git a/SohaPlayer.framework/Versions/A/.DS_Store b/SohaPlayer.framework/Versions/A/.DS_Store new file mode 100644 index 0000000..d260617 Binary files /dev/null and b/SohaPlayer.framework/Versions/A/.DS_Store differ diff --git a/SohaPlayer.framework/Versions/A/Headers/ChromecastDeviceController.h b/SohaPlayer.framework/Versions/A/Headers/ChromecastDeviceController.h new file mode 100755 index 0000000..89f04d6 --- /dev/null +++ b/SohaPlayer.framework/Versions/A/Headers/ChromecastDeviceController.h @@ -0,0 +1,475 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and + +@import Foundation; + +/** + * @enum SHGCConnectionState + * Enum defining GCKDeviceManager connection states. + */ +typedef NS_ENUM(NSInteger, SHGCConnectionState) { + /** Disconnected from the device or application. */ + SHGCConnectionStateDisconnected = 0, + /** Connecting to the device or application. */ + SHGCConnectionStateConnecting = 1, + /** Connected to the device or application. */ + SHGCConnectionStateConnected = 2, + /** Disconnecting from the device. */ + SHGCConnectionStateDisconnecting = 3 +}; + +/** + * @enum SHGCMediaStreamType + * Enum defining the media stream type. + */ +typedef NS_ENUM(NSInteger, SHGCMediaStreamType) { + /** A stream type of "none". */ + SHGCMediaStreamTypeNone = 0, + /** A buffered stream type. */ + SHGCMediaStreamTypeBuffered = 1, + /** A live stream type. */ + SHGCMediaStreamTypeLive = 2, + /** An unknown stream type. */ + SHGCMediaStreamTypeUnknown = 99, +}; + +/** + * @enum SHGCErrorCode + * Description of error codes + */ +typedef NS_ENUM(NSInteger, SHGCErrorCode) { + /** + * Error Code indicating no error. + */ + SHGCErrorCodeNoError = 0, + + /** + * Error code indicating a network I/O error. + */ + SHGCErrorCodeNetworkError = 1, + + /** + * Error code indicating that an operation has timed out. + */ + SHGCErrorCodeTimeout = 2, + + /** + * Error code indicating an authentication error. + */ + SHGCErrorCodeDeviceAuthenticationFailure = 3, + + /** + * Error code indicating that an invalid request was made. + */ + SHGCErrorCodeInvalidRequest = 4, + + /** + * Error code indicating that an in-progress request has been cancelled, most likely because + * another action has preempted it. + */ + SHGCErrorCodeCancelled = 5, + + /** + * Error code indicating that a request has been replaced by another request of the same type. + */ + SHGCErrorCodeReplaced = 6, + + /** + * Error code indicating that the request was disallowed and could not be completed. + */ + SHGCErrorCodeNotAllowed = 7, + + /** + * Error code indicating that a request could not be made because the same type of request is + * still in process. + */ + SHGCErrorCodeDuplicateRequest = 8, + + /** + * Error code indicating that the request is not allowed in the current state. + */ + SHGCErrorCodeInvalidState = 9, + + /** + * Error code indicating that a requested application could not be found. + */ + SHGCErrorCodeApplicationNotFound = 20, + + /** + * Error code indicating that a requested application is not currently running. + */ + SHGCErrorCodeApplicationNotRunning = 21, + + /** + * Error code indicating that the application session ID was not valid. + */ + SHGCErrorCodeInvalidApplicationSessionID = 22, + + /** + * Error code indicating that a media load failed on the receiver side. + */ + SHGCErrorCodeMediaLoadFailed = 30, + + /** + * Error code indicating that a media media command failed because of the media player state. + */ + SHGCErrorCodeInvalidMediaPlayerState = 31, + + /** + * Error code indicating the app entered the background. + */ + SHGCErrorCodeAppDidEnterBackground = 91, + + /** + * Error code indicating a disconnection occurred during the request. + */ + SHGCErrorCodeDisconnected = 92, + + /** + * Error code indicating that an unknown, unexpected error has occurred. + */ + SHGCErrorCodeUnknown = 99, +}; + + +/** + * @enum SHGCMediaPlayerIdleReason + * Media player idle reasons. + */ +typedef NS_ENUM(NSInteger, SHGCMediaPlayerIdleReason) { + /** Constant indicating that the player currently has no idle reason. */ + SHGCMediaPlayerIdleReasonNone = 0, + + /** Constant indicating that the player is idle because playback has finished. */ + SHGCMediaPlayerIdleReasonFinished = 1, + + /** + * Constant indicating that the player is idle because playback has been cancelled in + * response to a STOP command. + */ + SHGCMediaPlayerIdleReasonCancelled = 2, + + /** + * Constant indicating that the player is idle because playback has been interrupted by + * a LOAD command. + */ + SHGCMediaPlayerIdleReasonInterrupted = 3, + + /** Constant indicating that the player is idle because a playback error has occurred. */ + SHGCMediaPlayerIdleReasonError = 4, +}; + + +typedef NS_ENUM(NSInteger, SHGCMediaPlayerState) { + /** Constant indicating unknown player state. */ + SHGCMediaPlayerStateUnknown = 0, + /** Constant indicating that the media player is idle. */ + SHGCMediaPlayerStateIdle = 1, + /** Constant indicating that the media player is playing. */ + SHGCMediaPlayerStatePlaying = 2, + /** Constant indicating that the media player is paused. */ + SHGCMediaPlayerStatePaused = 3, + /** Constant indicating that the media player is buffering. */ + SHGCMediaPlayerStateBuffering = 4, +}; + + +@protocol SHGCDevice +@property(nonatomic, copy) NSString *deviceID; +@property(nonatomic, copy) NSString *friendlyName; +@property(nonatomic, copy, readonly) NSString *ipAddress; +@property(nonatomic, readonly) UInt32 servicePort; +@end + +@protocol SHGCMediaInformation; +@protocol SHGCMediaStatus +@property(nonatomic, readonly) SHGCMediaPlayerState playerState; +@property(nonatomic, readonly) SHGCMediaPlayerIdleReason idleReason; +@property(nonatomic, strong, readonly) id mediaInformation; +@end + +@protocol SHGCMediaControlChannel +@property(nonatomic, strong, readonly) id mediaStatus; +@property(nonatomic, weak) id delegate; +- (NSTimeInterval)approximateStreamPosition; +- (NSInteger)seekToTimeInterval:(NSTimeInterval)position; +- (NSInteger)requestStatus; +- (NSInteger)loadMedia:(id)mediaInfo + autoplay:(BOOL)autoplay + playPosition:(NSTimeInterval)playPosition; +- (void)play; +- (void)pause; +@end + +@protocol SHGCCastChannel + + +@end + +@protocol SHGCDeviceManager +@property(nonatomic, readonly) id device; +@property(nonatomic, weak) id delegate; +@property(nonatomic, readonly) SHGCConnectionState applicationConnectionState; +- (instancetype)initWithDevice:(id)device clientPackageName:(NSString *)clientPackageName; +- (NSInteger)stopApplicationWithSessionID:(NSString *)sessionID; +- (void)connect; +- (void)disconnect; +- (NSInteger)launchApplication:(NSString *)applicationID; +- (BOOL)addChannel:(id)channel; +@end + +@protocol SHGCDeviceScannerListener; + +@protocol SHGCDeviceScanner +- (void)addListener:(id)listener; +@property(nonatomic, readonly, copy) NSArray *devices; +- (void)startScan; +@end + +@protocol SHGCMediaMetadata +- (NSString *)stringForKey:(NSString *)key; +@end + +@protocol SHGCMediaInformation +@property(nonatomic, strong, readonly) id metadata; +@property(nonatomic, readonly) NSTimeInterval streamDuration; +@property(nonatomic, copy, readonly) NSString *contentID; +@property(nonatomic, copy, readonly) NSString *contentType; +- (instancetype)initWithContentID:(NSString *)contentID + streamType:(SHGCMediaStreamType)streamType + contentType:(NSString *)contentType + metadata:(id)metadata + streamDuration:(NSTimeInterval)streamDuration + customData:(id)customData; +@end + + + +@protocol SHGCApplicationMetadata +@property(nonatomic, strong, readonly) id metadata; +@end + +@protocol SHGCError +@property (readonly) NSInteger code; +@end + + + + +@protocol SHGCDeviceScannerListener + +@optional + +/** + * Called when a device has been discovered or has come online. + * + * @param device The device. + */ +- (void)deviceDidComeOnline:(id)device; + +/** + * Called when a device has gone offline. + * + * @param device The device. + */ +- (void)deviceDidGoOffline:(id)device; + +/** + * Called when there is a change to one or more properties of the device that do not affect + * connectivity to the device. This includes all properties except the device ID, IP address, + * and service port; if any of these properties changes, the device will be reported as "offline" + * and a new device with the updated properties will be reported as "online". + * + * @param device The device. + */ +- (void)deviceDidChange:(id)device; + +@end +// limitations under the License. + +#import + +extern NSString * const kCastViewController; + +@protocol ChromecastDeviceControllerDelegate + +@optional + +/** + * Called when connection to the device was established. + * + * @param device The device to which the connection was established. + */ +- (void)didConnectToDevice:(id)device; + +/** + * Called when the device disconnects. + */ +- (void)didDisconnect; + +/** + * Called when Cast devices are discoverd on the network. + */ +- (void)didDiscoverDeviceOnNetwork; + +/** + * Called when Cast device is connecting + */ +- (void)castConnectingToDevice; + +/** + * Called when a request to load media has completed. + */ +- (void)didCompleteLoadWithSessionID:(NSInteger)sessionID; + +/** + * Called when updated player status information is received. + */ +- (void)didUpdateStatus:(id)mediaControlChannel; + +@end + +@interface ChromecastDeviceController : NSObject < + SHGCDeviceScannerListener +> + +/** + * The storyboard contianing the Cast component views used by the controllers in + * the CastComponents group. + */ +//@property(nonatomic, readonly) UIStoryboard *storyboard; + +/** + * The delegate for this object. + */ +@property(nonatomic, weak) id delegate; + +/** + * The Cast application ID to launch. + */ +@property(nonatomic, copy) NSString *applicationID; + +/** + * The device manager used to manage a connection to a Cast device. + */ +@property(nonatomic, strong) id deviceManager; + +/** + * The device scanner used to detect devices on the network. + */ +@property(nonatomic, strong) id deviceScanner; + +/** + * The media information of the loaded media on the device. + */ +@property(nonatomic, strong) id mediaInformation; + +/** + * The media control channel for the playing media. + */ +@property (nonatomic, strong) id mediaControlChannel; + +/** + * Helper accessor for the media player state of the media on the device. + */ +@property(nonatomic, readonly) SHGCMediaPlayerState playerState; + +/** + * The current idle reason. This value is only meaningful if the player state is + * SHGCMediaPlayerStateIdle. + */ +@property(nonatomic, readonly) SHGCMediaPlayerIdleReason idleReason; + +/** + * Helper accessor for the duration of the currently casting media. + */ +@property(nonatomic, readonly) NSTimeInterval streamDuration; + +/** + * The current playback position of the currently casting media. + */ +@property(nonatomic, readonly) NSTimeInterval streamPosition; + +/** + * Main access point for the class. Use this to retrieve an object you can use. + * + * @return ChromecastDeviceController + */ ++ (instancetype)sharedInstance; + +/** + * Sets the position of the playback on the Cast device. + * + * @param newPercent 0.0-1.0 + */ +- (void)setPlaybackPercent:(float)newPercent; + +/** + * Connect to the given Cast device. + * + * @param device A GCKDevice from the deviceScanner list. + */ +- (void)connectToDevice:(id)device; + +/** + * Load media onto the currently connected device. + * + * @param media The GCKMediaInformation to play, with the URL as the contentID + * @param startTime Time to start from if starting a fresh cast + * @param autoPlay Whether to start playing as soon as the media is loaded. + * + * @return YES if we can load the media. + */ +- (BOOL)loadMedia:(id)media + startTime:(NSTimeInterval)startTime + autoPlay:(BOOL)autoPlay; + +/** + * Enable Cast enhancing of the controller by adding icons + * and other UI elements. Signals that this view controller should be + * used for presenting UI elements. + * + * @param controller The UIViewController to decorate. + */ +//- (void)decorateViewController:(UIViewController *)controller; + +/** + * Request an update for the minicontroller toolbar. Passed UIViewController must have a + * toolbar - for example if it is under a UINavigationBar. + * + * @param viewController UIViewController to update the toolbar on. + */ +//- (void)updateToolbarForViewController:(UIViewController *)viewController; + +/** + * Return the last known stream position for the given contentID. This will generally only + * be useful for the last Cast media, and allows a local player to resume playback at the + * position noted before disconnect. In many cases it will return 0. + * + * @param contentID The string of the identifier of the media to be displayed. + * + * @return the position in the stream of the media, if any. + */ +- (NSTimeInterval)streamPositionForPreviouslyCastMedia:(NSString *)contentID; + +/** + * Prevent automatically reconnecting to the Cast device if we see it again. + */ +- (void)clearPreviousSession; + +/** + * Enable basic logging of all GCKLogger messages to the console. + */ +- (void)enableLogging; + +@end diff --git a/SohaPlayer.framework/Versions/A/Headers/SHController.h b/SohaPlayer.framework/Versions/A/Headers/SHController.h new file mode 100755 index 0000000..450ca10 --- /dev/null +++ b/SohaPlayer.framework/Versions/A/Headers/SHController.h @@ -0,0 +1,103 @@ +// +// SHController.h +// SohaPlayer +// +// Created by Le Cuong on 10/14/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import +#import "SHMediaPlayback.h" + +// ----------------------------------------------------------------------------- +// Media Player Types + +typedef NS_ENUM(NSInteger, SHMediaPlaybackState) { + SHMediaPlaybackStateUnknown, + SHMediaPlaybackStateLoaded, + SHMediaPlaybackStateReady, + /* Playback is currently under way. */ + SHMediaPlaybackStatePlaying, + /* Playback is currently paused. */ + SHMediaPlaybackStatePaused, + /* Playback is currently ended. */ + SHMediaPlaybackStateEnded, + + /* Playback is temporarily interrupted, perhaps because the buffer ran out of content. */ + SHMediaPlaybackStateInterrupted, + /* The movie player is currently seeking towards the end of the movie. */ + SHMediaPlaybackStateSeekingForward, + /* The movie player is currently seeking towards the beginning of the movie. */ + SHMediaPlaybackStateSeekingBackward +}; + + +typedef NS_OPTIONS(NSUInteger, SHMediaLoadState) { + /* The load state is not known. */ + SHMediaLoadStateUnknown = 0, + /* The buffer has enough data that playback can begin, but it may run out of data before playback finishes. */ + SHMediaLoadStatePlayable = 1 << 0, + /* Enough data has been buffered for playback to continue uninterrupted. */ + SHMediaLoadStatePlaythroughOK = 1 << 1, // Playback will be automatically started in this state when shouldAutoplay is YES + /* The buffering of data has stalled. */ + SHMediaLoadStateStalled = 1 << 2, // Playback will be automatically paused in this state, if started +}; + +// ----------------------------------------------------------------------------- +// Media Player Notifications + +/* Posted when the playback state changes, either programatically or by the user. */ +extern NSString * const SHMediaPlaybackStateDidChangeNotification; + +// ----------------------------------------------------------------------------- +// Media Player Keys +extern NSString * const SHMediaPlaybackStateKey; + +@protocol SHMediaPlayback; + +@protocol SHControllerDelegate + +/*! + @method sendSHNotification:withParams: + @abstract Call a KDP notification (perform actions using this API, for example: play, pause, changeMedia, etc.) (required) + */ + +- (void)sendSHNotification:(NSString *)shNotificationName withParams:(NSString *)shParams; +- (void)sendSHNotification:(NSString *)shNotificationName params:(NSString *)shParams completionHandler:(void(^)())handler; +- (NSTimeInterval)duration; +- (NSTimeInterval)currentPlaybackTime; +- (float)volume; +- (void)setVolume:(float)value; +- (BOOL)mute; +- (void)setMute:(BOOL)isMute; + +@end + +@interface SHController : NSObject + +@property (nonatomic, weak) id delegate; + +/* The URL that points to the movie file. */ +@property (nonatomic, copy) NSURL *contentURL; + +/// @return Duration of the current video +@property (nonatomic, readonly) NSTimeInterval duration; +/* The volume of the player. */ +@property (nonatomic) float volume NS_AVAILABLE(10_7, 7_0); +/* Mute or UnMute the player. */ +@property (nonatomic, getter=isMuted) BOOL mute NS_AVAILABLE(10_7, 7_0); + +/// Perfoms seek to the currentPlaybackTime and returns the currentPlaybackTime +@property (nonatomic) NSTimeInterval currentPlaybackTime; + +/* The current playback state of the movie player. (read-only) + The playback state is affected by programmatic calls to play, pause the SHPlayer. */ +@property (nonatomic, readonly) SHMediaPlaybackState playbackState; +/* The current load state of the SHPlayer. (read-only). */ +@property (nonatomic, readonly) SHMediaLoadState loadState; + +- (void)seek:(NSTimeInterval)playbackTime; +- (void)seek:(NSTimeInterval)playbackTime completionHandler:(void(^)())handler; + +@end + diff --git a/SohaPlayer.framework/Versions/A/Headers/SHLog.h b/SohaPlayer.framework/Versions/A/Headers/SHLog.h new file mode 100755 index 0000000..69624fb --- /dev/null +++ b/SohaPlayer.framework/Versions/A/Headers/SHLog.h @@ -0,0 +1,50 @@ +// +// SHLog.h +// SohaPlayer +// +// Created by Le Cuong on 10/14/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import +#import "SHLogManager.h" + + +extern NSString *const SHLoggingNotification; +extern NSString *const SHLogMessageKey; +extern NSString *const SHLogMessageLevelKey; + + +void _SHLog(SHLogLevel logLevel, NSString *methodName, int lineNumber, NSString *format, ...); +void notifyListener(NSString *message, NSInteger messageLevel); + +#ifdef DEBUG +#define __FileName__ [[NSString stringWithUTF8String:__FILE__] lastPathComponent] +#define __LineNumber__ __LINE__ +#define __MethodName__ [[NSString stringWithUTF8String:__func__] lastPathComponent] + +#define SHLogTrace(...) SHLogManager.SHLogLevel <= SHLogLevelTrace ? _SHLog(SHLogLevelTrace,__MethodName__,__LineNumber__,__VA_ARGS__):nil +#define SHLogDebug(...) SHLogManager.SHLogLevel <= SHLogLevelDebug ? _SHLog(SHLogLevelDebug,__MethodName__,__LineNumber__,__VA_ARGS__):nil +#define SHLogInfo(...) SHLogManager.SHLogLevel <= SHLogLevelInfo ? _SHLog(SHLogLevelInfo,__MethodName__,__LineNumber__,__VA_ARGS__):nil +#define SHLogWarn(...) SHLogManager.SHLogLevel <= SHLogLevelWarn ? _SHLog(SHLogLevelWarn,__MethodName__,__LineNumber__,__VA_ARGS__):nil +#define SHLogError(...) SHLogManager.SHLogLevel <= SHLogLevelError ? _SHLog(SHLogLevelError,__MethodName__,__LineNumber__,__VA_ARGS__):nil +#else +#define SHLogTrace(...) /* */ +#define SHLogDebug(...) /* */ +#define SHLogInfo(...) /* */ +#define SHLogWarn(...) /* */ +#define SHLogError(...) /* */ +#endif + +#if !defined(DEBUGCC) +#define SHLogChromeCast(...) +#else +#define SHLogChromeCast(...) SHLogManager.SHLogLevel <= SHLogLevelChromeCast ? _SHLog(SHLogLevelChromeCast,__MethodName__,__LineNumber__,__VA_ARGS__):nil +#endif + +#ifdef DEBUG +# define DLog(...) NSLog(__VA_ARGS__) +#else +# define DLog(...) /* */ +#endif +#define ALog(...) NSLog(__VA_ARGS__) diff --git a/SohaPlayer.framework/Versions/A/Headers/SHLogManager.h b/SohaPlayer.framework/Versions/A/Headers/SHLogManager.h new file mode 100755 index 0000000..ee4785b --- /dev/null +++ b/SohaPlayer.framework/Versions/A/Headers/SHLogManager.h @@ -0,0 +1,34 @@ +// +// SHLogManager.h +// SohaPlayer +// +// Created by Le Cuong on 10/14/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import + +#define SH_DEBUG_MODE 1 + +typedef NS_ENUM(NSInteger, SHLogLevel) { + SHLogLevelAll = 0, + SHLogLevelTrace = 10, + SHLogLevelDebug = 20, + SHLogLevelInfo = 30, + SHLogLevelWarn = 40, + SHLogLevelError = 50, + SHLogLevelOff = 60, + SHLogLevelChromeCast = 70 +}; + +// use the `QLogManager` methods to set the desired level of log filter +@interface SHLogManager : NSObject + +// gets the current log filter level ++ (SHLogLevel)SHLogLevel; + +// set the log filter level ++ (void)setSHLogLevel:(SHLogLevel)level; + ++ (NSArray *)levelNames; +@end diff --git a/SohaPlayer.framework/Versions/A/Headers/SHMediaPlayback.h b/SohaPlayer.framework/Versions/A/Headers/SHMediaPlayback.h new file mode 100755 index 0000000..2898584 --- /dev/null +++ b/SohaPlayer.framework/Versions/A/Headers/SHMediaPlayback.h @@ -0,0 +1,81 @@ +// +// SHMediaPlayback.h +// SohaPlayer +// +// Created by Le Cuong on 10/14/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import "SHMediaPlayerDefines.h" + +/*! + @protocol SHMediaPlayback + + @abstract + The SHMediaPlayback protocol defines the interface adopted by the SHController class for controlling media playback. This protocol supports basic transport operations including start and pause, and also lets you seek forward and back through a movie or to a specific point in its timeline. + */ + +@protocol SHMediaPlayback + +// Prepares the current queue for playback, interrupting any active (non-mixible) audio sessions. +// Automatically invoked when -play is called if the player is not already prepared. +- (void)prepareToPlay; + +/*! + If a Kaltura player is not already prepared to play when you call the play method, that method automatically calls this method. However, to minimize playback delay, call this method before you call play. + */ +@property(nonatomic, readonly) BOOL isPreparedToPlay; + +/*! + @method play: + @abstract Initiates playback of the current item. (required) + + If playback was previously paused, this method resumes playback where it left off; otherwise, this method plays the first available item, from the beginning. + If a Kaltura player is not prepared for playback when you call this method, this method first prepares the Kaltura player and then starts playback. To minimize playback delay, call the prepareToPlay method before you call this method. + */ +- (void)play; + +/*! + @method pause: + @abstract Pauses playback of the current item. (required) + + If playback is not currently underway, this method has no effect. To resume playback of the current item from the pause point, call the play method. + */ +- (void)pause; + +/*! + @method replay: + @abstract replay playback of the current item. (required) + + This method initiates playback from the beginning of the current item. + */ +- (void)replay; + +/* The current position of the playhead. (required) */ +@property(nonatomic) NSTimeInterval currentPlaybackTime; + +/* The current playback rate for the player. (required) */ +@property(nonatomic) float currentPlaybackRate; + +@optional +// The seeking rate will increase the longer scanning is active. + +/*! + @method beginSeekingForward: + @abstract Begins seeking forward through the media content. (required) + */ +- (void)beginSeekingForward; + +/*! + @method beginSeekingBackward: + @abstract Begins seeking backward through the media content. (required) + */ +- (void)beginSeekingBackward; + +/*! + @method endSeeking: + @abstract Ends forward and backward seeking through the media content. (required) + */ +- (void)endSeeking; + +@end diff --git a/SohaPlayer.framework/Versions/A/Headers/SHMediaPlayerDefines.h b/SohaPlayer.framework/Versions/A/Headers/SHMediaPlayerDefines.h new file mode 100755 index 0000000..668722e --- /dev/null +++ b/SohaPlayer.framework/Versions/A/Headers/SHMediaPlayerDefines.h @@ -0,0 +1,16 @@ +// +// SHMediaPlayerDefines.h +// SohaPlayer +// +// Created by Le Cuong on 10/14/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#ifdef __cplusplus +#define SH_EXTERN extern "C" __attribute__((visibility ("default"))) +#else +#define SH_EXTERN extern __attribute__((visibility ("default"))) +#endif + +#define SH_EXTERN_CLASS __attribute__((visibility("default"))) +#define SH_EXTERN_CLASS_AVAILABLE(version) __attribute__((visibility("default"))) NS_CLASS_AVAILABLE(NA, version) diff --git a/SohaPlayer.framework/Versions/A/Headers/SHPlayerConfig.h b/SohaPlayer.framework/Versions/A/Headers/SHPlayerConfig.h new file mode 100755 index 0000000..234e063 --- /dev/null +++ b/SohaPlayer.framework/Versions/A/Headers/SHPlayerConfig.h @@ -0,0 +1,90 @@ +// +// SHPlayerConfig.h +// SohaPlayer +// +// Created by Le Cuong on 10/14/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import +#import + +/// SHPlayerConfig keys +static NSString *SHPlayerConfigNativeCallOutKey = @"nativeCallout"; +static NSString *SHPlayerConfigChromecastKey = @"chromecast.plugin"; +static NSString *SHPlayerConfigNativeAdIdKey = @"nativeAdId"; + +@protocol SHPlayerConfigDelegate + +@required +- (void)sourceUrlReadyPlay:(NSString*)source; + +@end + + + + +@interface SHPlayerConfig : NSObject + +- (instancetype)initWithServer:(NSString *)serverURL uiConfID:(NSString *)uiConfId partnerId:(NSString *)partnerId; + +// with source url for player, no need request to get real source url. +- (instancetype)initWithSourceUrl:(NSString *)sourceUrl appkey:(NSString*)appkey secretKey:(NSString*)secretKey vid:(NSString*)v_id; + +- (instancetype)initWithShortLinkUrl:(NSString *)linkUrl appkey:(NSString*)appkey secretKey:(NSString*)secretKey vid:(NSString*)v_id; + +- (instancetype)initWithDomain:(NSString *)domain uiConfID:(NSString *)uiConfId partnerId:(NSString *)partnerId +DEPRECATED_MSG_ATTRIBUTE("Use initWithServer:uiConfID:partnerId:"); + ++ (instancetype)configWithEmbedFrameURL:(NSString*)url; + + ++(instancetype)configWithDictionary:(NSDictionary*)configDict; + +@property (nonatomic, readonly) NSString *server; +@property (nonatomic, readonly) NSString *partnerId; + +@property (nonatomic, readonly) NSString *uiConfId; + +//add by lecuong.vcc +@property (nonatomic, readonly) NSString *appkey; + +@property (nonatomic, readonly) NSString *secretKey; + +@property (nonatomic, readonly) NSString *v_id; + +@property (nonatomic, readonly) NSString *sourceUrl; + +@property (nonatomic, readonly) NSString *shortLink; +// + +@property (nonatomic, copy) NSString *localContentId; + +@property (nonatomic, copy) NSString *ks; +@property (nonatomic, copy) NSString *entryId; +@property (nonatomic, copy) NSString *advertiserID; +@property (nonatomic) BOOL enableHover; + +@property (nonatomic, copy) NSDictionary* supportedMediaFormats; + + +/// Enables the SDK user to define interface orientation of the player +@property (nonatomic) UIInterfaceOrientationMask supportedInterfaceOrientations; + +@property (nonatomic) float cacheSize; + + +- (void)addConfigKey:(NSString *)key withValue:(NSString *)value; + + +- (void)addConfigKey:(NSString *)key withDictionary:(NSDictionary *)dictionary; + +- (NSURL *)videoURL; + +- (NSURL *)sourceURL; + +- (NSURL *)appendConfiguration:(NSURL *)videoURL; + +-(NSMutableArray*)queryItems; + +@end diff --git a/SohaPlayer.framework/Versions/A/Headers/SHViewController.h b/SohaPlayer.framework/Versions/A/Headers/SHViewController.h new file mode 100755 index 0000000..239dd0a --- /dev/null +++ b/SohaPlayer.framework/Versions/A/Headers/SHViewController.h @@ -0,0 +1,174 @@ +// +// SHViewController.h +// SohaPlayer +// +// Created by Le Cuong on 10/14/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + + +@protocol SohaPlayer; + +#import "SHLog.h" +#import "SHViewControllerProtocols.h" +#import "SHPlayerConfig.h" +#import "SHController.h" + +@class SHViewController; +@protocol SHViewControllerDelegate + +@optional +- (void)updateCurrentPlaybackTime:(double)currentPlaybackTime; +- (void)SHPlayer:(SHViewController *)player playerLoadStateDidChange:(SHMediaLoadState)state; +- (void)SHPlayer:(SHViewController *)player playerPlaybackStateDidChange:(SHMediaPlaybackState)state; +- (void)SHPlayer:(SHViewController *)player playerFullScreenToggled:(BOOL)isFullScreen; +- (void)SHPlayer:(SHViewController *)player didFailWithError:(NSError *)error; +@end + +@protocol SHSourceURLProvider + +- (NSString *)urlForEntryId:(NSString *)entryId currentURL:(NSString*)current; + +@end + +#import "ChromecastDeviceController.h" + + +@interface SHViewController : UIViewController + ++ (void)setLogLevel:(SHLogLevel)logLevel; + + +- (instancetype)initWithURL:(NSURL *)url; + + +- (instancetype)initWithConfiguration:(SHPlayerConfig *)configuration; + +- (instancetype)initWithConfiguration:(SHPlayerConfig *)configuration webRq:(BOOL)webRq; + + +- (void)loadPlayerIntoViewController:(UIViewController *)parentViewController; + +- (void)removePlayer; + + +- (void)resetPlayer; + + +- (void)changeMedia:(NSString *)entryID; + + +- (void)changeConfiguration:(SHPlayerConfig *)config; + +@property (nonatomic, weak) id delegate; + +@property (nonatomic, weak) id customSourceURLProvider; + +@property (nonatomic, strong) SHController *playerController; + +/** + * Block which notifies that the full screen has been toggeled, when assigning to this block the default full screen behaviour will be canceled and the full screen handling will be your reponsibility. + */ +@property (nonatomic, copy) void(^fullScreenToggeled)(BOOL isFullScreen); + + +/// Enables to change the player configuration +@property (nonatomic, strong) SHPlayerConfig *currentConfiguration; + + +// Kaltura Player External API + +/// Change the source and returns the current source +@property (nonatomic, copy) NSURL *playerSource; + +/// Signals that a internal or external web browser has been opened or closed +@property (nonatomic, weak) id kIMAWebOpenerDelegate; + +/// Assigning this handler will disable the default share action and will supply the share params for custom use. +- (void)setShareHandler:(void(^)(NSDictionary *shareParams))shareHandler; + + +#pragma mark - +#pragma Kaltura Player External API - KDP API +// ----------------------------------------------------------------------------- +// KDP API Types + +typedef NS_ENUM(NSInteger, KDPAPIState) { + /* Player is not ready to work with the JavaScript API. */ + KDPAPIStateUnknown, + /* Player is ready to work with the JavaScript API (jsCallbackReady). */ + KDPAPIStateReady +}; + +/* The current kdp api state of the KDP API. (read-only) + The kdp api state is affected by programmatic call to jsCallbackReady. */ +@property (nonatomic, readonly) KDPAPIState kdpAPIState; + +/*! + @property SHPlayer + @abstract The player from which to source the media content for the view controller. + */ +@property (nonatomic, readonly) id SHPlayer; + + +- (void)registerReadyEvent:(void(^)())handler; + + + +- (void)addSHPlayerEventListener:(NSString *)event eventID:(NSString *)eventID handler:(void(^)(NSString *eventName, NSString *params))handler; + + + +- (void)removeSHPlayerEventListener:(NSString *)event eventID:(NSString *)eventID; + + + + +- (void)asyncEvaluate:(NSString *)expression expressionID:(NSString *)expressionID handler:(void(^)(NSString *value))handler; + + + +- (void)sendNotification:(NSString *)notificationName withParams:(NSString *)params; + + + + +- (void)setKDPAttribute:(NSString *)pluginName propertyName:(NSString *)propertyName value:(NSString *)value; + + + +- (void)triggerEvent:(NSString *)event + withValue:(NSString *)value; + +- (void)releaseAndSavePosition; +- (void)resumePlayer; + + +/// Wraps registerReadyEvent: method by block syntax. +@property (nonatomic, copy) void (^registerReadyEvent)(void(^readyCallback)()); + +/// Wraps addEventListener:eventID:handler: method by block syntax. +@property (nonatomic, copy, readonly) void (^addEventListener)(NSString *event, NSString *eventID, void(^)(NSString *eventName, NSString *params)); + +/// Wraps removeEventListener:eventID: method by block syntax. +@property (nonatomic, copy, readonly) void (^removeEventListener)(NSString *event, NSString *eventID); + +/// Wraps asyncEvaluate:expressionID:handler: method by block syntax. +@property (nonatomic, copy, readonly) void (^asyncEvaluate)(NSString *expression, NSString *expressionID, void(^)(NSString *value)); + +/// Wraps sendNotification:expressionID:forName: method by block syntax. +@property (nonatomic, copy, readonly) void (^sendNotification)(NSString *notification, NSString *notificationName); + +/// Wraps setKDPAttribute:propertyName:value: method by block syntax. +@property (nonatomic, copy, readonly) void (^setKDPAttribute)(NSString *pluginName, NSString *propertyName, NSString *value); + +/// Wraps triggerEvent:withValue: method by block syntax. +@property (nonatomic, copy, readonly) void (^triggerEvent)(NSString *event, NSString *value); + +/* The device manager used for the currently casting media. */ +@property(weak, nonatomic) ChromecastDeviceController *castDeviceController; + +@property (nonatomic) BOOL showControls; + +@end + diff --git a/SohaPlayer.framework/Versions/A/Headers/SHViewControllerProtocols.h b/SohaPlayer.framework/Versions/A/Headers/SHViewControllerProtocols.h new file mode 100755 index 0000000..38768ba --- /dev/null +++ b/SohaPlayer.framework/Versions/A/Headers/SHViewControllerProtocols.h @@ -0,0 +1,83 @@ +#import +#import + +/// Player events constants +static NSString *SHPlayerEventCanplay = @"canplay"; +static NSString *SHPlayerEventDurationChange = @"durationchange"; +static NSString *SHPlayerEventLoadedMetadata = @"loadedmetadata"; +static NSString *SHPlayerEventPlay = @"play"; +static NSString *SHPlayerEventPause = @"pause"; +static NSString *SHPlayerEventEnded = @"ended"; +static NSString *SHPlayerEventSeeking = @"seeking"; +static NSString *SHPlayerEventSeeked = @"seeked"; +static NSString *SHPlayerEventTimeupdate = @"timeupdate"; +static NSString *SHPlayerEventProgress = @"progress"; +static NSString *SHPlayerEventToggleFullScreen = @"toggleFullscreen"; + +/// Key names of the video request +static NSString *SHPlayerDatasourceWidKey = @"wid"; +static NSString *SHPlayerDatasourceUiConfIdKey = @"uiconf_id"; +static NSString *SHPlayerDatasourceCacheStKey = @"cache_st"; +static NSString *SHPlayerDatasourceEntryId = @"entry_id"; +static NSString *SHPlayerDatasourcePlayerIdKey = @"playerId"; +static NSString *SHPlayerDatasourceUridKey = @"urid"; +static NSString *SHPlayerDatasourceDebugKey = @"debug"; +static NSString *SHPlayerDatasourceForceHtml5Key = @"forceMobileHTML5"; + +typedef enum{ + // Player Content Source Url + src = 0, + // Player Current time (Progress Bar) + currentTime, + // Player Visibility + visible, + // Player Error + playerError, + // DRM license uri + licenseUri, + fpsCertificate, + + nativeAction, + doubleClickRequestAds, + language, + captions +} Attribute; + +@protocol SHPlayerDelegate; + +@protocol SHPlayer + +@property (nonatomic, weak) id delegate; +//@property (nonatomic, copy) NSURL *playerSource; +@property (nonatomic) NSTimeInterval currentPlaybackTime; +@property (nonatomic) NSTimeInterval duration; +@property (nonatomic) float volume NS_AVAILABLE(10_7, 7_0); +@property (nonatomic, getter=isMuted) BOOL mute NS_AVAILABLE(10_7, 7_0); +@property (nonatomic, readonly) BOOL isSHPlayer; + + +- (instancetype)initWithParentView:(UIView *)parentView; +- (void)setPlayerSource:(NSURL *)playerSource; +- (NSURL *)playerSource; +- (void)play; +- (void)pause; +- (void)removePlayer; + +@optional + +- (void)enableTracks:(BOOL)isEnablingTracks; ++ (BOOL)isPlayableMIMEType:(NSString *)mimeType; +- (void)changeSubtitleLanguage:(NSString *)languageCode; +- (void)setSourceWithAsset:(AVURLAsset*)asset; +- (void)hidePlayer; + +@end + +@protocol SHPlayerDelegate + +- (void)player:(id)currentPlayer eventName:(NSString *)event value:(NSString *)value; +- (void)player:(id)currentPlayer eventName:(NSString *)event JSON:(NSString *)jsonString; +- (void)contentCompleted:(id)currentPlayer; + +@end + diff --git a/SohaPlayer.framework/Versions/A/Headers/SohaPlayer.h b/SohaPlayer.framework/Versions/A/Headers/SohaPlayer.h new file mode 100755 index 0000000..74d4d30 --- /dev/null +++ b/SohaPlayer.framework/Versions/A/Headers/SohaPlayer.h @@ -0,0 +1,55 @@ +#import "NSDictionary+Cache.h" +#import "NSMutableDictionary+Cache.h" +#import "SHCacheManager.h" +#import "CastProviderInternalDelegate.h" +#import "KCastDevice.h" +#import "KCastMediaRemoteControl.h" +#import "KCastProvider.h" +#import "KChromecastPlayer.h" +#import "KChromeCastWrapper.h" +#import "NSDictionary+Utilities.h" +#import "NSMutableDictionary+AdSupport.h" +#import "NSString+Utilities.h" +#import "ChromecastDeviceController.h" +#import "DeviceParamsHandler.h" + +#import "NSBundle+Soha.h" +#import "NSMutableArray+QueryItems.h" +#import "NSMutableArray+QueueAdditions.h" +#import "Secure.h" +#import "EmailStrategy.h" +#import "FacebookStrategy.h" +#import "GoogleplusStrategy.h" +#import "linkedinStrategy.h" +#import "NSDictionary+Strategy.h" +#import "SmsStrategy.h" +#import "TwitterStrategy.h" +#import "SHBrowserViewController.h" +#import "SHWebKitBrowserViewController.h" +#import "SHShareManager.h" +#import "SHControlsUIWebView.h" +#import "SHControlsView.h" +#import "SHControlsWKWebView.h" +#import "VKScrubber.h" +#import "VKSlider.h" +#import "SHCPlayer.h" +#import "SHLog.h" +#import "SHLogManager.h" +#import "SHMediaPlayback.h" +#import "IMAHandler.h" +#import "SHAssetBuilder.h" +#import "SHAssetHandler.h" +#import "SHController.h" +#import "SHController_Private.h" +#import "SHFairPlayHandler.h" +#import "SHIMAPlayerViewController.h" +#import "SHMediaPlayerDefines.h" +#import "SHPlayer.h" +#import "SHPlayerFactory.h" +#import "SHURLProtocol.h" +#import "ControlsPlayer.h" +#import "SHPlayerConfig.h" +#import "SHPlayerConfig_Private.h" +#import "SHViewController.h" +#import "SHViewControllerProtocols.h" +#import "Utilities.h" diff --git a/SohaPlayer.framework/Versions/A/SohaPlayer b/SohaPlayer.framework/Versions/A/SohaPlayer new file mode 100644 index 0000000..ea028d0 Binary files /dev/null and b/SohaPlayer.framework/Versions/A/SohaPlayer differ diff --git a/SohaPlayer.framework/Versions/Current b/SohaPlayer.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/SohaPlayer.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/SohaPlayer.podspec b/SohaPlayer.podspec new file mode 100755 index 0000000..e0ab072 --- /dev/null +++ b/SohaPlayer.podspec @@ -0,0 +1,20 @@ +Pod::Spec.new do |s| + s.name = 'SohaPlayer' + s.version = '1.0.1' + s.summary = 'The SohaPlayerSDK iOS SDK, play video into your iOS application.' + #s.license = { :type => "Apache 2.0", :file => "SohaPlayerSDK/LICENSE" } + s.author = { "lecuong" => "jackylmao@gmail.com" } + s.homepage = 'http => "https://github.com/duplicater/SohaPlayer-Origin' + s.description = 'The SohaPlayerSDK iOS SDK, for play video into your iOS application. The SDK supports iOS7, iOS 8, iOS 9 and iOS 10' + s.frameworks = ["SystemConfiguration", "QuartzCore", "CoreMedia", "AVFoundation", "AudioToolbox", "AdSupport", "ImageIO", "WebKit", "Social", "MediaAccessibility"] + s.library = "z", "System", "stdc++", "stdc++.6", "stdc++.6.0.9", "xml2", "xml2.2", "c++" + s.requires_arc = true + s.source = { :http => "https://github.com/duplicater/SohaPlayer-Origin.git/releases/download/#{s.version}/CocoaPods.zip" } + s.platform = :ios, '7.0' + s.preserve_paths = 'SohaPlayer.framework' + s.public_header_files = 'SohaPlayer.framework/Versions/A/Headers/*{.h}' + s.source_files = 'SohaPlayer.framework/Versions/A/Headers/*{.h}' + s.resource = 'SohaPlayer.bundle' + s.vendored_frameworks = 'SohaPlayer.framework' + # s.dependency 'AFNetworking', '~> 3.0' +end \ No newline at end of file diff --git a/SohaPlayerDemo.xcodeproj/project.pbxproj b/SohaPlayerDemo.xcodeproj/project.pbxproj new file mode 100755 index 0000000..35fff7f --- /dev/null +++ b/SohaPlayerDemo.xcodeproj/project.pbxproj @@ -0,0 +1,538 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1C75CC8995510EBF455A3701 /* libPods-SohaPlayerDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C0EE0BFBD914E78FCF808B60 /* libPods-SohaPlayerDemo.a */; }; + 9E16F8E11DC1EF9F00D5DEB7 /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E16F8E01DC1EF9F00D5DEB7 /* AFNetworking.framework */; }; + 9E16F8E21DC1EFA500D5DEB7 /* AFNetworking.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E16F8E01DC1EF9F00D5DEB7 /* AFNetworking.framework */; }; + 9E16F8E31DC1EFA500D5DEB7 /* AFNetworking.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9E16F8E01DC1EF9F00D5DEB7 /* AFNetworking.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 9E483FB51DC0B82F008E617C /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EBD64A31DB7437E0002B01A /* libc++.tbd */; }; + 9E483FB61DC0B839008E617C /* libstdc++.6.0.9.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EBD64991DB743680002B01A /* libstdc++.6.0.9.tbd */; }; + 9E483FB71DC0B839008E617C /* libstdc++.6.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EBD649A1DB743680002B01A /* libstdc++.6.tbd */; }; + 9E483FB81DC0B839008E617C /* libstdc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 9EBD649B1DB743680002B01A /* libstdc++.tbd */; }; + 9E937B911DB7328500793DD2 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E937B901DB7328500793DD2 /* main.m */; }; + 9E937B941DB7328500793DD2 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E937B931DB7328500793DD2 /* AppDelegate.m */; }; + 9E937B971DB7328500793DD2 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E937B961DB7328500793DD2 /* ViewController.m */; }; + 9E937B9A1DB7328500793DD2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9E937B981DB7328500793DD2 /* Main.storyboard */; }; + 9E937B9D1DB7328600793DD2 /* SohaPlayerDemo.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 9E937B9B1DB7328600793DD2 /* SohaPlayerDemo.xcdatamodeld */; }; + 9E937B9F1DB7328600793DD2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9E937B9E1DB7328600793DD2 /* Assets.xcassets */; }; + 9E937BA21DB7328600793DD2 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9E937BA01DB7328600793DD2 /* LaunchScreen.storyboard */; }; + 9E937BAD1DB7333800793DD2 /* NativeControlsView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E937BAB1DB7333800793DD2 /* NativeControlsView.m */; }; + 9E937BAE1DB7333800793DD2 /* NativeControlsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9E937BAC1DB7333800793DD2 /* NativeControlsView.xib */; }; + 9E937BB11DB7335800793DD2 /* NativeComponents.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E937BB01DB7335800793DD2 /* NativeComponents.m */; }; + 9E937BB41DB7336E00793DD2 /* NativeComponentsFs.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E937BB31DB7336E00793DD2 /* NativeComponentsFs.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9E483FC61DC0B98F008E617C /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 9E16F8E31DC1EFA500D5DEB7 /* AFNetworking.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 9E16F8E01DC1EF9F00D5DEB7 /* AFNetworking.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = AFNetworking.framework; sourceTree = ""; }; + 9E937B8C1DB7328500793DD2 /* SohaPlayerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SohaPlayerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9E937B901DB7328500793DD2 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 9E937B921DB7328500793DD2 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 9E937B931DB7328500793DD2 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 9E937B951DB7328500793DD2 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 9E937B961DB7328500793DD2 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 9E937B991DB7328500793DD2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 9E937B9C1DB7328600793DD2 /* SohaPlayerDemo.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = SohaPlayerDemo.xcdatamodel; sourceTree = ""; }; + 9E937B9E1DB7328600793DD2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 9E937BA11DB7328600793DD2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 9E937BA31DB7328600793DD2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9E937BAA1DB7333800793DD2 /* NativeControlsView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeControlsView.h; sourceTree = ""; }; + 9E937BAB1DB7333800793DD2 /* NativeControlsView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeControlsView.m; sourceTree = ""; }; + 9E937BAC1DB7333800793DD2 /* NativeControlsView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NativeControlsView.xib; sourceTree = ""; }; + 9E937BAF1DB7335800793DD2 /* NativeComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeComponents.h; sourceTree = ""; }; + 9E937BB01DB7335800793DD2 /* NativeComponents.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeComponents.m; sourceTree = ""; }; + 9E937BB21DB7336E00793DD2 /* NativeComponentsFs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeComponentsFs.h; sourceTree = ""; }; + 9E937BB31DB7336E00793DD2 /* NativeComponentsFs.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NativeComponentsFs.m; sourceTree = ""; }; + 9EBD64831DB742E70002B01A /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; + 9EBD64851DB742F30002B01A /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 9EBD64871DB742FC0002B01A /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; + 9EBD64891DB743040002B01A /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; + 9EBD648B1DB7430C0002B01A /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + 9EBD648D1DB743140002B01A /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; }; + 9EBD648F1DB743270002B01A /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; + 9EBD64911DB7432D0002B01A /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; + 9EBD64931DB743380002B01A /* MediaAccessibility.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaAccessibility.framework; path = System/Library/Frameworks/MediaAccessibility.framework; sourceTree = SDKROOT; }; + 9EBD64951DB7434C0002B01A /* libSystem.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libSystem.tbd; path = usr/lib/libSystem.tbd; sourceTree = SDKROOT; }; + 9EBD64971DB743570002B01A /* libz.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libz.tbd; path = usr/lib/libz.tbd; sourceTree = SDKROOT; }; + 9EBD64991DB743680002B01A /* libstdc++.6.0.9.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libstdc++.6.0.9.tbd"; path = "usr/lib/libstdc++.6.0.9.tbd"; sourceTree = SDKROOT; }; + 9EBD649A1DB743680002B01A /* libstdc++.6.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libstdc++.6.tbd"; path = "usr/lib/libstdc++.6.tbd"; sourceTree = SDKROOT; }; + 9EBD649B1DB743680002B01A /* libstdc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libstdc++.tbd"; path = "usr/lib/libstdc++.tbd"; sourceTree = SDKROOT; }; + 9EBD649F1DB743750002B01A /* libxml2.2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.2.tbd; path = usr/lib/libxml2.2.tbd; sourceTree = SDKROOT; }; + 9EBD64A01DB743750002B01A /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; }; + 9EBD64A31DB7437E0002B01A /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; + C0EE0BFBD914E78FCF808B60 /* libPods-SohaPlayerDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SohaPlayerDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + EF4A296F7B77CA7E918E4022 /* Pods-SohaPlayerDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SohaPlayerDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo.release.xcconfig"; sourceTree = ""; }; + FD67FA69471C79BD52839F74 /* Pods-SohaPlayerDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SohaPlayerDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 9E937B891DB7328500793DD2 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9E483FB61DC0B839008E617C /* libstdc++.6.0.9.tbd in Frameworks */, + 9E16F8E11DC1EF9F00D5DEB7 /* AFNetworking.framework in Frameworks */, + 9E16F8E21DC1EFA500D5DEB7 /* AFNetworking.framework in Frameworks */, + 9E483FB71DC0B839008E617C /* libstdc++.6.tbd in Frameworks */, + 9E483FB81DC0B839008E617C /* libstdc++.tbd in Frameworks */, + 9E483FB51DC0B82F008E617C /* libc++.tbd in Frameworks */, + 1C75CC8995510EBF455A3701 /* libPods-SohaPlayerDemo.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 55FF18F115206E60432AF18E /* Pods */ = { + isa = PBXGroup; + children = ( + FD67FA69471C79BD52839F74 /* Pods-SohaPlayerDemo.debug.xcconfig */, + EF4A296F7B77CA7E918E4022 /* Pods-SohaPlayerDemo.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 9E937B831DB7328500793DD2 = { + isa = PBXGroup; + children = ( + 9E16F8E01DC1EF9F00D5DEB7 /* AFNetworking.framework */, + 9E937B8E1DB7328500793DD2 /* SohaPlayerDemo */, + 9E937B8D1DB7328500793DD2 /* Products */, + C6EA7FEDDD8C2591AF9E62E9 /* Frameworks */, + 55FF18F115206E60432AF18E /* Pods */, + ); + sourceTree = ""; + }; + 9E937B8D1DB7328500793DD2 /* Products */ = { + isa = PBXGroup; + children = ( + 9E937B8C1DB7328500793DD2 /* SohaPlayerDemo.app */, + ); + name = Products; + sourceTree = ""; + }; + 9E937B8E1DB7328500793DD2 /* SohaPlayerDemo */ = { + isa = PBXGroup; + children = ( + 9E937BA91DB7333800793DD2 /* NativeControlsView */, + 9E937B921DB7328500793DD2 /* AppDelegate.h */, + 9E937B931DB7328500793DD2 /* AppDelegate.m */, + 9E937B951DB7328500793DD2 /* ViewController.h */, + 9E937B961DB7328500793DD2 /* ViewController.m */, + 9E937BAF1DB7335800793DD2 /* NativeComponents.h */, + 9E937BB01DB7335800793DD2 /* NativeComponents.m */, + 9E937BB21DB7336E00793DD2 /* NativeComponentsFs.h */, + 9E937BB31DB7336E00793DD2 /* NativeComponentsFs.m */, + 9E937B981DB7328500793DD2 /* Main.storyboard */, + 9E937B9E1DB7328600793DD2 /* Assets.xcassets */, + 9E937BA01DB7328600793DD2 /* LaunchScreen.storyboard */, + 9E937BA31DB7328600793DD2 /* Info.plist */, + 9E937B9B1DB7328600793DD2 /* SohaPlayerDemo.xcdatamodeld */, + 9E937B8F1DB7328500793DD2 /* Supporting Files */, + ); + path = SohaPlayerDemo; + sourceTree = ""; + }; + 9E937B8F1DB7328500793DD2 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 9E937B901DB7328500793DD2 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 9E937BA91DB7333800793DD2 /* NativeControlsView */ = { + isa = PBXGroup; + children = ( + 9E937BAA1DB7333800793DD2 /* NativeControlsView.h */, + 9E937BAB1DB7333800793DD2 /* NativeControlsView.m */, + 9E937BAC1DB7333800793DD2 /* NativeControlsView.xib */, + ); + path = NativeControlsView; + sourceTree = ""; + }; + C6EA7FEDDD8C2591AF9E62E9 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 9EBD64A31DB7437E0002B01A /* libc++.tbd */, + 9EBD649F1DB743750002B01A /* libxml2.2.tbd */, + 9EBD64A01DB743750002B01A /* libxml2.tbd */, + 9EBD64991DB743680002B01A /* libstdc++.6.0.9.tbd */, + 9EBD649A1DB743680002B01A /* libstdc++.6.tbd */, + 9EBD649B1DB743680002B01A /* libstdc++.tbd */, + 9EBD64971DB743570002B01A /* libz.tbd */, + 9EBD64951DB7434C0002B01A /* libSystem.tbd */, + 9EBD64931DB743380002B01A /* MediaAccessibility.framework */, + 9EBD64911DB7432D0002B01A /* Social.framework */, + 9EBD648F1DB743270002B01A /* WebKit.framework */, + 9EBD648D1DB743140002B01A /* AdSupport.framework */, + 9EBD648B1DB7430C0002B01A /* AudioToolbox.framework */, + 9EBD64891DB743040002B01A /* AVFoundation.framework */, + 9EBD64871DB742FC0002B01A /* CoreMedia.framework */, + 9EBD64851DB742F30002B01A /* QuartzCore.framework */, + 9EBD64831DB742E70002B01A /* SystemConfiguration.framework */, + C0EE0BFBD914E78FCF808B60 /* libPods-SohaPlayerDemo.a */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 9E937B8B1DB7328500793DD2 /* SohaPlayerDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9E937BA61DB7328600793DD2 /* Build configuration list for PBXNativeTarget "SohaPlayerDemo" */; + buildPhases = ( + 49B2C7EBFFD1524C0F290367 /* [CP] Check Pods Manifest.lock */, + 9E937B881DB7328500793DD2 /* Sources */, + 9E937B891DB7328500793DD2 /* Frameworks */, + 9E937B8A1DB7328500793DD2 /* Resources */, + 9E483FC61DC0B98F008E617C /* Embed Frameworks */, + F7FF5B6920CCAE190260CB6E /* [CP] Embed Pods Frameworks */, + E50E6E6755E7692D8FC98DA8 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SohaPlayerDemo; + productName = SohaPlayerDemo; + productReference = 9E937B8C1DB7328500793DD2 /* SohaPlayerDemo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 9E937B841DB7328500793DD2 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = "Le Cuong"; + TargetAttributes = { + 9E937B8B1DB7328500793DD2 = { + CreatedOnToolsVersion = 8.0; + DevelopmentTeam = 76X7GRK948; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 9E937B871DB7328500793DD2 /* Build configuration list for PBXProject "SohaPlayerDemo" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 9E937B831DB7328500793DD2; + productRefGroup = 9E937B8D1DB7328500793DD2 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 9E937B8B1DB7328500793DD2 /* SohaPlayerDemo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 9E937B8A1DB7328500793DD2 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9E937BA21DB7328600793DD2 /* LaunchScreen.storyboard in Resources */, + 9E937BAE1DB7333800793DD2 /* NativeControlsView.xib in Resources */, + 9E937B9F1DB7328600793DD2 /* Assets.xcassets in Resources */, + 9E937B9A1DB7328500793DD2 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 49B2C7EBFFD1524C0F290367 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + E50E6E6755E7692D8FC98DA8 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + F7FF5B6920CCAE190260CB6E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SohaPlayerDemo/Pods-SohaPlayerDemo-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 9E937B881DB7328500793DD2 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9E937BB41DB7336E00793DD2 /* NativeComponentsFs.m in Sources */, + 9E937BB11DB7335800793DD2 /* NativeComponents.m in Sources */, + 9E937B9D1DB7328600793DD2 /* SohaPlayerDemo.xcdatamodeld in Sources */, + 9E937B971DB7328500793DD2 /* ViewController.m in Sources */, + 9E937BAD1DB7333800793DD2 /* NativeControlsView.m in Sources */, + 9E937B941DB7328500793DD2 /* AppDelegate.m in Sources */, + 9E937B911DB7328500793DD2 /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 9E937B981DB7328500793DD2 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9E937B991DB7328500793DD2 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 9E937BA01DB7328600793DD2 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 9E937BA11DB7328600793DD2 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 9E937BA41DB7328600793DD2 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 9E937BA51DB7328600793DD2 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVES = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 9E937BA71DB7328600793DD2 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FD67FA69471C79BD52839F74 /* Pods-SohaPlayerDemo.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = 76X7GRK948; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/SohaPlayerDemo", + "$(PROJECT_DIR)", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_ROOT}/Headers/Public\"", + "\"${PODS_ROOT}/Headers/Public/UrbanAirship-iOS-SDK\"", + "\"$(SRCROOT)/include\"/**", + ); + INFOPLIST_FILE = SohaPlayerDemo/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.vcc.jackylmao.SohaPlayerDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 9E937BA81DB7328600793DD2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EF4A296F7B77CA7E918E4022 /* Pods-SohaPlayerDemo.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = 76X7GRK948; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/SohaPlayerDemo", + "$(PROJECT_DIR)", + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "\"${PODS_ROOT}/Headers/Public\"", + "\"${PODS_ROOT}/Headers/Public/UrbanAirship-iOS-SDK\"", + "\"$(SRCROOT)/include\"/**", + ); + INFOPLIST_FILE = SohaPlayerDemo/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.vcc.jackylmao.SohaPlayerDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 9E937B871DB7328500793DD2 /* Build configuration list for PBXProject "SohaPlayerDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9E937BA41DB7328600793DD2 /* Debug */, + 9E937BA51DB7328600793DD2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9E937BA61DB7328600793DD2 /* Build configuration list for PBXNativeTarget "SohaPlayerDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9E937BA71DB7328600793DD2 /* Debug */, + 9E937BA81DB7328600793DD2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + 9E937B9B1DB7328600793DD2 /* SohaPlayerDemo.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 9E937B9C1DB7328600793DD2 /* SohaPlayerDemo.xcdatamodel */, + ); + currentVersion = 9E937B9C1DB7328600793DD2 /* SohaPlayerDemo.xcdatamodel */; + path = SohaPlayerDemo.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 9E937B841DB7328500793DD2 /* Project object */; +} diff --git a/SohaPlayerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/SohaPlayerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..21760d8 --- /dev/null +++ b/SohaPlayerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/SohaPlayerDemo.xcodeproj/project.xcworkspace/xcuserdata/JackyLmao.xcuserdatad/UserInterfaceState.xcuserstate b/SohaPlayerDemo.xcodeproj/project.xcworkspace/xcuserdata/JackyLmao.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100755 index 0000000..650d20e Binary files /dev/null and b/SohaPlayerDemo.xcodeproj/project.xcworkspace/xcuserdata/JackyLmao.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SohaPlayerDemo.xcodeproj/xcuserdata/JackyLmao.xcuserdatad/xcschemes/SohaPlayerDemo.xcscheme b/SohaPlayerDemo.xcodeproj/xcuserdata/JackyLmao.xcuserdatad/xcschemes/SohaPlayerDemo.xcscheme new file mode 100755 index 0000000..e8fbfb4 --- /dev/null +++ b/SohaPlayerDemo.xcodeproj/xcuserdata/JackyLmao.xcuserdatad/xcschemes/SohaPlayerDemo.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SohaPlayerDemo.xcodeproj/xcuserdata/JackyLmao.xcuserdatad/xcschemes/xcschememanagement.plist b/SohaPlayerDemo.xcodeproj/xcuserdata/JackyLmao.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100755 index 0000000..a4a7776 --- /dev/null +++ b/SohaPlayerDemo.xcodeproj/xcuserdata/JackyLmao.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,22 @@ + + + + + SchemeUserState + + SohaPlayerDemo.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 9E937B8B1DB7328500793DD2 + + primary + + + + + diff --git a/SohaPlayerDemo.xcworkspace/contents.xcworkspacedata b/SohaPlayerDemo.xcworkspace/contents.xcworkspacedata new file mode 100755 index 0000000..61735f5 --- /dev/null +++ b/SohaPlayerDemo.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/SohaPlayerDemo.xcworkspace/xcuserdata/JackyLmao.xcuserdatad/UserInterfaceState.xcuserstate b/SohaPlayerDemo.xcworkspace/xcuserdata/JackyLmao.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100755 index 0000000..2c704a3 Binary files /dev/null and b/SohaPlayerDemo.xcworkspace/xcuserdata/JackyLmao.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/SohaPlayerDemo.xcworkspace/xcuserdata/JackyLmao.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/SohaPlayerDemo.xcworkspace/xcuserdata/JackyLmao.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100755 index 0000000..ed9a9b4 --- /dev/null +++ b/SohaPlayerDemo.xcworkspace/xcuserdata/JackyLmao.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/SohaPlayerDemo/.DS_Store b/SohaPlayerDemo/.DS_Store new file mode 100755 index 0000000..4215321 Binary files /dev/null and b/SohaPlayerDemo/.DS_Store differ diff --git a/SohaPlayerDemo/AppDelegate.h b/SohaPlayerDemo/AppDelegate.h new file mode 100755 index 0000000..8339027 --- /dev/null +++ b/SohaPlayerDemo/AppDelegate.h @@ -0,0 +1,22 @@ +// +// AppDelegate.h +// SohaPlayerDemo +// +// Created by Le Cuong on 10/18/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@property (readonly, strong) NSPersistentContainer *persistentContainer; + +- (void)saveContext; + + +@end + diff --git a/SohaPlayerDemo/AppDelegate.m b/SohaPlayerDemo/AppDelegate.m new file mode 100755 index 0000000..6fc8a21 --- /dev/null +++ b/SohaPlayerDemo/AppDelegate.m @@ -0,0 +1,98 @@ +// +// AppDelegate.m +// SohaPlayerDemo +// +// Created by Le Cuong on 10/18/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + // Saves changes in the application's managed object context before the application terminates. + [self saveContext]; +} + + +#pragma mark - Core Data stack + +@synthesize persistentContainer = _persistentContainer; + +- (NSPersistentContainer *)persistentContainer { + // The persistent container for the application. This implementation creates and returns a container, having loaded the store for the application to it. + @synchronized (self) { + if (_persistentContainer == nil) { + _persistentContainer = [[NSPersistentContainer alloc] initWithName:@"SohaPlayerDemo"]; + [_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) { + if (error != nil) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + + /* + Typical reasons for an error here include: + * The parent directory does not exist, cannot be created, or disallows writing. + * The persistent store is not accessible, due to permissions or data protection when the device is locked. + * The device is out of space. + * The store could not be migrated to the current model version. + Check the error message to determine what the actual problem was. + */ + NSLog(@"Unresolved error %@, %@", error, error.userInfo); + abort(); + } + }]; + } + } + + return _persistentContainer; +} + +#pragma mark - Core Data Saving support + +- (void)saveContext { + NSManagedObjectContext *context = self.persistentContainer.viewContext; + NSError *error = nil; + if ([context hasChanges] && ![context save:&error]) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, error.userInfo); + abort(); + } +} + +@end diff --git a/SohaPlayerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/SohaPlayerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100755 index 0000000..118c98f --- /dev/null +++ b/SohaPlayerDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/SohaPlayerDemo/Base.lproj/LaunchScreen.storyboard b/SohaPlayerDemo/Base.lproj/LaunchScreen.storyboard new file mode 100755 index 0000000..fdf3f97 --- /dev/null +++ b/SohaPlayerDemo/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SohaPlayerDemo/Base.lproj/Main.storyboard b/SohaPlayerDemo/Base.lproj/Main.storyboard new file mode 100755 index 0000000..0bb9084 --- /dev/null +++ b/SohaPlayerDemo/Base.lproj/Main.storyboard @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SohaPlayerDemo/Info.plist b/SohaPlayerDemo/Info.plist new file mode 100755 index 0000000..b896760 --- /dev/null +++ b/SohaPlayerDemo/Info.plist @@ -0,0 +1,57 @@ + + + + + secretkey + 9388b7e9cde39f45ea19a2f5b26c7176 + appkey + 5825780b465d544b + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + NSExceptionDomains + + yourdomain.com + + NSIncludesSubdomains + + NSThirdPartyExceptionRequiresForwardSecrecy + + + + + + diff --git a/SohaPlayerDemo/NativeComponents.h b/SohaPlayerDemo/NativeComponents.h new file mode 100755 index 0000000..b8008ea --- /dev/null +++ b/SohaPlayerDemo/NativeComponents.h @@ -0,0 +1,13 @@ +// +// NativeComponents.h +// SohaPlayerDemo +// +// Created by Le Cuong on 10/18/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import + +@interface NativeComponents : UIViewController + +@end diff --git a/SohaPlayerDemo/NativeComponents.m b/SohaPlayerDemo/NativeComponents.m new file mode 100755 index 0000000..5184e6f --- /dev/null +++ b/SohaPlayerDemo/NativeComponents.m @@ -0,0 +1,106 @@ +// +// NativeComponents.m +// SohaPlayerDemo +// +// Created by Le Cuong on 10/18/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import "NativeComponents.h" +#import "NativeControlsView.h" +#import + +@interface NativeComponents () +@property (weak, nonatomic) IBOutlet UIView *playerContainer; +@property (weak, nonatomic) IBOutlet NativeControlsView *nativeControls; + +@property (retain, nonatomic) SHViewController *player; + +@end + +@implementation NativeComponents{ + SHPlayerConfig *config; +} + + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + _nativeControls.delegate = self; + + +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + + [self setupPlayer]; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (void)setupPlayer{ + + config = [[SHPlayerConfig alloc] initWithSourceUrl:@"http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8" appkey:nil secretKey:nil vid:nil]; + + [self hideHTMLControls]; + + _player = [[SHViewController alloc] initWithConfiguration:config webRq:NO]; + _player.delegate = self; + + //set frame + + [_player loadPlayerIntoViewController:self]; + + [_player.view setFrame:self.playerContainer.bounds]; + + [self.playerContainer insertSubview:_player.view atIndex:0]; +} + +- (void)SHPlayer:(SHViewController*)player playerLoadStateDidChange:(SHMediaLoadState)state +{ + NSLog(@"playerLoadStateDidChange %lu",(unsigned long)state); +} +- (void)SHPlayer:(SHViewController*)player playerPlaybackStateDidChange:(SHMediaPlaybackState)state +{ + NSLog(@"state player %ld",(long)state); + +} +- (void)SHPlayer:(SHViewController*)player playerFullScreenToggled:(BOOL)isFullScreen +{ + +} +- (void)SHPlayer:(SHViewController*)player didFailWithError:(NSError*)error +{ + +} + + +- (void)hideHTMLControls { + [config addConfigKey:@"controlBarContainer.plugin" withValue:@"false"]; + [config addConfigKey:@"topBarContainer.plugin" withValue:@"false"]; + [config addConfigKey:@"largePlayBtn.plugin" withValue:@"false"]; +} + +- (void)play { + [self.player.SHPlayer play]; +} + +- (void)pause { + [self.player.SHPlayer pause]; + +} + +- (void)timeScrubberChange:(UISlider*)slider { + if (self.player.SHPlayer.duration){ + slider.maximumValue = self.player.SHPlayer.duration; + } else{ + slider.maximumValue = 100; + } + self.player.SHPlayer.currentPlaybackTime = slider.value; +} + +@end diff --git a/SohaPlayerDemo/NativeComponentsFs.h b/SohaPlayerDemo/NativeComponentsFs.h new file mode 100755 index 0000000..f9506bc --- /dev/null +++ b/SohaPlayerDemo/NativeComponentsFs.h @@ -0,0 +1,13 @@ +// +// NativeComponentsFs.h +// SohaPlayerDemo +// +// Created by Le Cuong on 10/18/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import + +@interface NativeComponentsFs : UIViewController + +@end diff --git a/SohaPlayerDemo/NativeComponentsFs.m b/SohaPlayerDemo/NativeComponentsFs.m new file mode 100755 index 0000000..2b1834b --- /dev/null +++ b/SohaPlayerDemo/NativeComponentsFs.m @@ -0,0 +1,56 @@ +// +// NativeComponentsFs.m +// SohaPlayerDemo +// +// Created by Le Cuong on 10/18/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import "NativeComponentsFs.h" +#import + + +@interface NativeComponentsFs () + +@property (retain, nonatomic) SHViewController *player; + +@end + +@implementation NativeComponentsFs + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +- (SHViewController *)player { + if (!_player) { + + // Account Params + SHPlayerConfig *config = [[SHPlayerConfig alloc] initWithSourceUrl:@"http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8" appkey:nil secretKey:nil vid:nil]; + + + _player = [[SHViewController alloc] initWithConfiguration:config webRq:NO]; + + [_player setShowControls:YES]; + } + return _player; +} + +- (void)viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + //Present view controller - inline view + // self.player.view.frame = (CGRect){0, 0, 320, 180}; + // [self.player loadPlayerIntoViewController:self]; + // [self.view addSubview:_player.view]; + //Present view controller - Fullscreen view + [self presentViewController:self.player animated:YES completion:nil]; + [self.player.SHPlayer play]; +} + +@end diff --git a/SohaPlayerDemo/NativeControlsView/NativeControlsView.h b/SohaPlayerDemo/NativeControlsView/NativeControlsView.h new file mode 100755 index 0000000..5204631 --- /dev/null +++ b/SohaPlayerDemo/NativeControlsView/NativeControlsView.h @@ -0,0 +1,29 @@ +// +// NativeControlsView.h +// nativeComponents +// +// Created by Eliza Sapir on 15/02/2016. +// Copyright © 2016 Kaltura. All rights reserved. +// + +#import +@import CoreMedia; + +@protocol NativeControlsDelegate + +@required +- (void)play; +- (void)pause; +- (void)timeScrubberChange:(UISlider*)slider; +//- (void)toggFullSC:(BOOL)isFull; + +@end + +@interface NativeControlsView : UIView +@property (weak, nonatomic) IBOutlet UIButton *playBtn; +@property (weak, nonatomic) IBOutlet UISlider *progressSlider; +@property (nonatomic, weak) IBOutlet id delegate; +@property (weak, nonatomic) IBOutlet UIButton *toggfullSCBtn; +- (IBAction)toggfulSCBtnClicked:(id)sender; + +@end diff --git a/SohaPlayerDemo/NativeControlsView/NativeControlsView.m b/SohaPlayerDemo/NativeControlsView/NativeControlsView.m new file mode 100755 index 0000000..7d79298 --- /dev/null +++ b/SohaPlayerDemo/NativeControlsView/NativeControlsView.m @@ -0,0 +1,76 @@ +// +// NativeControlsView.m +// nativeComponents +// +// Created by Eliza Sapir on 15/02/2016. +// Copyright © 2016 Kaltura. All rights reserved. +// + +#import "NativeControlsView.h" + +@implementation NativeControlsView + +/* +// Only override drawRect: if you perform custom drawing. +// An empty implementation adversely affects performance during animation. +- (void)drawRect:(CGRect)rect { + // Drawing code +} +*/ + +-(id)initWithCoder:(NSCoder *)aDecoder{ + self = [super initWithCoder:aDecoder]; + + if (self) { + if (self.subviews.count == 0) { + UINib *nib = [UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil]; + NativeControlsView *subview = [[nib instantiateWithOwner:self options:nil] objectAtIndex:0]; + subview.frame = self.bounds; + [self addSubview:subview]; + } + } + return self; +} + +- (void)layoutSubviews { + NativeControlsView *subview = self.subviews.firstObject; + if ([subview isKindOfClass:[NativeControlsView class]]) { + subview.delegate = self.delegate; + } + +} + +- (IBAction)play:(id)sender { + if ([self.playBtn.titleLabel.text isEqual:@"Play"] && + [_delegate respondsToSelector:@selector(play)]) { + [_delegate play]; + [self.playBtn setTitle:@"Pause" forState:UIControlStateNormal]; + } else if ([_delegate respondsToSelector:@selector(pause)]) { + [_delegate pause]; + [self.playBtn setTitle:@"Play" forState:UIControlStateNormal]; + } +} + +- (IBAction)timeScrubberChange:(id)sender { + if ([_delegate respondsToSelector:@selector(timeScrubberChange:)]) { + [_delegate timeScrubberChange:sender]; + } +} + +//- (instancetype)initWithFrame:(CGRect)frame { +// self = [super initWithFrame:frame]; +// if (self) { +// if (self.subviews.count == 0) { +// UINib *nib = [UINib nibWithNibName:NSStringFromClass([self class]) bundle:nil]; +// UIView *subview = [[nib instantiateWithOwner:self options:nil] objectAtIndex:0]; +// subview.frame = self.bounds; +// [self addSubview:subview]; +// } +// } +// return self; +//} + +- (IBAction)toggfulSCBtnClicked:(id)sender { + +} +@end diff --git a/SohaPlayerDemo/NativeControlsView/NativeControlsView.xib b/SohaPlayerDemo/NativeControlsView/NativeControlsView.xib new file mode 100755 index 0000000..44addc9 --- /dev/null +++ b/SohaPlayerDemo/NativeControlsView/NativeControlsView.xib @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SohaPlayerDemo/SohaPlayerDemo.xcdatamodeld/.xccurrentversion b/SohaPlayerDemo/SohaPlayerDemo.xcdatamodeld/.xccurrentversion new file mode 100755 index 0000000..e31e884 --- /dev/null +++ b/SohaPlayerDemo/SohaPlayerDemo.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + SohaPlayerDemo.xcdatamodel + + diff --git a/SohaPlayerDemo/SohaPlayerDemo.xcdatamodeld/SohaPlayerDemo.xcdatamodel/contents b/SohaPlayerDemo/SohaPlayerDemo.xcdatamodeld/SohaPlayerDemo.xcdatamodel/contents new file mode 100755 index 0000000..ad82c3b --- /dev/null +++ b/SohaPlayerDemo/SohaPlayerDemo.xcdatamodeld/SohaPlayerDemo.xcdatamodel/contents @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SohaPlayerDemo/ViewController.h b/SohaPlayerDemo/ViewController.h new file mode 100755 index 0000000..f3e3a69 --- /dev/null +++ b/SohaPlayerDemo/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// SohaPlayerDemo +// +// Created by Le Cuong on 10/18/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/SohaPlayerDemo/ViewController.m b/SohaPlayerDemo/ViewController.m new file mode 100755 index 0000000..aad37ba --- /dev/null +++ b/SohaPlayerDemo/ViewController.m @@ -0,0 +1,29 @@ +// +// ViewController.m +// SohaPlayerDemo +// +// Created by Le Cuong on 10/18/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view, typically from a nib. +} + + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + + +@end diff --git a/SohaPlayerDemo/main.m b/SohaPlayerDemo/main.m new file mode 100755 index 0000000..f6f99de --- /dev/null +++ b/SohaPlayerDemo/main.m @@ -0,0 +1,16 @@ +// +// main.m +// SohaPlayerDemo +// +// Created by Le Cuong on 10/18/16. +// Copyright © 2016 Le Cuong. All rights reserved. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +}