Skip to content

Commit

Permalink
Merge pull request #97 from Vanessamae23/fix-ui
Browse files Browse the repository at this point in the history
Fix UI
  • Loading branch information
Vanessamae23 authored Apr 9, 2024
2 parents eaf7e03 + 39b1230 commit 897826a
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 40 deletions.
Binary file not shown.
135 changes: 98 additions & 37 deletions TowerForge/TowerForge/AppMain/Storyboards/Base.lproj/Main.storyboard
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"/>
<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"/>
<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 @@ -380,53 +380,114 @@ Match</string>
<constraint firstItem="PlF-Gy-tpz" firstAttribute="height" secondItem="erv-RB-ZcW" secondAttribute="height" multiplier="0.6" id="zzk-TX-B1T"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9Ao-cU-Ulr">
<rect key="frame" x="168" y="220" width="315" height="122"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="Button"/>
<connections>
<action selector="multiButtonPressed:" destination="bL0-ag-pcs" eventType="touchUpInside" id="u6W-dc-lim"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ral-67-ag6">
<rect key="frame" x="168" y="377" width="315" height="122"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled"/>
<connections>
<action selector="onLoginViewPressed:" destination="bL0-ag-pcs" eventType="touchUpInside" id="Pdb-u1-H97"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KBY-6j-DYG">
<rect key="frame" x="168" y="533" width="315" height="122"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="Ranking"/>
<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" fixedFrame="YES" text="" textAlignment="right" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fEW-7h-bJJ">
<rect key="frame" x="181" y="300" 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"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ewd-d2-Lxq">
<rect key="frame" x="205" y="124" width="257.5" height="198"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9Ao-cU-Ulr">
<rect key="frame" x="-38" y="3" width="315" height="122"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="">
<backgroundConfiguration key="background" image="square-button"/>
</buttonConfiguration>
<connections>
<action selector="multiButtonPressed:" destination="bL0-ag-pcs" eventType="touchUpInside" id="u6W-dc-lim"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" text="Multiplayer" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="3" baselineAdjustment="alignBaselines" adjustsFontForContentSizeCategory="YES" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="1Ks-BZ-dPw">
<rect key="frame" x="-8" y="41" width="257.5" height="47"/>
<fontDescription key="fontDescription" name="Nosifer-Regular" family="Nosifer" pointSize="27"/>
<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="1Ks-BZ-dPw" firstAttribute="leading" secondItem="ewd-d2-Lxq" secondAttribute="leading" id="8Pg-kt-uem"/>
<constraint firstAttribute="trailing" secondItem="1Ks-BZ-dPw" secondAttribute="trailing" id="E1i-ok-oXD"/>
<constraint firstAttribute="bottom" secondItem="1Ks-BZ-dPw" secondAttribute="bottom" constant="41" id="rmJ-zd-d03"/>
</constraints>
</view>
<view contentMode="scaleToFill" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="sqe-oW-Tjx">
<rect key="frame" x="205" y="545" width="240" height="128"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ral-67-ag6">
<rect key="frame" x="-38" y="3" width="315" height="122"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled">
<backgroundConfiguration key="background" image="square-button"/>
</buttonConfiguration>
<connections>
<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="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" 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"/>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="n2f-u1-JOa">
<rect key="frame" x="205" y="368" width="239" height="128"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KBY-6j-DYG">
<rect key="frame" x="-38" y="3" width="315" height="122"/>
<constraints>
<constraint firstAttribute="height" constant="122" id="Nhs-Ef-kGM"/>
<constraint firstAttribute="width" constant="315" id="RsS-Jk-uXJ"/>
</constraints>
<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>
</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="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>
</view>
</subviews>
<viewLayoutGuide key="safeArea" id="kht-Y2-5Yi"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstItem="kht-Y2-5Yi" firstAttribute="bottom" secondItem="sqe-oW-Tjx" secondAttribute="bottom" constant="301" id="0FO-UY-sFR"/>
<constraint firstItem="Xvz-LH-sKU" firstAttribute="centerY" secondItem="iEG-EI-hhj" secondAttribute="centerY" multiplier="1.25" id="8xj-if-C7e"/>
<constraint firstItem="ZYc-VC-Yak" firstAttribute="trailing" secondItem="iEG-EI-hhj" secondAttribute="trailing" id="9C1-qt-TZR"/>
<constraint firstItem="ZYc-VC-Yak" firstAttribute="top" secondItem="iEG-EI-hhj" secondAttribute="top" id="CDh-fa-4ya"/>
<constraint firstItem="ZYc-VC-Yak" firstAttribute="bottom" secondItem="iEG-EI-hhj" secondAttribute="bottom" id="GUs-Fy-7pw"/>
<constraint firstItem="ewd-d2-Lxq" firstAttribute="top" secondItem="kht-Y2-5Yi" secondAttribute="top" constant="124" id="H5U-0J-awd"/>
<constraint firstItem="n2f-u1-JOa" firstAttribute="trailing" secondItem="sqe-oW-Tjx" secondAttribute="trailing" id="KbG-dB-zYq"/>
<constraint firstItem="VV0-Pz-4eu" firstAttribute="width" secondItem="iEG-EI-hhj" secondAttribute="width" multiplier="0.45" id="NtL-mI-USM"/>
<constraint firstItem="VV0-Pz-4eu" firstAttribute="centerY" secondItem="iEG-EI-hhj" secondAttribute="centerY" multiplier="0.55" id="QTY-17-v8s"/>
<constraint firstItem="n2f-u1-JOa" firstAttribute="top" secondItem="ewd-d2-Lxq" secondAttribute="bottom" constant="46" id="WNG-k1-Ybj"/>
<constraint firstItem="sqe-oW-Tjx" firstAttribute="top" secondItem="n2f-u1-JOa" secondAttribute="bottom" constant="49" id="ZvZ-0S-cti"/>
<constraint firstAttribute="bottom" secondItem="ewd-d2-Lxq" secondAttribute="bottom" constant="702" id="a71-V4-pXA"/>
<constraint firstItem="ZYc-VC-Yak" firstAttribute="leading" secondItem="iEG-EI-hhj" secondAttribute="leading" id="aZD-2f-NlY"/>
<constraint firstItem="Xvz-LH-sKU" firstAttribute="centerX" secondItem="iEG-EI-hhj" secondAttribute="centerX" multiplier="1.34" id="fPo-ft-Ivy"/>
<constraint firstItem="ewd-d2-Lxq" firstAttribute="leading" secondItem="kht-Y2-5Yi" secondAttribute="leading" constant="205" id="gDB-nW-aZ8"/>
<constraint firstItem="n2f-u1-JOa" firstAttribute="leading" secondItem="ewd-d2-Lxq" secondAttribute="leading" id="jBs-BP-oek"/>
<constraint firstAttribute="bottom" secondItem="n2f-u1-JOa" secondAttribute="bottom" constant="528" id="mM7-zr-G4B"/>
<constraint firstItem="VV0-Pz-4eu" firstAttribute="centerX" secondItem="iEG-EI-hhj" secondAttribute="centerX" multiplier="1.34" id="vFx-Eb-Nkn"/>
<constraint firstItem="n2f-u1-JOa" firstAttribute="leading" secondItem="sqe-oW-Tjx" secondAttribute="leading" id="w5s-xb-Dd0"/>
<constraint firstItem="Xvz-LH-sKU" firstAttribute="width" secondItem="iEG-EI-hhj" secondAttribute="width" multiplier="0.45" id="zas-5R-jHB"/>
</constraints>
</view>
Expand Down Expand Up @@ -630,7 +691,7 @@ Match</string>
</scene>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="tXV-bd-lPZ"/>
<segue reference="1ej-FD-YqB"/>
<segue reference="WuO-mG-bY5"/>
</inferredMetricsTieBreakers>
<resources>
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 897826a

Please sign in to comment.