Initial commit
This commit is contained in:
39
LightshowManager/AppDelegate.swift
Normal file
39
LightshowManager/AppDelegate.swift
Normal file
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// LightshowManager
|
||||
//
|
||||
// Created by Quentin Millardet on 20/04/2024.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@main
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var model : LightshowModel?;
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
Thread.sleep(forTimeInterval: 3.0)
|
||||
model = LightshowModel()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// MARK: UISceneSession Lifecycle
|
||||
|
||||
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
|
||||
// Called when a new scene session is being created.
|
||||
// Use this method to select a configuration to create the new scene with.
|
||||
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
|
||||
}
|
||||
|
||||
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
|
||||
// Called when the user discards a scene session.
|
||||
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
|
||||
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
BIN
LightshowManager/Assets.xcassets/AppIcon.appiconset/1024.png
Normal file
BIN
LightshowManager/Assets.xcassets/AppIcon.appiconset/1024.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 256 KiB |
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "1024.png",
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
6
LightshowManager/Assets.xcassets/Contents.json
Normal file
6
LightshowManager/Assets.xcassets/Contents.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
46
LightshowManager/Base.lproj/LaunchScreen.storyboard
Normal file
46
LightshowManager/Base.lproj/LaunchScreen.storyboard
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="EHf-IW-A2E">
|
||||
<objects>
|
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Lightshow Manager" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eG3-ay-S6h">
|
||||
<rect key="frame" x="121" y="416" width="150" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="eG3-ay-S6h" secondAttribute="bottom" constant="381" id="4jr-PS-7Av"/>
|
||||
<constraint firstItem="eG3-ay-S6h" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="357" id="lJa-IW-p9h"/>
|
||||
<constraint firstItem="eG3-ay-S6h" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="121" id="nCi-Mm-UbA"/>
|
||||
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="eG3-ay-S6h" secondAttribute="trailing" constant="122" id="na8-eH-YrP"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="53" y="375"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
259
LightshowManager/Base.lproj/Main.storyboard
Normal file
259
LightshowManager/Base.lproj/Main.storyboard
Normal file
@@ -0,0 +1,259 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="uO4-do-ecb">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
|
||||
<capability name="Image references" minToolsVersion="12.0"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="tne-QT-ifu">
|
||||
<objects>
|
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="LightshowManager" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Choose your drive on popup" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dWe-Wl-ozX">
|
||||
<rect key="frame" x="89" y="385" width="215" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" restorationIdentifier="selectFolder" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="a3c-YA-PpV" userLabel="selectFolder" colorLabel="IBBuiltInLabel-Yellow">
|
||||
<rect key="frame" x="136" y="450" width="120" height="35"/>
|
||||
<state key="normal" title="Button"/>
|
||||
<buttonConfiguration key="configuration" style="tinted" title="Selectionner"/>
|
||||
<connections>
|
||||
<action selector="selectFolder:" destination="BYZ-38-t0r" eventType="touchUpInside" id="mVL-YO-ghE"/>
|
||||
<segue destination="lxQ-iP-nTJ" kind="show" id="uDB-7w-CXH"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="dWe-Wl-ozX" secondAttribute="trailing" constant="89" id="8Qd-s2-UyO"/>
|
||||
<constraint firstItem="dWe-Wl-ozX" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" constant="282" id="S1o-t6-G8C"/>
|
||||
<constraint firstItem="a3c-YA-PpV" firstAttribute="top" secondItem="dWe-Wl-ozX" secondAttribute="bottom" constant="44" id="Xng-9W-Igl"/>
|
||||
<constraint firstItem="dWe-Wl-ozX" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="89" id="ahj-GB-Is1"/>
|
||||
<constraint firstItem="6Tk-OE-BBY" firstAttribute="bottom" secondItem="a3c-YA-PpV" secondAttribute="bottom" constant="333" id="dau-TE-XR6"/>
|
||||
<constraint firstItem="a3c-YA-PpV" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="136" id="qg5-K1-j2t"/>
|
||||
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="a3c-YA-PpV" secondAttribute="trailing" constant="137" id="ybb-Dk-UcU"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<navigationItem key="navigationItem" id="pKU-5n-feK"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-355" y="-30"/>
|
||||
</scene>
|
||||
<!--Close Sound-->
|
||||
<scene sceneID="kjt-yt-5RI">
|
||||
<objects>
|
||||
<viewController id="7sR-nM-HVq" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="1G4-qq-zfn">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Close Door" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="b5x-1u-uNl">
|
||||
<rect key="frame" x="154" y="416" width="85" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="ewA-gg-jle"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="ewA-gg-jle" firstAttribute="bottom" secondItem="b5x-1u-uNl" secondAttribute="bottom" constant="332" id="3g4-oq-zux"/>
|
||||
<constraint firstItem="b5x-1u-uNl" firstAttribute="leading" secondItem="ewA-gg-jle" secondAttribute="leading" constant="154" id="7SH-k9-8vD"/>
|
||||
<constraint firstItem="ewA-gg-jle" firstAttribute="trailing" secondItem="b5x-1u-uNl" secondAttribute="trailing" constant="154" id="YFA-Ux-0yH"/>
|
||||
<constraint firstItem="b5x-1u-uNl" firstAttribute="top" secondItem="ewA-gg-jle" secondAttribute="top" constant="313" id="lU6-GN-ng3"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<tabBarItem key="tabBarItem" title="Close Sound" image="door.left.hand.open" catalog="system" selectedImage="door.left.hand.open" id="mv0-ae-zyi"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="L7J-VE-uzy" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1663" y="366"/>
|
||||
</scene>
|
||||
<!--Lightshow-->
|
||||
<scene sceneID="KEH-ew-GDR">
|
||||
<objects>
|
||||
<viewController id="eHl-6U-5zM" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="zcI-bV-uTx">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F3I-Qt-ocD">
|
||||
<rect key="frame" x="80" y="363" width="232" height="35"/>
|
||||
<state key="normal" title="Button"/>
|
||||
<buttonConfiguration key="configuration" style="plain" title="Télécharger des lightshows"/>
|
||||
<connections>
|
||||
<segue destination="nEn-Mu-Bmf" kind="show" id="hS5-h9-1Hj"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kej-Ch-CaP">
|
||||
<rect key="frame" x="45" y="457" width="302" height="35"/>
|
||||
<state key="normal" title="Button"/>
|
||||
<buttonConfiguration key="configuration" style="plain" title="Selectionner les lightshows à ajouter"/>
|
||||
<connections>
|
||||
<segue destination="5Iq-sn-wwf" kind="show" id="bjr-J2-fYf"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<viewLayoutGuide key="safeArea" id="dg4-7I-qcp"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<constraints>
|
||||
<constraint firstItem="kej-Ch-CaP" firstAttribute="leading" secondItem="dg4-7I-qcp" secondAttribute="leading" constant="45" id="1wl-fl-DDX"/>
|
||||
<constraint firstItem="kej-Ch-CaP" firstAttribute="top" secondItem="F3I-Qt-ocD" secondAttribute="bottom" constant="59" id="4k3-2L-sua"/>
|
||||
<constraint firstItem="F3I-Qt-ocD" firstAttribute="leading" secondItem="dg4-7I-qcp" secondAttribute="leading" constant="80" id="Ea9-lO-ebq"/>
|
||||
<constraint firstItem="F3I-Qt-ocD" firstAttribute="top" secondItem="dg4-7I-qcp" secondAttribute="top" constant="260" id="Ke5-LK-avc"/>
|
||||
<constraint firstItem="dg4-7I-qcp" firstAttribute="trailing" secondItem="F3I-Qt-ocD" secondAttribute="trailing" constant="81" id="X2m-l3-DoH"/>
|
||||
<constraint firstItem="dg4-7I-qcp" firstAttribute="trailing" secondItem="kej-Ch-CaP" secondAttribute="trailing" constant="46" id="fS9-X5-Vol"/>
|
||||
<constraint firstItem="dg4-7I-qcp" firstAttribute="bottom" secondItem="kej-Ch-CaP" secondAttribute="bottom" constant="277" id="y4Z-WZ-LkR"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<tabBarItem key="tabBarItem" title="Lightshow" image="warninglight" catalog="system" selectedImage="warninglight" id="PNd-MR-eNj"/>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="S7E-e0-lxf" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="1661.8320610687022" y="-327.46478873239437"/>
|
||||
</scene>
|
||||
<!--Table View Controller-->
|
||||
<scene sceneID="4pd-a4-JGq">
|
||||
<objects>
|
||||
<tableViewController id="nEn-Mu-Bmf" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" id="YpR-oE-1Un">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" id="NBe-2M-HKE">
|
||||
<rect key="frame" x="0.0" y="50" width="393" height="43.666667938232422"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="NBe-2M-HKE" id="y3i-vS-eqL">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="43.666667938232422"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</prototypes>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="nEn-Mu-Bmf" id="uDb-xw-zRF"/>
|
||||
<outlet property="delegate" destination="nEn-Mu-Bmf" id="yfK-kR-1ql"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<navigationItem key="navigationItem" id="210-OR-9rS"/>
|
||||
<connections>
|
||||
<outlet property="view" destination="YpR-oE-1Un" id="Tyt-XV-RVJ"/>
|
||||
</connections>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="sYg-4u-iYE" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="2746" y="-523"/>
|
||||
</scene>
|
||||
<!--Lightshow Download View-->
|
||||
<scene sceneID="wpU-oZ-jq6">
|
||||
<objects>
|
||||
<tableViewController id="5Iq-sn-wwf" customClass="LightshowDownloadView" customModule="LightshowManager" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" id="BEP-Qi-H2P">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="lightshowDownloadCell" textLabel="H3C-bR-A2x" imageView="gH8-qm-w7I" style="IBUITableViewCellStyleDefault" id="gAI-tD-NqL" customClass="LightshowDownloadCell" customModule="LightshowManager" customModuleProvider="target">
|
||||
<rect key="frame" x="0.0" y="50" width="393" height="43.666667938232422"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="gAI-tD-NqL" id="yMs-se-7eG">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="43.666667938232422"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="H3C-bR-A2x">
|
||||
<rect key="frame" x="59" y="0.0" width="314" height="43.666667938232422"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="0.0"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="gH8-qm-w7I">
|
||||
<rect key="frame" x="21.5" y="12.666666666666664" width="21" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<color key="tintColor" systemColor="systemYellowColor"/>
|
||||
<imageReference key="image" image="exclamationmark.triangle.fill" catalog="system" variableValue="1"/>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<variation key="default">
|
||||
<mask key="subviews">
|
||||
<exclude reference="gH8-qm-w7I"/>
|
||||
</mask>
|
||||
</variation>
|
||||
</tableViewCellContentView>
|
||||
<connections>
|
||||
<outlet property="LightshowName" destination="H3C-bR-A2x" id="N9T-1R-pFl"/>
|
||||
<outlet property="warningMessage" destination="gH8-qm-w7I" id="YmX-H0-LQg"/>
|
||||
</connections>
|
||||
</tableViewCell>
|
||||
</prototypes>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="5Iq-sn-wwf" id="iHq-0n-wqm"/>
|
||||
<outlet property="delegate" destination="5Iq-sn-wwf" id="AAR-Mq-1bm"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<navigationItem key="navigationItem" id="0jm-l1-PkB"/>
|
||||
</tableViewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="j6Q-2x-cYK" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="2763" y="125"/>
|
||||
</scene>
|
||||
<!--Navigation Controller-->
|
||||
<scene sceneID="M0L-Wa-ERm">
|
||||
<objects>
|
||||
<navigationController id="uO4-do-ecb" sceneMemberID="viewController">
|
||||
<navigationBar key="navigationBar" contentMode="scaleToFill" id="9rZ-cV-Fr3">
|
||||
<rect key="frame" x="0.0" y="59" width="393" height="44"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</navigationBar>
|
||||
<connections>
|
||||
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="UPU-cC-F52"/>
|
||||
</connections>
|
||||
</navigationController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iPh-MF-tEb" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-1236" y="-30"/>
|
||||
</scene>
|
||||
<!--Tab Bar Controller-->
|
||||
<scene sceneID="eLG-dO-fk1">
|
||||
<objects>
|
||||
<tabBarController id="lxQ-iP-nTJ" sceneMemberID="viewController">
|
||||
<navigationItem key="navigationItem" id="5Tg-E3-e8x"/>
|
||||
<tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="TzM-E2-WKc">
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="49"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</tabBar>
|
||||
<connections>
|
||||
<segue destination="eHl-6U-5zM" kind="relationship" relationship="viewControllers" id="CTi-IE-RUr"/>
|
||||
<segue destination="7sR-nM-HVq" kind="relationship" relationship="viewControllers" id="Vkb-e9-5aX"/>
|
||||
</connections>
|
||||
</tabBarController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="4K9-VY-9vE" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="671" y="-30"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="door.left.hand.open" catalog="system" width="108" height="128"/>
|
||||
<image name="exclamationmark.triangle.fill" catalog="system" width="128" height="109"/>
|
||||
<image name="warninglight" catalog="system" width="128" height="115"/>
|
||||
<systemColor name="systemBackgroundColor">
|
||||
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</systemColor>
|
||||
<systemColor name="systemYellowColor">
|
||||
<color red="1" green="0.80000000000000004" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</systemColor>
|
||||
</resources>
|
||||
</document>
|
||||
8
LightshowManager/DTO/ExampleDTO.swift
Normal file
8
LightshowManager/DTO/ExampleDTO.swift
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// ExampleDTO.swift
|
||||
// LightshowManager
|
||||
//
|
||||
// Created by Quentin Millardet on 05/05/2024.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
8
LightshowManager/ExempleDTO/ExempleDTO.swift
Normal file
8
LightshowManager/ExempleDTO/ExempleDTO.swift
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// ExempleDTO.swift
|
||||
// LightshowManager
|
||||
//
|
||||
// Created by Quentin Millardet on 05/05/2024.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
25
LightshowManager/Info.plist
Normal file
25
LightshowManager/Info.plist
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UIApplicationSupportsMultipleScenes</key>
|
||||
<false/>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict>
|
||||
<key>UIWindowSceneSessionRoleApplication</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UISceneConfigurationName</key>
|
||||
<string>Default Configuration</string>
|
||||
<key>UISceneDelegateClassName</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
|
||||
<key>UISceneStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
14
LightshowManager/LightshowDownloadCell.swift
Normal file
14
LightshowManager/LightshowDownloadCell.swift
Normal file
@@ -0,0 +1,14 @@
|
||||
//
|
||||
// LightshowDownloadCell.swift
|
||||
// LightshowManager
|
||||
//
|
||||
// Created by Quentin Millardet on 21/04/2024.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class LightshowDownloadCell : UITableViewCell{
|
||||
|
||||
@IBOutlet weak var warningMessage: UIImageView!
|
||||
@IBOutlet weak var LightshowName: UILabel!
|
||||
}
|
||||
53
LightshowManager/LightshowDownloadView.swift
Normal file
53
LightshowManager/LightshowDownloadView.swift
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// StudentTableViewController.swift
|
||||
// SchoolList8
|
||||
//
|
||||
// Created by Quentin Millardet on 14/10/2020.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class LightshowDownloadView: UITableViewController{
|
||||
|
||||
var model:LightshowModel?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
model = (UIApplication.shared.delegate as! AppDelegate).model
|
||||
}
|
||||
|
||||
// Return the number of rows for the table.
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return model!.getStudentCount()
|
||||
}
|
||||
|
||||
// Provide a cell object for each row.
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
// Fetch a cell of the appropriate type.
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "lightshowDownloadCell")
|
||||
let model = model?.getStudentAtIndex(indexPath.row);
|
||||
(cell as! LightshowDownloadCell).LightshowName.text = model?.name
|
||||
(cell as! LightshowDownloadCell).warningMessage.isHidden = model?.isOkFiles() ?? false;
|
||||
return cell!
|
||||
}
|
||||
|
||||
|
||||
// Permet de passer des informations à une vue avant que celle-ci ne soit créee
|
||||
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
|
||||
|
||||
}
|
||||
|
||||
@IBAction func unwindFromCancel(_ unwindSegue: UIStoryboardSegue) {
|
||||
//let sourceViewController : EditController = unwindSegue.source as! EditController
|
||||
//NSLog(sourceViewController.nameField.text!)
|
||||
// Use data from the view controller which initiated the unwind segue
|
||||
}
|
||||
|
||||
@IBAction func unwindFromOk(_ unwindSegue: UIStoryboardSegue) {
|
||||
//let sourceViewController : EditController = unwindSegue.source as! EditController
|
||||
let newName : String = "sourceViewController.nameField.text!"
|
||||
let row : Int = 1;
|
||||
model?.setStudentAtIndex(row , withdraw: newName)
|
||||
tableView.reloadData()
|
||||
}
|
||||
}
|
||||
5
LightshowManager/LightshowManager.entitlements
Normal file
5
LightshowManager/LightshowManager.entitlements
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
</plist>
|
||||
102
LightshowManager/LightshowModel.swift
Normal file
102
LightshowManager/LightshowModel.swift
Normal file
@@ -0,0 +1,102 @@
|
||||
//
|
||||
// LightshowModel.swift
|
||||
// LightshowManager
|
||||
//
|
||||
// Created by Quentin Millardet on 21/04/2024.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
|
||||
class Lightshow {
|
||||
|
||||
|
||||
var name : String;
|
||||
var urls : URLLightshow = URLLightshow();
|
||||
|
||||
init(_ name : String){
|
||||
self.name = name;
|
||||
}
|
||||
|
||||
func isOkFiles() -> Bool {
|
||||
return self.urls.fseq != nil && self.urls.mp3 != nil;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
struct URLLightshow {
|
||||
|
||||
var fseq : String! = nil ;
|
||||
var mp3 : String! = nil;
|
||||
|
||||
}
|
||||
|
||||
|
||||
class LightshowModel{
|
||||
var names : Array<Lightshow> = [] ;
|
||||
|
||||
init(){
|
||||
|
||||
}
|
||||
|
||||
func getStudentAtIndex(_ i :Int) -> Lightshow{
|
||||
|
||||
// let url = URL(string: "https://bit.ly/3sspdFO")!
|
||||
//
|
||||
// var request = URLRequest(url: url)
|
||||
//
|
||||
// request.setValue(
|
||||
// "application/json",
|
||||
// forHTTPHeaderField: "Content-Type"
|
||||
// )
|
||||
// let task = URLSession.shared.dataTask(with: request) { data, response, error in
|
||||
// if let data = data {
|
||||
// if let books = try? JSONDecoder().decode([Book].self, from: data) {
|
||||
// self.names = [];
|
||||
// for book in books{
|
||||
// self.names.append(book.title)
|
||||
// }
|
||||
// } else {
|
||||
// print("Invalid Response")
|
||||
// }
|
||||
// } else if let error = error {
|
||||
// print("HTTP Request Failed \(error)")
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// task.resume()
|
||||
return names[i];
|
||||
}
|
||||
|
||||
func getStudentCount() -> Int{
|
||||
return names.count;
|
||||
}
|
||||
|
||||
func setStudentAtIndex(_ index: Int, withdraw value : String){
|
||||
var filenameArray = value.split(separator: ".")
|
||||
filenameArray.remove(at: filenameArray.count - 1)
|
||||
|
||||
let valueNomalized = filenameArray.joined()
|
||||
|
||||
var foundLightshow : Lightshow! = nil;
|
||||
|
||||
for lightshow in names {
|
||||
if (lightshow.name == valueNomalized ){
|
||||
foundLightshow = lightshow;
|
||||
}
|
||||
}
|
||||
if (foundLightshow == nil){
|
||||
foundLightshow = Lightshow(valueNomalized);
|
||||
names.append(foundLightshow)
|
||||
}
|
||||
if (value.contains(".mp3")){
|
||||
foundLightshow.urls.mp3 = value;
|
||||
} else if (value.contains(".fseq")){
|
||||
foundLightshow.urls.fseq = value;
|
||||
}
|
||||
}
|
||||
|
||||
func resetStundent() -> Void {
|
||||
self.names = [];
|
||||
}
|
||||
}
|
||||
52
LightshowManager/SceneDelegate.swift
Normal file
52
LightshowManager/SceneDelegate.swift
Normal file
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// SceneDelegate.swift
|
||||
// LightshowManager
|
||||
//
|
||||
// Created by Quentin Millardet on 20/04/2024.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
|
||||
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
|
||||
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
|
||||
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
|
||||
guard let _ = (scene as? UIWindowScene) else { return }
|
||||
}
|
||||
|
||||
func sceneDidDisconnect(_ scene: UIScene) {
|
||||
// Called as the scene is being released by the system.
|
||||
// This occurs shortly after the scene enters the background, or when its session is discarded.
|
||||
// Release any resources associated with this scene that can be re-created the next time the scene connects.
|
||||
// The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead).
|
||||
}
|
||||
|
||||
func sceneDidBecomeActive(_ scene: UIScene) {
|
||||
// Called when the scene has moved from an inactive state to an active state.
|
||||
// Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
|
||||
}
|
||||
|
||||
func sceneWillResignActive(_ scene: UIScene) {
|
||||
// Called when the scene will move from an active state to an inactive state.
|
||||
// This may occur due to temporary interruptions (ex. an incoming phone call).
|
||||
}
|
||||
|
||||
func sceneWillEnterForeground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the background to the foreground.
|
||||
// Use this method to undo the changes made on entering the background.
|
||||
}
|
||||
|
||||
func sceneDidEnterBackground(_ scene: UIScene) {
|
||||
// Called as the scene transitions from the foreground to the background.
|
||||
// Use this method to save data, release shared resources, and store enough scene-specific state information
|
||||
// to restore the scene back to its current state.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
98
LightshowManager/ViewController.swift
Normal file
98
LightshowManager/ViewController.swift
Normal file
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// LightshowManager
|
||||
//
|
||||
// Created by Quentin Millardet on 20/04/2024.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import os
|
||||
|
||||
class ViewController: UIViewController, UIDocumentPickerDelegate {
|
||||
|
||||
var startingDirectory : URL?
|
||||
var model : LightshowModel?
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
model = (UIApplication.shared.delegate as! AppDelegate).model
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
@IBAction func selectFolder(_ sender: Any) {
|
||||
|
||||
// Create a document picker for directories.
|
||||
let documentPicker =
|
||||
UIDocumentPickerViewController(forOpeningContentTypes: [.folder])
|
||||
documentPicker.delegate = self
|
||||
|
||||
|
||||
// Set the initial directory.
|
||||
documentPicker.directoryURL = startingDirectory
|
||||
|
||||
|
||||
// Present the document picker.
|
||||
present(documentPicker, animated: true, completion: nil)
|
||||
}
|
||||
|
||||
func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
|
||||
// Start accessing a security-scoped resource.
|
||||
guard url.startAccessingSecurityScopedResource() else {
|
||||
// Handle the failure here.
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// Make sure you release the security-scoped resource when you finish.
|
||||
defer { url.stopAccessingSecurityScopedResource() }
|
||||
|
||||
|
||||
// Use file coordination for reading and writing any of the URL’s content.
|
||||
var error: NSError? = nil
|
||||
NSFileCoordinator().coordinate(readingItemAt: url, error: &error) { (url) in
|
||||
|
||||
let keys : [URLResourceKey] = [.nameKey, .isDirectoryKey]
|
||||
|
||||
// Get an enumerator for the directory's content.
|
||||
guard let fileList =
|
||||
FileManager.default.enumerator(at: url, includingPropertiesForKeys: keys) else {
|
||||
Swift.debugPrint("*** Unable to access the contents of \(url.path) ***\n")
|
||||
return
|
||||
}
|
||||
|
||||
model?.resetStundent()
|
||||
|
||||
for case let file as URL in fileList {
|
||||
|
||||
|
||||
let logger = Logger(subsystem: Bundle.main.bundleIdentifier!, category: "network")
|
||||
logger.debug("chosen file: \(file.relativeString)")
|
||||
|
||||
let filename = file.lastPathComponent;
|
||||
|
||||
if (filename.contains(".mp3") || filename.contains(".fseq") ){
|
||||
model?.setStudentAtIndex(model?.getStudentCount() ?? 0, withdraw: filename )
|
||||
}
|
||||
|
||||
// Start accessing the content's security-scoped URL.
|
||||
guard file.startAccessingSecurityScopedResource() else {
|
||||
logger.error("Not accessing Security Scoped Ressource")
|
||||
// Handle the failure here.
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
// Do something with the file here.
|
||||
// Swift.debugPrint("chosen file: \(file.lastPathComponent)")
|
||||
|
||||
// Make sure you release the security-scoped resource when you finish.
|
||||
file.stopAccessingSecurityScopedResource()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
33
LightshowManager/en.lproj/Main.strings
Normal file
33
LightshowManager/en.lproj/Main.strings
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
/* Class = "UIButton"; configuration.title = "Télécharger des lightshows"; ObjectID = "F3I-Qt-ocD"; */
|
||||
"F3I-Qt-ocD.configuration.title" = "Télécharger des lightshows";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "F3I-Qt-ocD"; */
|
||||
"F3I-Qt-ocD.normalTitle" = "Button";
|
||||
|
||||
/* Class = "UITabBarItem"; title = "Lightshow"; ObjectID = "PNd-MR-eNj"; */
|
||||
"PNd-MR-eNj.title" = "Lightshow";
|
||||
|
||||
/* Class = "UILabel"; text = "Ghostbuster"; ObjectID = "VB9-5v-hUx"; */
|
||||
"VB9-5v-hUx.text" = "Ghostbuster";
|
||||
|
||||
/* Class = "UIButton"; configuration.title = "Selectionner"; ObjectID = "a3c-YA-PpV"; */
|
||||
"a3c-YA-PpV.configuration.title" = "Selectionner";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "a3c-YA-PpV"; */
|
||||
"a3c-YA-PpV.normalTitle" = "Button";
|
||||
|
||||
/* Class = "UILabel"; text = "Close Door"; ObjectID = "b5x-1u-uNl"; */
|
||||
"b5x-1u-uNl.text" = "Close Door";
|
||||
|
||||
/* Class = "UILabel"; text = "Choose your drive on popup"; ObjectID = "dWe-Wl-ozX"; */
|
||||
"dWe-Wl-ozX.text" = "Choose your drive on popup";
|
||||
|
||||
/* Class = "UIButton"; configuration.title = "Selectionner les lightshows à ajouter"; ObjectID = "kej-Ch-CaP"; */
|
||||
"kej-Ch-CaP.configuration.title" = "Selectionner les lightshows à ajouter";
|
||||
|
||||
/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "kej-Ch-CaP"; */
|
||||
"kej-Ch-CaP.normalTitle" = "Button";
|
||||
|
||||
/* Class = "UITabBarItem"; title = "Close Sound"; ObjectID = "mv0-ae-zyi"; */
|
||||
"mv0-ae-zyi.title" = "Close Sound";
|
||||
36
LightshowManagerTests/LightshowManagerTests.swift
Normal file
36
LightshowManagerTests/LightshowManagerTests.swift
Normal file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// LightshowManagerTests.swift
|
||||
// LightshowManagerTests
|
||||
//
|
||||
// Created by Quentin Millardet on 20/04/2024.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import LightshowManager
|
||||
|
||||
final class LightshowManagerTests: XCTestCase {
|
||||
|
||||
override func setUpWithError() throws {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
override func tearDownWithError() throws {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
func testExample() throws {
|
||||
// This is an example of a functional test case.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
// Any test you write for XCTest can be annotated as throws and async.
|
||||
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
|
||||
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
|
||||
}
|
||||
|
||||
func testPerformanceExample() throws {
|
||||
// This is an example of a performance test case.
|
||||
self.measure {
|
||||
// Put the code you want to measure the time of here.
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
41
LightshowManagerUITests/LightshowManagerUITests.swift
Normal file
41
LightshowManagerUITests/LightshowManagerUITests.swift
Normal file
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// LightshowManagerUITests.swift
|
||||
// LightshowManagerUITests
|
||||
//
|
||||
// Created by Quentin Millardet on 20/04/2024.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class LightshowManagerUITests: XCTestCase {
|
||||
|
||||
override func setUpWithError() throws {
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
|
||||
// In UI tests it is usually best to stop immediately when a failure occurs.
|
||||
continueAfterFailure = false
|
||||
|
||||
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
|
||||
}
|
||||
|
||||
override func tearDownWithError() throws {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
func testExample() throws {
|
||||
// UI tests must launch the application that they test.
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
}
|
||||
|
||||
func testLaunchPerformance() throws {
|
||||
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
|
||||
// This measures how long it takes to launch your application.
|
||||
measure(metrics: [XCTApplicationLaunchMetric()]) {
|
||||
XCUIApplication().launch()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// LightshowManagerUITestsLaunchTests.swift
|
||||
// LightshowManagerUITests
|
||||
//
|
||||
// Created by Quentin Millardet on 20/04/2024.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
final class LightshowManagerUITestsLaunchTests: XCTestCase {
|
||||
|
||||
override class var runsForEachTargetApplicationUIConfiguration: Bool {
|
||||
true
|
||||
}
|
||||
|
||||
override func setUpWithError() throws {
|
||||
continueAfterFailure = false
|
||||
}
|
||||
|
||||
func testLaunch() throws {
|
||||
let app = XCUIApplication()
|
||||
app.launch()
|
||||
|
||||
// Insert steps here to perform after app launch but before taking a screenshot,
|
||||
// such as logging into a test account or navigating somewhere in the app
|
||||
|
||||
let attachment = XCTAttachment(screenshot: app.screenshot())
|
||||
attachment.name = "Launch Screen"
|
||||
attachment.lifetime = .keepAlways
|
||||
add(attachment)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user