Skip to content
Snippets Groups Projects
Commit 9537362f authored by jftgƒ's avatar jftgƒ
Browse files

Remplissage de l'interface d'accueil.

parent 9585d309
Branches
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
159D0F242A13B19C0029D0F7 /* 1200x680_jp_zadi.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 159D0F232A13B19C0029D0F7 /* 1200x680_jp_zadi.jpeg */; }; 157E41D92A1D04E400E6DE57 /* zadi.jpeg in Resources */ = {isa = PBXBuildFile; fileRef = 157E41D82A1D04E400E6DE57 /* zadi.jpeg */; };
BF3C480E2A0A1FCA00CE128F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3C480D2A0A1FCA00CE128F /* AppDelegate.swift */; }; BF3C480E2A0A1FCA00CE128F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3C480D2A0A1FCA00CE128F /* AppDelegate.swift */; };
BF3C48102A0A1FCA00CE128F /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3C480F2A0A1FCA00CE128F /* SceneDelegate.swift */; }; BF3C48102A0A1FCA00CE128F /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3C480F2A0A1FCA00CE128F /* SceneDelegate.swift */; };
BF3C48122A0A1FCA00CE128F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3C48112A0A1FCA00CE128F /* ViewController.swift */; }; BF3C48122A0A1FCA00CE128F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF3C48112A0A1FCA00CE128F /* ViewController.swift */; };
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
159D0F232A13B19C0029D0F7 /* 1200x680_jp_zadi.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = 1200x680_jp_zadi.jpeg; path = ../../1200x680_jp_zadi.jpeg; sourceTree = "<group>"; }; 157E41D82A1D04E400E6DE57 /* zadi.jpeg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = zadi.jpeg; path = ../../zadi.jpeg; sourceTree = "<group>"; };
BF3C480A2A0A1FCA00CE128F /* Pendu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Pendu.app; sourceTree = BUILT_PRODUCTS_DIR; }; BF3C480A2A0A1FCA00CE128F /* Pendu.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Pendu.app; sourceTree = BUILT_PRODUCTS_DIR; };
BF3C480D2A0A1FCA00CE128F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; BF3C480D2A0A1FCA00CE128F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
BF3C480F2A0A1FCA00CE128F /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; }; BF3C480F2A0A1FCA00CE128F /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
...@@ -116,8 +116,8 @@ ...@@ -116,8 +116,8 @@
BF3C48192A0A1FCD00CE128F /* Assets.xcassets */, BF3C48192A0A1FCD00CE128F /* Assets.xcassets */,
BF3C481B2A0A1FCD00CE128F /* LaunchScreen.storyboard */, BF3C481B2A0A1FCD00CE128F /* LaunchScreen.storyboard */,
BF3C481E2A0A1FCD00CE128F /* Info.plist */, BF3C481E2A0A1FCD00CE128F /* Info.plist */,
157E41D82A1D04E400E6DE57 /* zadi.jpeg */,
BF3C48162A0A1FCA00CE128F /* Pendu.xcdatamodeld */, BF3C48162A0A1FCA00CE128F /* Pendu.xcdatamodeld */,
159D0F232A13B19C0029D0F7 /* 1200x680_jp_zadi.jpeg */,
D082CCC82A0A33D600D97981 /* GameEngine.swift */, D082CCC82A0A33D600D97981 /* GameEngine.swift */,
BF3C48422A0A3CFF00CE128F /* GameEngineTests.swift */, BF3C48422A0A3CFF00CE128F /* GameEngineTests.swift */,
); );
...@@ -246,8 +246,8 @@ ...@@ -246,8 +246,8 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
BF3C481D2A0A1FCD00CE128F /* LaunchScreen.storyboard in Resources */, BF3C481D2A0A1FCD00CE128F /* LaunchScreen.storyboard in Resources */,
157E41D92A1D04E400E6DE57 /* zadi.jpeg in Resources */,
BF3C481A2A0A1FCD00CE128F /* Assets.xcassets in Resources */, BF3C481A2A0A1FCD00CE128F /* Assets.xcassets in Resources */,
159D0F242A13B19C0029D0F7 /* 1200x680_jp_zadi.jpeg in Resources */,
BF3C48152A0A1FCA00CE128F /* Main.storyboard in Resources */, BF3C48152A0A1FCA00CE128F /* Main.storyboard in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="1200x680_jp_zadi.jpeg" translatesAutoresizingMaskIntoConstraints="NO" id="pv2-ee-Khp"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="zadi.jpeg" translatesAutoresizingMaskIntoConstraints="NO" id="pv2-ee-Khp">
<rect key="frame" x="0.0" y="-43" width="414" height="319"/> <rect key="frame" x="0.0" y="-43" width="414" height="319"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView> </imageView>
...@@ -26,25 +26,12 @@ ...@@ -26,25 +26,12 @@
<fontDescription key="fontDescription" type="system" pointSize="14"/> <fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/> <textInputTraits key="textInputTraits"/>
</textField> </textField>
<pickerView contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3TE-rS-qnG">
<rect key="frame" x="0.0" y="442" width="414" height="162"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
</pickerView>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QSN-AU-ceX">
<rect key="frame" x="308" y="402" width="33" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="+"/>
<connections>
<action selector="ajouterAct:" destination="BYZ-38-t0r" eventType="touchUpInside" id="eWg-jI-G3G"/>
</connections>
</button>
<pickerView contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LNU-nY-Uyk"> <pickerView contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LNU-nY-Uyk">
<rect key="frame" x="0.0" y="641" width="414" height="162"/> <rect key="frame" x="0.0" y="565" width="414" height="162"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
</pickerView> </pickerView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Choisissez un theme" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dAa-qb-1JB"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Choisissez un theme" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dAa-qb-1JB">
<rect key="frame" x="119" y="612" width="158" height="21"/> <rect key="frame" x="119" y="484" width="158" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/> <nil key="textColor"/>
...@@ -57,8 +44,25 @@ ...@@ -57,8 +44,25 @@
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Rxj-5T-1Nw">
<rect key="frame" x="117" y="720" width="181" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="Lancer Partie"/>
<connections>
<action selector="LancerPartie:" destination="BYZ-38-t0r" eventType="touchUpInside" id="ccG-OM-Emx"/>
</connections>
</button>
<segmentedControl opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="NvB-ZN-BTJ">
<rect key="frame" x="144" y="526" width="109" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<segments>
<segment title="Facile"/>
<segment title="Hard"/>
</segments>
</segmentedControl>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lae-hh-psQ"> <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="lae-hh-psQ">
<rect key="frame" x="151" y="284" width="113" height="31"/> <rect key="frame" x="119" y="284" width="160" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/> <state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="gray"> <buttonConfiguration key="configuration" style="gray">
...@@ -70,22 +74,12 @@ ...@@ -70,22 +74,12 @@
<action selector="AfficherClassement:" destination="BYZ-38-t0r" eventType="touchUpInside" id="up5-UE-mBH"/> <action selector="AfficherClassement:" destination="BYZ-38-t0r" eventType="touchUpInside" id="up5-UE-mBH"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Rxj-5T-1Nw">
<rect key="frame" x="117" y="796" width="181" height="54"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="filled" title="Lancer Partie"/>
<connections>
<action selector="LancerPartie:" destination="BYZ-38-t0r" eventType="touchUpInside" id="ccG-OM-Emx"/>
</connections>
</button>
</subviews> </subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view> </view>
<connections> <connections>
<outlet property="ajouterbtn" destination="QSN-AU-ceX" id="QV2-7a-fT3"/> <outlet property="choixNiv" destination="NvB-ZN-BTJ" id="fAA-St-woR"/>
<outlet property="choixPseudo" destination="3TE-rS-qnG" id="5a3-TN-FpU"/>
<outlet property="choixTheme" destination="LNU-nY-Uyk" id="Fff-Y6-Z8A"/> <outlet property="choixTheme" destination="LNU-nY-Uyk" id="Fff-Y6-Z8A"/>
<outlet property="classement" destination="lae-hh-psQ" id="YEG-ma-abh"/> <outlet property="classement" destination="lae-hh-psQ" id="YEG-ma-abh"/>
<outlet property="pseudoinput" destination="iRK-mL-RC3" id="v77-OK-9QK"/> <outlet property="pseudoinput" destination="iRK-mL-RC3" id="v77-OK-9QK"/>
...@@ -97,7 +91,7 @@ ...@@ -97,7 +91,7 @@
</scene> </scene>
</scenes> </scenes>
<resources> <resources>
<image name="1200x680_jp_zadi.jpeg" width="1200" height="680"/> <image name="zadi.jpeg" width="1928" height="1208"/>
<systemColor name="systemBackgroundColor"> <systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor> </systemColor>
......
//
// ViewController.swift
// Pendu
//
// Created by Sofiane Lasri-Trienpont on 09/05/2023.
//
import UIKit import UIKit
class ViewController: UIViewController { class ViewController: UIViewController, UIPickerViewDataSource, UIPickerViewDelegate {
@IBOutlet weak var classement: UIButton! @IBOutlet weak var classement: UIButton!
@IBOutlet weak var pseudoinput: UITextField! @IBOutlet weak var pseudoinput: UITextField!
@IBOutlet weak var ajouterbtn: UIButton!
@IBOutlet weak var choixPseudo: UIPickerView!
@IBOutlet weak var choixTheme: UIPickerView! @IBOutlet weak var choixTheme: UIPickerView!
@IBOutlet weak var choixNiv: UISegmentedControl!
@IBAction func ajouterAct(_ sender: Any) { let pickerData = ["Animals", "Sports", "Food", "Cities", "Colors"]
override func viewDidLoad() {
super.viewDidLoad()
choixTheme.dataSource = self
choixTheme.delegate = self
} }
@IBAction func LancerPartie(_ sender: Any) { @IBAction func LancerPartie(_ sender: Any) {
guard let pseudo = pseudoinput.text else {
return
} }
@IBAction func AfficherClassement(_ sender: Any) { let niveauIndex = choixNiv.selectedSegmentIndex
let niveau = choixNiv.titleForSegment(at: niveauIndex)
let themeIndex = choixTheme.selectedRow(inComponent: 0)
let theme = pickerData[themeIndex]
// Utilisez les valeurs récupérées comme vous le souhaitez
print("Pseudo: \(pseudo)")
print("Niveau: \(niveau ?? "")")
print("Thème: \(theme)")
// Ajoutez votre code supplémentaire ici
} }
// MARK: - UIPickerViewDataSource
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}
override func viewDidLoad() { func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
super.viewDidLoad() return pickerData.count
// Do any additional setup after loading the view.
} }
// MARK: - UIPickerViewDelegate
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
return pickerData[row]
} }
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
// Code à exécuter lorsque l'utilisateur sélectionne une valeur dans le pickerView.
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment