Skip to content

Commit

Permalink
Merge pull request #39 from recruit-lifestyle/develop
Browse files Browse the repository at this point in the history
Add FaceID icon
  • Loading branch information
liu044100 authored Jan 24, 2018
2 parents f8a3038 + 203983b commit 58e0a6f
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 26 deletions.
2 changes: 2 additions & 0 deletions SmileLock-Example/SmileLock-Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>PasswordLogin</string>
<key>NSFaceIDUsageDescription</key>
<string>Unlock it</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down
2 changes: 1 addition & 1 deletion SmileLock.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SmileLock"
s.version = "3.0.0"
s.version = "3.0.1"
s.summary = "A library for make a beautiful Passcode Lock View."
s.description = <<-DESC
1. Create a beautiful passcode lock view simply.
Expand Down
23 changes: 23 additions & 0 deletions SmileLock/Assets/Assets.xcassets/faceid.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "faceid.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 29 additions & 24 deletions SmileLock/Assets/PasswordContainerView.xib

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion SmileLock/Classes/PasswordContainerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,16 @@ open class PasswordContainerView: UIView {
deleteButton.titleLabel?.adjustsFontSizeToFitWidth = true
deleteButton.titleLabel?.minimumScaleFactor = 0.5
touchAuthenticationEnabled = true
let image = touchAuthenticationButton.imageView?.image?.withRenderingMode(.alwaysTemplate)

var image = touchAuthenticationButton.imageView?.image?.withRenderingMode(.alwaysTemplate)

if #available(iOS 11, *) {
if touchIDContext.biometryType == .typeFaceID {
let bundle = Bundle(for: type(of: self))
image = UIImage(named: "faceid", in: bundle, compatibleWith: nil)?.withRenderingMode(.alwaysTemplate)
}
}

touchAuthenticationButton.setImage(image, for: UIControlState())
touchAuthenticationButton.tintColor = tintColor
}
Expand Down

0 comments on commit 58e0a6f

Please sign in to comment.