Commit 3e972c5f authored by yqz's avatar yqz

1111111

parent d68129c2
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Google@2x 1@2x(1).png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Google@2x 1@3x(1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Google@2x 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Google@2x 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -68,7 +68,7 @@ class SpeakTitleView: UIView {
make.top.equalToSuperview().offset(Dev.safeAreaInsets.top)
}
backBtn.snp.makeConstraints { make in
make.left.equalToSuperview().inset(marginLR)
make.left.equalToSuperview().inset(marginLR-4)
make.centerY.equalTo(titleLabel)
}
}
......
......@@ -23,6 +23,7 @@ enum SpeakEasyAssociatedKeys : UInt32 {
case labelTextTap = 0x10001
case navigationAniKey = 0x01122
case labelTextCutomFont = 0x01102
case windowkeyboardKey = 0x120323
}
protocol CutomFontProtocol : NSObjectProtocol {
......
......@@ -10,8 +10,11 @@ import UIKit
extension String {
func isValidEmail() -> Bool {
let emailRegex = "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}"
let emailPredicate = NSPredicate(format: "SELF MATCHES %@", emailRegex)
return emailPredicate.evaluate(with: self)
}
func localJson(_ fileName:String) -> String? {
let path = Bundle.main.path(forResource: fileName, ofType: "json")
......
......@@ -7,9 +7,9 @@
import UIKit
extension UIButton : CutomFontProtocol {
extension UIButton {
func setCutomFonts() {
override func setCutomFonts() {
if cutomFont >= 0 {
switch cutomFont {
case 0:
......
......@@ -26,7 +26,7 @@ extension UILabel : CutomFontProtocol {
}
func setCutomFonts() {
override func setCutomFonts() {
if cutomFont >= 0 {
switch cutomFont {
case 0:
......
......@@ -13,7 +13,11 @@ fileprivate var cutomFontsKey = SpeakEasyAssociatedKeys.labelTextCutomFont.rawVa
@IBDesignable
extension UIView {
extension UIView : CutomFontProtocol {
@objc func setCutomFonts() {
}
@objc public var callblack:((Any)->Void)? {
set {
......@@ -123,6 +127,9 @@ extension UIView {
@IBInspectable var cutomFont:Int {
set {
objc_setAssociatedObject(self, &cutomFontsKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.02) {
self.setCutomFonts()
}
}
get {
return objc_getAssociatedObject(self, &cutomFontsKey) as? Int ?? -1
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<device id="retina4_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
......@@ -16,20 +16,20 @@
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="sp-bg" translatesAutoresizingMaskIntoConstraints="NO" id="5SM-Lp-0MM">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
</imageView>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aYT-y7-hf8">
<rect key="frame" x="0.0" y="172" width="393" height="680"/>
<rect key="frame" x="0.0" y="74" width="320" height="494"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="8r0-nd-l8p">
<rect key="frame" x="0.0" y="0.0" width="393" height="500"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="500"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Get Unlimited Access" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GRD-E5-C2J">
<rect key="frame" x="24" y="0.0" width="345" height="21"/>
<rect key="frame" x="24" y="0.0" width="272" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
......@@ -43,7 +43,7 @@
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Learning, progress, improvement" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ynQ-dm-w6L">
<rect key="frame" x="24" y="29" width="345" height="21"/>
<rect key="frame" x="24" y="29" width="272" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.54490858843537415" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
......@@ -78,13 +78,31 @@
</constraints>
</scrollView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Khu-4S-MSZ">
<rect key="frame" x="24" y="122" width="40" height="40"/>
<rect key="frame" x="24" y="24" width="40" height="40"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="sp-Close"/>
<connections>
<action selector="SpeakCloseTaps:" destination="-1" eventType="touchUpInside" id="Ehx-8a-Yrb"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="B7F-jV-sWR">
<rect key="frame" x="214" y="27" width="82" height="34"/>
<color key="backgroundColor" red="0.10980392156862745" green="0.14901960784313725" blue="0.20392156862745098" alpha="0.29525403911564635" colorSpace="custom" customColorSpace="calibratedRGB"/>
<inset key="contentEdgeInsets" minX="10" minY="6" maxX="10" maxY="6"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Restore"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="14"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="corners">
<real key="value" value="17"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</button>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
......@@ -92,7 +110,9 @@
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="aYT-y7-hf8" secondAttribute="trailing" id="1vp-dD-GTQ"/>
<constraint firstItem="5SM-Lp-0MM" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="5Fy-iV-kqk"/>
<constraint firstItem="5SM-Lp-0MM" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="AjH-kD-Mkl"/>
<constraint firstItem="B7F-jV-sWR" firstAttribute="centerY" secondItem="Khu-4S-MSZ" secondAttribute="centerY" id="Bw5-S7-H2b"/>
<constraint firstItem="5SM-Lp-0MM" firstAttribute="trailing" secondItem="fnl-2z-Ty3" secondAttribute="trailing" id="OXa-HW-56J"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="B7F-jV-sWR" secondAttribute="trailing" constant="24" id="OkQ-Ok-JoH"/>
<constraint firstItem="aYT-y7-hf8" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="P4U-QH-Kwb"/>
<constraint firstAttribute="bottom" secondItem="5SM-Lp-0MM" secondAttribute="bottom" id="jDz-gg-Zym"/>
<constraint firstItem="Khu-4S-MSZ" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="4" id="pkS-QV-Hi6"/>
......
......@@ -12,8 +12,6 @@ import YYText
class SpeakEleLoginGuideCtr: SpeakEleBaseViewCtr {
@IBOutlet weak var SpeakDescLabel: UILabel!
@IBOutlet weak var speakLetsGo: SpeakEleButton!
@IBOutlet weak var speakLoginBtn: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
......@@ -21,9 +19,6 @@ class SpeakEleLoginGuideCtr: SpeakEleBaseViewCtr {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
SpeakDescLabel.setCutomFonts()
speakLetsGo.setCutomFonts()
speakLoginBtn.setCutomFonts()
setDescription()
}
......
......@@ -12,8 +12,6 @@
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SpeakEleLoginGuideCtr" customModule="SpeakEasyLearnEnglish" customModuleProvider="target">
<connections>
<outlet property="SpeakDescLabel" destination="jGO-Du-a3k" id="mxV-nA-Nwk"/>
<outlet property="speakLetsGo" destination="Zwf-M5-Hrt" id="GqW-aT-1s1"/>
<outlet property="speakLoginBtn" destination="GOS-gl-Ilh" id="951-M8-75o"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
......
......@@ -6,13 +6,122 @@
//
import UIKit
import AuthenticationServices
class SpeakEleLoginViewCtr: SpeakEleBaseViewCtr {
class SpeakEleLoginViewCtr: SpeakEleBaseViewCtr {
// MARK: - ib
@IBOutlet weak var SpeakEmailContentV: UIView!
@IBOutlet weak var SpeakEamil: UITextField!
@IBOutlet weak var SpeakPsContentV: UIView!
@IBOutlet weak var SpeakPs: UITextField!
@IBOutlet weak var SpeakSecure: UIButton!
@IBOutlet weak var SpeakDesc: UILabel!
@IBOutlet var SpeakOtherLogin: [UIButton]!
@IBOutlet weak var SpeakEmailIncorrect: UIView!
@IBOutlet weak var SpeakPsIncorrect: UIView!
private var secureTextEntry:Bool = true {
didSet{
SpeakPs.isSecureTextEntry = secureTextEntry
SpeakSecure.isSelected = !secureTextEntry
}
}
override func viewDidLoad() {
super.viewDidLoad()
SpeakEmailIncorrect.isHidden = true
SpeakPsIncorrect.isHidden = true
secureTextEntry = true
}
override func setup() {
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
SpeakOtherLogin.forEach { button in
button.shadow(cornerRadius: 20, shadowColor: .init(hex: 0x000000,alpha: 0.06), offset: CGSizeMake(0, 4), opacity: 1, radius: 20)
}
}
@IBAction func SpeakForgot(_ sender: Any) {
}
@IBAction func SpeakCreate(_ sender: Any) {
let email = SpeakEamil.text ?? ""
if !email.isValidEmail() {
SpeakEmailIncorrect.isHidden = false
SpeakEmailContentV.borderColor = .init(hex: 0xEB3B2F)
return
}
SpeakEmailIncorrect.isHidden = true
SpeakEmailContentV.borderColor = .clear
let ps = SpeakPs.text ?? ""
if ps.count <= 0 {
SpeakPsIncorrect.isHidden = false
SpeakPsContentV.borderColor = .init(hex: 0xEB3B2F)
return
}
SpeakPsIncorrect.isHidden = true
SpeakPsContentV.borderColor = .clear
}
@IBAction func SpeakSecureButton(_ sender: UIButton) {
sender.isSelected = !sender.isSelected
secureTextEntry = !sender.isSelected
}
@IBAction func SpeakThreeLoginTaps(_ sender: UIButton) {
if sender == SpeakOtherLogin.last {
let provider = ASAuthorizationAppleIDProvider()
let request = provider.createRequest()
request.requestedScopes = [.fullName, .email]
let controller = ASAuthorizationController(authorizationRequests: [request])
controller.delegate = self
controller.presentationContextProvider = self
controller.performRequests()
}else{
}
}
func toGuide() -> Void {
let guide = SpeakEleGuideViewCtr()
self.navigationController?.pushViewController(guide, animated: true)
}
}
extension SpeakEleLoginViewCtr : ASAuthorizationControllerDelegate , ASAuthorizationControllerPresentationContextProviding {
func authorizationController(controller: ASAuthorizationController,
didCompleteWithAuthorization authorization: ASAuthorization) {
if let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential {
let userIdentifier = appleIDCredential.user
_ = appleIDCredential.fullName
_ = appleIDCredential.email
}
}
func authorizationController(controller: ASAuthorizationController,
didCompleteWithError error: Error) {
print("Apple Login Error: \(error.localizedDescription)")
}
func presentationAnchor(for controller: ASAuthorizationController) -> ASPresentationAnchor {
return self.view.window!
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23727" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<device id="retina4_0" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23721"/>
......@@ -11,139 +11,346 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="SpeakEleLoginViewCtr" customModule="SpeakEasyLearnEnglish" customModuleProvider="target">
<connections>
<outlet property="SpeakDesc" destination="ZTC-hh-3ze" id="2x2-vS-bkh"/>
<outlet property="SpeakEamil" destination="M4R-vQ-irk" id="nOo-ff-AzF"/>
<outlet property="SpeakEmailContentV" destination="xbG-3d-KMi" id="tSj-KQ-Jwj"/>
<outlet property="SpeakEmailIncorrect" destination="nCj-St-30D" id="jtt-w6-pPU"/>
<outlet property="SpeakPs" destination="RcT-ZC-XJJ" id="fqS-J9-MRC"/>
<outlet property="SpeakPsContentV" destination="khn-vx-1Kx" id="XuZ-Nt-TYU"/>
<outlet property="SpeakPsIncorrect" destination="6eN-QC-6l6" id="F4c-ve-xAp"/>
<outlet property="SpeakSecure" destination="8b2-4s-WXV" id="Rbi-dU-zIZ"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
<outletCollection property="SpeakOtherLogin" destination="qex-xZ-2WF" collectionClass="NSMutableArray" id="NdC-TF-hft"/>
<outletCollection property="SpeakOtherLogin" destination="nl7-sa-9Pr" collectionClass="NSMutableArray" id="UC7-P0-LJ7"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="eoM-SK-uFc">
<rect key="frame" x="24" y="168" width="345" height="95"/>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="FTN-XH-67e">
<rect key="frame" x="0.0" y="70" width="320" height="498"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Welcome back" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ngd-gr-rPf">
<rect key="frame" x="0.0" y="0.0" width="345" height="38.333333333333336"/>
<fontDescription key="fontDescription" type="system" pointSize="32"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.89859693877551017" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="32"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Log in to continue learning with your private AI Tutor" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wve-dN-jIa">
<rect key="frame" x="0.0" y="54.333333333333343" width="345" height="40.666666666666657"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.53768069727891155" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="20"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="3vF-f8-EXC">
<rect key="frame" x="24" y="287" width="345" height="186"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xbG-3d-KMi">
<rect key="frame" x="0.0" y="0.0" width="345" height="60"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="E-mail address" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="M4R-vQ-irk">
<rect key="frame" x="16" y="19" width="313" height="22"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.041746386054421769" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="4d3-yx-5wP"/>
<constraint firstAttribute="trailing" secondItem="M4R-vQ-irk" secondAttribute="trailing" constant="16" id="EmW-oh-uos"/>
<constraint firstItem="M4R-vQ-irk" firstAttribute="leading" secondItem="xbG-3d-KMi" secondAttribute="leading" constant="16" id="JJb-x0-8Lg"/>
<constraint firstAttribute="bottom" secondItem="M4R-vQ-irk" secondAttribute="bottom" constant="19" id="bwe-Tm-79f"/>
<constraint firstItem="M4R-vQ-irk" firstAttribute="top" secondItem="xbG-3d-KMi" secondAttribute="top" constant="19" id="dRM-xb-RT8"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="corners">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="khn-vx-1Kx">
<rect key="frame" x="0.0" y="76" width="345" height="60"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="OiV-6D-z5N">
<rect key="frame" x="0.0" y="0.0" width="320" height="831"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="RcT-ZC-XJJ">
<rect key="frame" x="16" y="19" width="263" height="22"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8b2-4s-WXV">
<rect key="frame" x="295" y="13" width="34" height="34"/>
<inset key="contentEdgeInsets" minX="5" minY="5" maxX="5" maxY="5"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="sp-login-ps-hide"/>
<state key="selected" image="sp-login-ps-show"/>
</button>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="eoM-SK-uFc">
<rect key="frame" x="24" y="0.0" width="272" height="95.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Welcome back" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ngd-gr-rPf">
<rect key="frame" x="0.0" y="0.0" width="272" height="38.5"/>
<fontDescription key="fontDescription" type="system" pointSize="32"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.89859693877551017" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="32"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Log in to continue learning with your private AI Tutor" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Wve-dN-jIa">
<rect key="frame" x="0.0" y="54.5" width="272" height="41"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.53768069727891155" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="20"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="3vF-f8-EXC">
<rect key="frame" x="24" y="119.5" width="272" height="318"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xbG-3d-KMi">
<rect key="frame" x="0.0" y="0.0" width="272" height="60"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="E-mail address" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="M4R-vQ-irk">
<rect key="frame" x="16" y="19" width="240" height="22"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits"/>
</textField>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.041746386054421769" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="4d3-yx-5wP"/>
<constraint firstAttribute="trailing" secondItem="M4R-vQ-irk" secondAttribute="trailing" constant="16" id="EmW-oh-uos"/>
<constraint firstItem="M4R-vQ-irk" firstAttribute="leading" secondItem="xbG-3d-KMi" secondAttribute="leading" constant="16" id="JJb-x0-8Lg"/>
<constraint firstAttribute="bottom" secondItem="M4R-vQ-irk" secondAttribute="bottom" constant="19" id="bwe-Tm-79f"/>
<constraint firstItem="M4R-vQ-irk" firstAttribute="top" secondItem="xbG-3d-KMi" secondAttribute="top" constant="19" id="dRM-xb-RT8"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="corners">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="nCj-St-30D">
<rect key="frame" x="0.0" y="76" width="272" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="The email address format is incorrect." textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="v7u-Gu-KMd">
<rect key="frame" x="16" y="0.0" width="240" height="50"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="11" id="PrH-BT-xDu"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.85882353782653809" green="0.21960783004760742" blue="0.17254900932312012" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="14"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="v7u-Gu-KMd" firstAttribute="top" secondItem="nCj-St-30D" secondAttribute="top" id="9wq-JY-daY"/>
<constraint firstItem="v7u-Gu-KMd" firstAttribute="leading" secondItem="nCj-St-30D" secondAttribute="leading" constant="16" id="Tsb-kO-Qs8"/>
<constraint firstAttribute="bottom" secondItem="v7u-Gu-KMd" secondAttribute="bottom" id="W9d-2W-EVN"/>
<constraint firstAttribute="trailing" secondItem="v7u-Gu-KMd" secondAttribute="trailing" constant="16" id="uLG-oh-I3Y"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="khn-vx-1Kx">
<rect key="frame" x="0.0" y="142" width="272" height="60"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" placeholder="Password" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="RcT-ZC-XJJ">
<rect key="frame" x="16" y="19" width="190" height="22"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8b2-4s-WXV">
<rect key="frame" x="222" y="13" width="34" height="34"/>
<inset key="contentEdgeInsets" minX="5" minY="5" maxX="5" maxY="5"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="sp-login-ps-hide"/>
<state key="selected" image="sp-login-ps-show"/>
<connections>
<action selector="SpeakSecureButton:" destination="-1" eventType="touchUpInside" id="xl0-nz-xcP"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.041746386050000001" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="RcT-ZC-XJJ" secondAttribute="bottom" constant="19" id="3hl-jG-xAR"/>
<constraint firstItem="8b2-4s-WXV" firstAttribute="centerY" secondItem="khn-vx-1Kx" secondAttribute="centerY" id="5r3-0K-9WL"/>
<constraint firstItem="RcT-ZC-XJJ" firstAttribute="top" secondItem="khn-vx-1Kx" secondAttribute="top" constant="19" id="ChJ-mq-2dI"/>
<constraint firstItem="RcT-ZC-XJJ" firstAttribute="leading" secondItem="khn-vx-1Kx" secondAttribute="leading" constant="16" id="MNT-l9-oeP"/>
<constraint firstAttribute="trailing" secondItem="8b2-4s-WXV" secondAttribute="trailing" constant="16" id="ebv-KX-Wal"/>
<constraint firstItem="8b2-4s-WXV" firstAttribute="leading" secondItem="RcT-ZC-XJJ" secondAttribute="trailing" constant="16" id="q3H-1g-kxT"/>
<constraint firstAttribute="height" constant="60" id="zoi-Dq-eSE"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="corners">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6eN-QC-6l6">
<rect key="frame" x="0.0" y="218" width="272" height="50"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Incorrect password." textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5cS-pW-qFM">
<rect key="frame" x="16" y="0.0" width="240" height="50"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="11" id="ib6-uS-PnP"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.85882353779999998" green="0.21960783" blue="0.1725490093" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="14"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="5cS-pW-qFM" firstAttribute="leading" secondItem="6eN-QC-6l6" secondAttribute="leading" constant="16" id="Psa-qC-2Zi"/>
<constraint firstAttribute="bottom" secondItem="5cS-pW-qFM" secondAttribute="bottom" id="Q0f-nU-a6S"/>
<constraint firstItem="5cS-pW-qFM" firstAttribute="top" secondItem="6eN-QC-6l6" secondAttribute="top" id="SxP-30-sgp"/>
<constraint firstAttribute="trailing" secondItem="5cS-pW-qFM" secondAttribute="trailing" constant="16" id="ePf-IQ-AFE"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LHb-rx-f3q">
<rect key="frame" x="0.0" y="284" width="272" height="34"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Forgot password?">
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="0.5385044642857143" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="SpeakForgot:" destination="-1" eventType="touchUpInside" id="jkI-7I-7BJ"/>
</connections>
</button>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="equalSpacing" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="Duy-h2-44B">
<rect key="frame" x="24" y="592.5" width="272" height="218.5"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4ap-ed-7D7" customClass="SpeakEleButton" customModule="SpeakEasyLearnEnglish" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="272" height="60"/>
<color key="backgroundColor" red="0.0" green="0.45882352939999999" blue="0.89019607840000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="60" id="fHH-uH-2Tk"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Create Account">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="2"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="SpeakCreate:" destination="-1" eventType="touchUpInside" id="1mQ-Cc-cRZ"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Proceeding further indicates your agreement to our Privacy Policy and Terms of Service." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZTC-hh-3ze">
<rect key="frame" x="0.0" y="76" width="272" height="24"/>
<fontDescription key="fontDescription" type="system" pointSize="10"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="———————— or ————————" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SQY-CO-4VW">
<rect key="frame" x="0.0" y="116" width="272" height="20.5"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.40157312925170069" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</label>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillEqually" spacing="16" translatesAutoresizingMaskIntoConstraints="NO" id="XDS-Yg-a7Z">
<rect key="frame" x="0.0" y="152.5" width="272" height="66"/>
<subviews>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="qex-xZ-2WF">
<rect key="frame" x="0.0" y="0.0" width="128" height="66"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="contentEdgeInsets" minX="0.0" minY="24" maxX="0.0" maxY="18"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="sp-login-google"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="corners">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="SpeakThreeLoginTaps:" destination="-1" eventType="touchUpInside" id="q5H-Hb-9iL"/>
</connections>
</button>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="nl7-sa-9Pr">
<rect key="frame" x="144" y="0.0" width="128" height="66"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<inset key="contentEdgeInsets" minX="0.0" minY="24" maxX="0.0" maxY="18"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="sp-login-apple"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="corners">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="SpeakThreeLoginTaps:" destination="-1" eventType="touchUpInside" id="w0f-Nc-j06"/>
</connections>
</button>
</subviews>
</stackView>
</subviews>
</stackView>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.041746386050000001" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="RcT-ZC-XJJ" secondAttribute="bottom" constant="19" id="3hl-jG-xAR"/>
<constraint firstItem="8b2-4s-WXV" firstAttribute="centerY" secondItem="khn-vx-1Kx" secondAttribute="centerY" id="5r3-0K-9WL"/>
<constraint firstItem="RcT-ZC-XJJ" firstAttribute="top" secondItem="khn-vx-1Kx" secondAttribute="top" constant="19" id="ChJ-mq-2dI"/>
<constraint firstItem="RcT-ZC-XJJ" firstAttribute="leading" secondItem="khn-vx-1Kx" secondAttribute="leading" constant="16" id="MNT-l9-oeP"/>
<constraint firstAttribute="trailing" secondItem="8b2-4s-WXV" secondAttribute="trailing" constant="16" id="ebv-KX-Wal"/>
<constraint firstItem="8b2-4s-WXV" firstAttribute="leading" secondItem="RcT-ZC-XJJ" secondAttribute="trailing" constant="16" id="q3H-1g-kxT"/>
<constraint firstAttribute="height" constant="60" id="zoi-Dq-eSE"/>
<constraint firstAttribute="bottom" secondItem="Duy-h2-44B" secondAttribute="bottom" constant="20" id="EAf-BH-dVJ"/>
<constraint firstAttribute="trailing" secondItem="Duy-h2-44B" secondAttribute="trailing" constant="24" id="K2G-Ya-2t7"/>
<constraint firstAttribute="trailing" secondItem="3vF-f8-EXC" secondAttribute="trailing" constant="24" id="Xm2-DG-FjE"/>
<constraint firstItem="Duy-h2-44B" firstAttribute="leading" secondItem="OiV-6D-z5N" secondAttribute="leading" constant="24" id="cFd-1k-fGw"/>
<constraint firstItem="eoM-SK-uFc" firstAttribute="top" secondItem="OiV-6D-z5N" secondAttribute="top" id="oQ4-6S-hE1"/>
<constraint firstItem="3vF-f8-EXC" firstAttribute="leading" secondItem="OiV-6D-z5N" secondAttribute="leading" constant="24" id="pCF-Vv-Fdn"/>
<constraint firstItem="3vF-f8-EXC" firstAttribute="top" secondItem="eoM-SK-uFc" secondAttribute="bottom" constant="24" id="sGn-62-mae"/>
<constraint firstItem="eoM-SK-uFc" firstAttribute="leading" secondItem="OiV-6D-z5N" secondAttribute="leading" constant="24" id="u3X-TZ-6Kl"/>
<constraint firstAttribute="trailing" secondItem="eoM-SK-uFc" secondAttribute="trailing" constant="24" id="vba-To-soc"/>
<constraint firstItem="Duy-h2-44B" firstAttribute="top" secondItem="3vF-f8-EXC" secondAttribute="bottom" constant="155" id="w5N-2J-tVa"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="corners">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LHb-rx-f3q">
<rect key="frame" x="0.0" y="152" width="345" height="34"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Forgot password?">
<color key="titleColor" red="0.0" green="0.0" blue="0.0" alpha="0.5385044642857143" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cutomFont">
<integer key="value" value="0"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="fontSize">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</button>
</subviews>
</stackView>
<constraints>
<constraint firstItem="OiV-6D-z5N" firstAttribute="top" secondItem="FTN-XH-67e" secondAttribute="top" id="Dmb-eZ-xVI"/>
<constraint firstAttribute="bottom" secondItem="OiV-6D-z5N" secondAttribute="bottom" id="LED-cz-hu0"/>
<constraint firstAttribute="trailing" secondItem="OiV-6D-z5N" secondAttribute="trailing" id="YeK-cW-TWg"/>
<constraint firstItem="OiV-6D-z5N" firstAttribute="leading" secondItem="FTN-XH-67e" secondAttribute="leading" id="nqP-kK-Wx4"/>
<constraint firstItem="OiV-6D-z5N" firstAttribute="centerX" secondItem="FTN-XH-67e" secondAttribute="centerX" id="pE8-zh-IfB"/>
</constraints>
</scrollView>
</subviews>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="eoM-SK-uFc" secondAttribute="trailing" constant="24" id="3jB-Uf-0Ha"/>
<constraint firstItem="eoM-SK-uFc" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="50" id="HVz-5P-XPj"/>
<constraint firstItem="3vF-f8-EXC" firstAttribute="top" secondItem="eoM-SK-uFc" secondAttribute="bottom" constant="24" id="JqS-Vo-WOy"/>
<constraint firstItem="3vF-f8-EXC" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="24" id="bex-a9-cBw"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="3vF-f8-EXC" secondAttribute="trailing" constant="24" id="jtB-es-zHL"/>
<constraint firstItem="eoM-SK-uFc" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="24" id="vMQ-Qy-HVM"/>
<constraint firstItem="FTN-XH-67e" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="HyZ-8F-y0K"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="FTN-XH-67e" secondAttribute="bottom" id="L71-nj-HTy"/>
<constraint firstAttribute="trailing" secondItem="FTN-XH-67e" secondAttribute="trailing" id="Ovy-9r-qe9"/>
<constraint firstItem="FTN-XH-67e" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="50" id="QZ3-zP-nDL"/>
</constraints>
<point key="canvasLocation" x="131" y="-12"/>
</view>
</objects>
<resources>
<image name="sp-login-apple" width="24.5" height="24"/>
<image name="sp-login-google" width="24.5" height="24"/>
<image name="sp-login-ps-hide" width="24" height="24"/>
<image name="sp-login-ps-show" width="24" height="24"/>
<systemColor name="systemBackgroundColor">
......
......@@ -7,6 +7,9 @@
import UIKit
fileprivate var keyboardKey = SpeakEasyAssociatedKeys.windowkeyboardKey.rawValue
class SpeakKeyboardManager: NSObject {
static let share = SpeakKeyboardManager()
......@@ -31,25 +34,29 @@ class SpeakKeyboardManager: NSObject {
// MARK: - 键盘处理
@objc private func keyboardWillShow(_ notification: Notification) {
guard let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect ,
let view = notification.object as? UIView else { return }
// let keyboardTop = window.convert(keyboardFrame, from: nil).minY
//
// let textViewBottom = window.convert(bounds, from: superview).maxY
// let overlap = textViewBottom - keyboardTop + 10 // 额外间距
guard let keyboardFrame = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? CGRect else { return }
let currentFirstResponder = findFirstResponder(in: window)
let keyboardTop = window.convert(keyboardFrame, from: nil).minY
let overlap = keyboardFrame.height - window.safeAreaInsets.bottom
if overlap > 0 {
var frame = window.frame
frame.origin.y -= overlap
window.frame = frame
var textviewbottom:CGFloat = 0
if let input = currentFirstResponder as? UITextField {
textviewbottom = window.convert(input.bounds, from: input.superview).maxY
}else if let input = currentFirstResponder as? UITextView {
textviewbottom = window.convert(input.bounds, from: input.superview).maxY
}
window.iskeyboradShow = true
if textviewbottom > keyboardTop {
let overlap = (textviewbottom - keyboardTop) + window.safeAreaInsets.bottom
if overlap > 0 {
var frame = window.frame
frame.origin.y -= overlap
window.frame = frame
}
}
}
@objc private func keyboardWillHide(_ notification: Notification) {
window.iskeyboradShow = false
window.frame = UIScreen.main.bounds
}
......@@ -57,18 +64,42 @@ class SpeakKeyboardManager: NSObject {
private override init() {
}
private func findFirstResponder(in view: UIView?) -> UIResponder? {
guard let view = view else { return nil }
if view.isFirstResponder {
return view
}
for subview in view.subviews {
if let firstResponder = findFirstResponder(in: subview) {
return firstResponder
}
}
return nil
}
}
extension UIWindow {
var iskeyboradShow:Bool {
set {
objc_setAssociatedObject(self, &keyboardKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
}
get {
return objc_getAssociatedObject(self, &keyboardKey) as? Bool ?? false
}
}
open override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let frame = self.frame
if frame.origin.y < 0 {
let view = super.hitTest(point, with: event)
if (frame.origin.y < 0 || iskeyboradShow) && !(view is UITextField || view is UITextView) {
self.endEditing(false)
return nil
}else{
return super.hitTest(point, with: event)
return view
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment