-
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.
- Loading branch information
Showing
52 changed files
with
596 additions
and
63 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// FaceCaptureHintAnimationItem.swift | ||
// Catalog | ||
// | ||
// Created by Pavel Kondrashkov on 5/31/21. | ||
// Copyright © 2021 Regula. All rights reserved. | ||
// | ||
|
||
import FaceSDK | ||
|
||
final class FaceCaptureHintAnimationItem: CatalogItem { | ||
override init() { | ||
super.init() | ||
|
||
title = "Disable FaceCapture HintView animation" | ||
itemDescription = "Disables blinking HintView animation for FaceCapture." | ||
category = .feature | ||
} | ||
|
||
override func onItemSelected(from viewController: UIViewController) { | ||
let configuration = FaceCaptureConfiguration { | ||
$0.isHintAnimationEnabled = false | ||
} | ||
|
||
FaceSDK.service.presentFaceCaptureViewController( | ||
from: viewController, | ||
animated: true, | ||
configuration: configuration, | ||
onCapture: { [weak self, weak viewController] response in | ||
guard let self = self, let viewController = viewController else { return } | ||
self.showFaceCaptureResult(response, from: viewController) | ||
}, | ||
completion: nil) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// LivenessHintAnimationItem.swift | ||
// Catalog | ||
// | ||
// Created by Pavel Kondrashkov on 5/31/21. | ||
// Copyright © 2021 Regula. All rights reserved. | ||
// | ||
|
||
import FaceSDK | ||
|
||
final class LivenessHintAnimationItem: CatalogItem { | ||
override init() { | ||
super.init() | ||
|
||
title = "Disable Liveness HintView animation" | ||
itemDescription = "Disables blinking HintView animation for Liveness." | ||
category = .feature | ||
} | ||
|
||
override func onItemSelected(from viewController: UIViewController) { | ||
let configuration = LivenessConfiguration { | ||
$0.isHintAnimationEnabled = false | ||
} | ||
|
||
FaceSDK.service.startLiveness( | ||
from: viewController, | ||
animated: true, | ||
configuration: configuration, | ||
onLiveness: { [weak self, weak viewController] response in | ||
guard let self = self, let viewController = viewController else { return } | ||
self.showLivenessResult(response, from: viewController) | ||
}, | ||
completion: nil | ||
) | ||
} | ||
} |
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
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
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
56 changes: 56 additions & 0 deletions
56
Catalog/Items/ViewCustomization/LivenessToolbarCustomColors.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,56 @@ | ||
// | ||
// LivenessToolbarCustomColors.swift | ||
// Catalog | ||
// | ||
// Created by Pavel Kondrashkov on 6/22/21. | ||
// Copyright © 2021 Regula. All rights reserved. | ||
// | ||
|
||
import FaceSDK | ||
|
||
final class LivenessToolbarCustomColors: CatalogItem { | ||
final class Toolbar: CameraToolbarView { | ||
override func updateState(_ state: CameraToolbarViewState) { | ||
switch state { | ||
case .front: | ||
self.backgroundColor = .windsor | ||
self.torchButton?.tintColor = .white | ||
self.switchCameraButton?.tintColor = .white | ||
self.closeButton?.tintColor = .white | ||
case .rear: | ||
self.backgroundColor = .white | ||
self.torchButton?.tintColor = .windsor | ||
self.switchCameraButton?.tintColor = .windsor | ||
self.closeButton?.tintColor = .windsor | ||
@unknown default: | ||
fatalError("Unexpected state") | ||
} | ||
} | ||
} | ||
|
||
override init() { | ||
super.init() | ||
|
||
title = "Liveness CameraToolbarView custom colors" | ||
itemDescription = "Overriden CameraToolbarView class reacts to Camera state changes." | ||
category = .viewCustomization | ||
} | ||
|
||
override func onItemSelected(from viewController: UIViewController) { | ||
let configuration = LivenessConfiguration { | ||
$0.cameraSwitchEnabled = true | ||
$0.registerClass(Toolbar.self, forBaseClass: CameraToolbarView.self) | ||
} | ||
|
||
FaceSDK.service.startLiveness( | ||
from: viewController, | ||
animated: true, | ||
configuration: configuration, | ||
onLiveness: { [weak self, weak viewController] response in | ||
guard let self = self, let viewController = viewController else { return } | ||
self.showLivenessResult(response, from: viewController) | ||
}, | ||
completion: nil | ||
) | ||
} | ||
} |
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.