Skip to content

Commit

Permalink
Release version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Team Mobile Schorsch committed Dec 15, 2021
1 parent 0045174 commit 861230d
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 40 deletions.
4 changes: 2 additions & 2 deletions Documentation/source/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Once you have your Swift package set up, adding `GiniCaptureSDK` as a dependency

```swift
dependencies: [
.package(url: "https://github.com/gini/capture-sdk-ios.git", .exact("1.1.0"))
.package(url: "https://github.com/gini/capture-sdk-ios.git", .exact("1.1.1"))
]
```

In case that you want to use the certificate pinning in the library, add `GiniCaptureSDKPinning`:
```swift
dependencies: [
.package(url: "https://github.com/gini/capture-sdk-pinning-ios.git", .exact("1.1.0"))
.package(url: "https://github.com/gini/capture-sdk-pinning-ios.git", .exact("1.1.1"))
]
```

Expand Down
14 changes: 5 additions & 9 deletions Documentation/source/License.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
License
=======

The [Gini Capture SDK for iOS](https://github.com/gini/capture-sdk-ios) is licensed under a Private License.

Always make sure to ship all license notices and permissions with your application.
## Gini Capture SDK for iOS is licensed under a Private License.

Copyright (c) 2014-2021, Gini GmbH
All rights reserved.
Expand All @@ -21,7 +19,7 @@ Always make sure to ship all license notices and permissions with your applicati

The Gini Capture SDK uses code from the following libraries:

## [Gini Bank API Library for iOS](https://github.com/gini/bank-api-library-ios)
### Gini Bank API Library for iOS

The MIT License (MIT)

Expand All @@ -45,9 +43,7 @@ The Gini Capture SDK uses code from the following libraries:
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

The [Gini Capture SDK Pinning for iOS](https://github.com/gini/capture-sdk-pinning-ios) is licensed under a Private License.

Always make sure to ship all license notices and permissions with your application.
## Gini Capture SDK Pinning for iOS is licensed under a Private License.

Copyright (c) 2014-2021, Gini GmbH
All rights reserved.
Expand All @@ -65,7 +61,7 @@ Always make sure to ship all license notices and permissions with your applicati

The Gini Capture SDK Pinning uses code from the following libraries:

## [Gini Bank API Library Pinning for iOS](https://github.com/gini/bank-api-library-pinning-ios)
### Gini Bank API Library Pinning for iOS

The MIT License (MIT)

Expand All @@ -89,7 +85,7 @@ The Gini Capture SDK Pinning uses code from the following libraries:
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

## [TrustKit](https://github.com/datatheorem/TrustKit)
### [TrustKit](https://github.com/datatheorem/TrustKit)

The MIT License (MIT)

Expand Down
9 changes: 4 additions & 5 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Copyright (c) 2014-2021, Gini GmbH
All rights reserved.

Always make sure to ship all license notices and permissions with your application.

License
=======

The [Gini Capture SDK for iOS](https://github.com/gini/capture-sdk-ios) is licensed under a Private License.

Always make sure to ship all license notices and permissions with your application.
## Gini Capture SDK for iOS is licensed under a Private License.

Copyright (c) 2014-2021, Gini GmbH
All rights reserved.
Expand All @@ -24,7 +24,7 @@ Always make sure to ship all license notices and permissions with your applicati

The Gini Capture SDK uses code from the following libraries:

## [Gini Bank API Library for iOS](https://github.com/gini/bank-api-library-ios)
### Gini Bank API Library for iOS

The MIT License (MIT)

Expand All @@ -47,4 +47,3 @@ The Gini Capture SDK uses code from the following libraries:
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.

7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<p align="center">
<img src="./Documentation/jazzy-theme/assets/img/logo.png" width="250">
<img src="./GiniCapture_Logo.png" width="250">
</p>

# Gini Capture SDK for iOS

[![Platform](https://img.shields.io/badge/platform-iOS-lightgrey.svg)]()
Expand All @@ -24,9 +25,7 @@ Further documentation with installation, integration or customization guides can
## Example

We are providing example apps for Swift and Objective-C. These apps demonstrate how to integrate the Gini Capture SDK with the Screen API and Component API. To run the example project, clone the repo and run `pod install` from the Example directory first.
To inject your API credentials into the Example app, just add to the Example directory the `Credentials.plist` file with the following format:

<img border=1 src=credentials_plist_format.png/>
To inject your API credentials into the Example app, just add to the Example directory the `Credentials.plist` file.

## Requirements

Expand Down
2 changes: 1 addition & 1 deletion Sources/GiniCaptureSDK/Core/Extensions/UIView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import UIKit
extension UIView {
/** Loads instance from nib with the same name. */
func loadNib() -> UIView {
let bundle = Bundle.module
let bundle = giniCaptureBundle()
let nibName = type(of: self).description().components(separatedBy: ".").last!
let nib = UINib(nibName: nibName, bundle: bundle)
return nib.instantiate(withOwner: self, options: nil).first as! UIView
Expand Down
5 changes: 5 additions & 0 deletions Sources/GiniCaptureSDK/Core/GiniConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,11 @@ import UIKit
}
}

/**
Should be set if the default name "Localizable.strings" are not used
*/
public var localizedStringsTableName: String?

// Undocumented--Xamarin only
@objc public var closeButtonResource: PreferredButtonResource?
@objc public var helpButtonResource: PreferredButtonResource?
Expand Down
12 changes: 10 additions & 2 deletions Sources/GiniCaptureSDK/Core/Helpers/GiniCaptureUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,16 @@ public func NSLocalizedStringPreferredFormat(_ key: String,
fallbackKey: String = "",
comment: String,
isCustomizable: Bool = true) -> String {
let clientString = NSLocalizedString(key, comment: comment)
let fallbackClientString = NSLocalizedString(fallbackKey, comment: comment)
var clientString: String
var fallbackClientString: String
if let localizedResourceName = GiniConfiguration.shared.localizedStringsTableName {
clientString = NSLocalizedString(key, tableName: localizedResourceName, comment: comment)
fallbackClientString = NSLocalizedString(fallbackKey,tableName: localizedResourceName, comment: comment)
} else {
clientString = NSLocalizedString(key, comment: comment)
fallbackClientString = NSLocalizedString(fallbackKey, comment: comment)
}

let format: String
if (clientString.lowercased() != key.lowercased() || fallbackClientString.lowercased() != fallbackKey.lowercased())
&& isCustomizable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class GiniPreferredButtonResource: PreferredButtonResource {
private let localizedTextComment: String?
private let localizedConfigEntry: String?
private let appBundle = Bundle.main
private let libBundle = Bundle.module
private let libBundle = giniCaptureBundle()
private var imageSource: ResourceOrigin {
if let name = imageName {
if UIImage(named: name, in: appBundle, compatibleWith: nil) != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class CaptureSuggestionsView: UIView {
fileprivate let repeatInterval: TimeInterval = 5
fileprivate let superViewBottomAnchor: NSLayoutYAxisAnchor
fileprivate let suggestionIconImage = UIImage(named: "analysisSuggestionsIcon",
in: Bundle.module, compatibleWith: nil)
in: giniCaptureBundle(), compatibleWith: nil)
fileprivate var suggestionTexts: [String] = [
.localized(resource: AnalysisStrings.suggestion1Text),
.localized(resource: AnalysisStrings.suggestion2Text),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ final class SupportedFormatsViewController: UITableViewController {
(.localized(resource: HelpStrings.supportedFormatsSection1Title),
[.localized(resource: HelpStrings.supportedFormatsSection1Item1Text)],
UIImage(named: "supportedFormatsIcon",
in: Bundle.module,
in: giniCaptureBundle(),
compatibleWith: nil),
GiniConfiguration.shared.supportedFormatsIconColor),
(.localized(resource: HelpStrings.supportedFormatsSection2Title),
[.localized(resource: HelpStrings.supportedFormatsSection2Item1Text),
.localized(resource: HelpStrings.supportedFormatsSection2Item2Text)],
UIImage(named: "nonSupportedFormatsIcon", in: Bundle.module, compatibleWith: nil),
UIImage(named: "nonSupportedFormatsIcon", in: giniCaptureBundle(), compatibleWith: nil),
GiniConfiguration.shared.nonSupportedFormatsIconColor)
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class MultipageReviewMainCollectionCell: UICollectionViewCell {
imageView.clipsToBounds = true

imageView.accessibilityLabel = NSLocalizedString("ginicapture.review.documentImageTitle",
bundle: Bundle.module,
bundle: giniCaptureBundle(),
comment: "Document")

return imageView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ final class MultipageReviewPagesCollectionCell: UICollectionViewCell {
}()

lazy var draggableIcon: UIImageView = {
let image = UIImage(named: "draggablePageIcon", in: Bundle.module, compatibleWith: nil)
let image = UIImage(named: "draggablePageIcon", in: giniCaptureBundle(), compatibleWith: nil)
let imageView = UIImageView(image: image?.withRenderingMode(.alwaysTemplate))
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.contentMode = .scaleAspectFit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public final class MultipageReviewViewController: UIViewController {
action: #selector(rotateImageButtonAction))

button.accessibilityLabel = NSLocalizedString("ginicapture.review.rotateButton",
bundle: Bundle.module,
bundle: giniCaptureBundle(),
comment: "Rotate button")
return button
}()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ final class PageStateView: UIView {
case .succeeded:
backgroundColor = Colors.Gini.springGreen
icon.image = UIImage.init(named: "successfullUploadIcon",
in: Bundle.module,
in: giniCaptureBundle(),
compatibleWith: nil)
loadingIndicator.stopAnimating()

case .failed:
backgroundColor = Colors.Gini.crimson
icon.image = UIImage.init(named: "failureUploadIcon",
in: Bundle.module,
in: giniCaptureBundle(),
compatibleWith: nil)
loadingIndicator.stopAnimating()
case .loading:
Expand Down
2 changes: 1 addition & 1 deletion Sources/GiniCaptureSDKVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
// Created by Nadya Karaban on 29.10.21.
//

public let GiniCaptureSDKVersion = "1.1.0"
public let GiniCaptureSDKVersion = "1.1.1"
10 changes: 7 additions & 3 deletions Tests/GiniCaptureSDKTests/GiniCaptureTestsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import UIKit
@testable import GiniCaptureSDK
final class GiniCaptureTestsHelper {

class func giniTestBundle() -> Bundle {
return Bundle.module
}

class func fileData(named name: String, fileExtension: String) -> Data? {
let fileURLPath: String? = Bundle.module
.path(forResource: name, ofType: fileExtension)
Expand All @@ -19,12 +23,12 @@ final class GiniCaptureTestsHelper {

class func loadImage(named name: String, fileExtension: String = "jpg") -> UIImage {
return UIImage(named: name,
in: Bundle.module,
in: giniTestBundle(),
compatibleWith: nil) ?? loadImageFromResources(named: name, fileExtension: fileExtension)!
}

fileprivate class func loadImageFromResources(named name: String, fileExtension: String = "jpg") -> UIImage? {
guard let fileURLPath = Bundle.module
guard let fileURLPath = giniTestBundle()
.path(forResource: name, ofType: fileExtension) else { return nil }
return UIImage(contentsOfFile: fileURLPath)
}
Expand Down Expand Up @@ -58,7 +62,7 @@ final class GiniCaptureTestsHelper {
}

fileprivate class func urlFromFile(named name: String, fileExtension: String) -> URL? {
let fileURLPath: String? = Bundle.module
let fileURLPath: String? = giniTestBundle()
.path(forResource: name, ofType: fileExtension)
return URL(fileURLWithPath: fileURLPath!)
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/GiniCaptureSDKTests/HelpMenuViewControllerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ final class HelpMenuViewControllerTests: XCTestCase {
var items: [(text: String, id: Int)] {
var items = [
(NSLocalizedString("ginicapture.helpmenu.firstItem",
bundle: Bundle.module,
bundle: giniCaptureBundle(),
comment: "help menu first item text"),
1)
]

if GiniConfiguration.shared.shouldShowSupportedFormatsScreen {
items.append((NSLocalizedString("ginicapture.helpmenu.thirdItem",
bundle: Bundle.module,
bundle: giniCaptureBundle(),
comment: "help menu third item text"), 3))

}

if GiniConfiguration.shared.openWithEnabled {
items.append((NSLocalizedString("ginicapture.helpmenu.secondItem",
bundle: Bundle.module,
bundle: giniCaptureBundle(),
comment: "help menu second item text"), 2))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ final class OpenWithTutorialViewControllerTests: XCTestCase {
giniConfiguration.shouldShowDragAndDropTutorial = false

let openWithTutorialViewController = OpenWithTutorialViewController(giniConfiguration: giniConfiguration)
let dragAndDropStepImage = UIImage(named: "openWithTutorialStep3", in: Bundle.module, compatibleWith: nil)
let dragAndDropStepImage = UIImage(named: "openWithTutorialStep3", in: giniCaptureBundle(), compatibleWith: nil)

XCTAssertFalse(openWithTutorialViewController.items.map { $0.image }.contains(dragAndDropStepImage),
"open with items should not contain drag and drop image")
Expand Down

0 comments on commit 861230d

Please sign in to comment.