[+] Check family pin length

This commit is contained in:
Hykilpikonna
2021-01-24 19:05:31 -05:00
parent a42093a0f0
commit 438bcf922e
2 changed files with 21 additions and 2 deletions
+17 -1
View File
@@ -205,13 +205,20 @@ class FamilyVC: UIViewController
}
}
/**
Create or join a family
*/
class FamilyCreateJoinVC: UIViewController
{
let createMode: Bool
@IBOutlet weak var lFamilyNameOrId: UILabel!
@IBOutlet weak var bCreateJoin: UIButton!
@IBOutlet weak var tNameOrId: UITextField!
@IBOutlet weak var tPin: UITextField!
/**
Pass in create mode from FamilyVC
*/
init?(coder: NSCoder, create: Bool)
{
createMode = create
@@ -228,5 +235,14 @@ class FamilyCreateJoinVC: UIViewController
lFamilyNameOrId.text = createMode ? "Family Name" : "Family ID"
bCreateJoin.setTitle(createMode ? "Create" : "Join", for: .normal)
}
/**
Called when the user clicks create or join button
*/
@IBAction func btnCreateOrJoin(_ sender: Any)
{
// Check pin
guard let pin = tPin.text, pin.count >= 4 else { msg("Pin Too Weak", "Your family pin must be 4 numbers or more."); return }
}
}
+4 -1
View File
@@ -1016,7 +1016,7 @@
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="UGD-ka-LPo">
<rect key="frame" x="120" y="0.0" width="254" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
<textInputTraits key="textInputTraits" secureTextEntry="YES" textContentType="one-time-code"/>
</textField>
</subviews>
</stackView>
@@ -1024,6 +1024,7 @@
<rect key="frame" x="0.0" y="108" width="374" height="34"/>
<state key="normal" title="Create/Join"/>
<connections>
<action selector="btnCreateOrJoin:" destination="MJK-PM-TUJ" eventType="touchUpInside" id="wqB-ir-1be"/>
<action selector="register:" destination="ZAC-hn-zGl" eventType="touchUpInside" id="fbN-Jr-RKv"/>
</connections>
</button>
@@ -1042,6 +1043,8 @@
<connections>
<outlet property="bCreateJoin" destination="KSB-S7-kAX" id="aeU-Yk-wmh"/>
<outlet property="lFamilyNameOrId" destination="YfO-H5-olP" id="OXM-3N-ZVV"/>
<outlet property="tNameOrId" destination="aPT-13-Az4" id="6Cw-ur-FBF"/>
<outlet property="tPin" destination="UGD-ka-LPo" id="aNg-6j-ipe"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="kMK-Pp-v1l" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>