Skip to content

Instantly share code, notes, and snippets.

@amosgyamfi
Created June 20, 2020 01:24
Show Gist options
  • Save amosgyamfi/face38fc7ec30003f1ede91225d06f2e to your computer and use it in GitHub Desktop.
Save amosgyamfi/face38fc7ec30003f1ede91225d06f2e to your computer and use it in GitHub Desktop.
//
// ContentView.swift
// touch_id
//
// Created by Amos Gyamfi on 19.6.2020.
// Copyright © 2020 Amos Gyamfi. All rights reserved.
//
import SwiftUI
struct ContentView: View {
@State private var isOk = false
var body: some View {
VStack {
ZStack {
Image("finger1")
Image("finger2")
.clipShape(
Rectangle()
.offset(y: isOk ? 0 : 90))
.hueRotation(.degrees(isOk ? 360 : 0))
// Multiply, Luminosity, PlusDarker
//.blendMode(isOk ? .multiply: .plusDarker)
//.blendMode(isOk ? .luminosity: .plusDarker)
//.blendMode(isOk ? .plusDarker: .multiply)
.blendMode(isOk ? .plusDarker: .luminosity)
.animation(Animation.linear(duration: 1).delay(1))
.onAppear(){
self.isOk.toggle()
}
}
Text("Confirm with Touch ID")
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
@amosgyamfi
Copy link
Author

touch_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment