-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Public release 1.1.0
- Loading branch information
Showing
105 changed files
with
4,765 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Sources/VGSShowSDK/Core/APIClient/VGSShowRequestOptions/VGSShowRequestOptions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// VGSShowRequestOptions.swift | ||
// Pods-VGSShowDemoApp | ||
// | ||
|
||
import Foundation | ||
|
||
/// Holds additional request options. | ||
public struct VGSShowRequestOptions { | ||
|
||
/// Request timeout interval, default is `nil`. | ||
public var requestTimeoutInterval: TimeInterval? = nil | ||
|
||
/// :nodoc: | ||
public init() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
Sources/VGSShowSDK/Core/Show/Decoders/RawDataDecoders/VGSShowBase64Decoder.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// VGSShowBase64Decoder.swift | ||
// VGSShowSDK | ||
// | ||
|
||
import Foundation | ||
|
||
/// Decodes to base64 data. | ||
final internal class VGSShowBase64Decoder: VGSShowJSONDecoderProtocol { | ||
|
||
// MARK: - VGSShowJSONDecoderProtocol | ||
|
||
func decodeJSONForContentPath(_ contentPath: String, json: VGSJSONData) -> VGSShowDecodingResult { | ||
|
||
guard let encodedDataBase64: String = json.valueForKeyPath(keyPath: contentPath) else { | ||
return .failure(VGSShowError(type: .fieldNotFound)) | ||
} | ||
|
||
guard let data = Data(base64Encoded: encodedDataBase64) else { | ||
return .failure(VGSShowError(type: .invalidBase64Data)) | ||
} | ||
|
||
let rawDataResult = VGSShowDecodedContent.rawData(data) | ||
|
||
return .success(rawDataResult) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
Sources/VGSShowSDK/Core/Show/DecodingContentModes/PDFDecoding/VGSShowPDFContent.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// VGSShowPDFContent.swift | ||
// VGSShowSDK | ||
// | ||
|
||
import Foundation | ||
|
||
/// PDF content type. | ||
internal enum VGSShowPDFContent { | ||
|
||
/** | ||
Raw data to display. | ||
- Parameters: | ||
- data: `Data` object. | ||
*/ | ||
case rawData(_ data: Data) | ||
|
||
/** | ||
URL referring to pdf content. | ||
- Parameters: | ||
- url: `URL` object. | ||
// */ | ||
// case url(_ url: URL) | ||
} |
29 changes: 29 additions & 0 deletions
29
Sources/VGSShowSDK/Core/Show/DecodingContentModes/PDFDecoding/VGSShowPDFFormat.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// VGSShowPDFFormat.swift | ||
// VGSShowSDK | ||
|
||
import Foundation | ||
|
||
/// Specifies decoding mode for pdf. | ||
internal enum VGSShowPDFFormat { | ||
|
||
// /** | ||
// Decode pdf data as String URL using content path. | ||
// */ | ||
// case url | ||
|
||
/** | ||
Decode as raw Data (content path is ingnored). | ||
- Parameters: | ||
- format: `VGSShowImageRawDataFormat`, specified raw data format. | ||
*/ | ||
case rawData(_ format: VGSShowRawDataFormat) | ||
} | ||
|
||
/// Raw data format. | ||
internal enum VGSShowRawDataFormat { | ||
|
||
/// Decode base64 data. | ||
case base64 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.