Skip to content

Commit

Permalink
Add secure text entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessamae23 committed Apr 8, 2024
1 parent c34d7e7 commit 39b1230
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="Nosifer-Regular" family="Nosifer" pointSize="35"/>
<textInputTraits key="textInputTraits" textContentType="password"/>
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
</textField>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Email" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="C4s-MH-S0S">
<rect key="frame" x="587" y="105" width="221" height="93"/>
Expand Down Expand Up @@ -212,7 +212,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<fontDescription key="fontDescription" name="Nosifer-Regular" family="Nosifer" pointSize="35"/>
<textInputTraits key="textInputTraits" textContentType="password"/>
<textInputTraits key="textInputTraits" secureTextEntry="YES"/>
</textField>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Email" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wvr-VD-Zws">
<rect key="frame" x="580" y="65" width="221" height="93"/>
Expand Down Expand Up @@ -422,11 +422,11 @@ Match</string>
<action selector="onLoginViewPressed:" destination="bL0-ag-pcs" eventType="touchUpInside" id="Pdb-u1-H97"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" textAlignment="right" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fEW-7h-bJJ">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fEW-7h-bJJ">
<rect key="frame" x="-25" y="-49" width="289" height="225"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="Nosifer-Regular" family="Nosifer" pointSize="23"/>
<color key="textColor" red="1" green="0.98120184269999999" blue="0.34351523420000002" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
Expand All @@ -444,23 +444,23 @@ Match</string>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled">
<backgroundConfiguration key="background" image="square-button"/>
<attributedString key="attributedTitle">
<fragment content="Global Ranking">
<attributes>
<font key="NSFont" metaFont="system" size="29"/>
<font key="NSOriginalFont" size="12" name="Helvetica"/>
</attributes>
</fragment>
</attributedString>
</buttonConfiguration>
<connections>
<action selector="onRankingPressed:" destination="bL0-ag-pcs" eventType="touchUpInside" id="FbC-ZM-BDt"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Global Ranking" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="q5D-Lw-GA3">
<rect key="frame" x="-30" y="42" width="298" height="44"/>
<fontDescription key="fontDescription" name="Nosifer-Regular" family="Nosifer" pointSize="25"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="KBY-6j-DYG" firstAttribute="centerY" secondItem="n2f-u1-JOa" secondAttribute="centerY" id="47f-PZ-4He"/>
<constraint firstItem="KBY-6j-DYG" firstAttribute="centerY" secondItem="q5D-Lw-GA3" secondAttribute="centerY" id="7ZK-pZ-GPS"/>
<constraint firstItem="KBY-6j-DYG" firstAttribute="centerX" secondItem="q5D-Lw-GA3" secondAttribute="centerX" id="LxT-3G-pP4"/>
<constraint firstItem="KBY-6j-DYG" firstAttribute="centerX" secondItem="n2f-u1-JOa" secondAttribute="centerX" id="dD2-F2-djx"/>
<constraint firstItem="KBY-6j-DYG" firstAttribute="leading" secondItem="n2f-u1-JOa" secondAttribute="leading" constant="-38" id="hVq-Yw-Ebg"/>
</constraints>
Expand Down Expand Up @@ -692,7 +692,7 @@ Match</string>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="1ej-FD-YqB"/>
<segue reference="22u-0c-ugI"/>
<segue reference="WuO-mG-bY5"/>
</inferredMetricsTieBreakers>
<resources>
<image name="Flag" width="500" height="500"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import FirebaseDatabaseInternal
class GameRankProvider {
private let ranksRef = FirebaseDatabaseReference(.Ranks)
func setNewRank(rank: GameRankData) {
let userRankData = ["username": rank.username, "score": rank.score] as [String : Any]
let userRankData = ["username": rank.username, "score": rank.score] as [String: Any]
ranksRef.child(rank.userId).setValue(userRankData)
}
func getTopRanks(completion: @escaping ([GameRankData]?, Error?) -> Void) {
Expand All @@ -27,7 +27,7 @@ class GameRankProvider {
topRanks.append(rankData)
}
}

topRanks.sort { $0.score > $1.score }
completion(topRanks, nil)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class RegisterViewController: UIViewController {
private var authenticationProvider: AuthenticationProvider?
override func viewDidLoad() {
super.viewDidLoad()

authenticationProvider = AuthenticationProvider()
}

Expand Down

0 comments on commit 39b1230

Please sign in to comment.