💄 add views

main
DJYohann 2 years ago
parent 571c21b516
commit 0713e0f630

@ -14,6 +14,13 @@
1E0D88F42A1E759F00786FE3 /* AppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D88F32A1E759F00786FE3 /* AppTests.swift */; }; 1E0D88F42A1E759F00786FE3 /* AppTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D88F32A1E759F00786FE3 /* AppTests.swift */; };
1E0D88FE2A1E75A000786FE3 /* AppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D88FD2A1E75A000786FE3 /* AppUITests.swift */; }; 1E0D88FE2A1E75A000786FE3 /* AppUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D88FD2A1E75A000786FE3 /* AppUITests.swift */; };
1E0D89002A1E75A000786FE3 /* AppUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D88FF2A1E75A000786FE3 /* AppUITestsLaunchTests.swift */; }; 1E0D89002A1E75A000786FE3 /* AppUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D88FF2A1E75A000786FE3 /* AppUITestsLaunchTests.swift */; };
1E0D890F2A1E7B9C00786FE3 /* Model in Frameworks */ = {isa = PBXBuildFile; productRef = 1E0D890E2A1E7B9C00786FE3 /* Model */; };
1E0D89132A1E7C4500786FE3 /* CalculatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D89122A1E7C4500786FE3 /* CalculatorView.swift */; };
1E0D89152A1E7F5800786FE3 /* BlocListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D89142A1E7F5800786FE3 /* BlocListItem.swift */; };
1E0D89172A1E838700786FE3 /* UEListItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D89162A1E838700786FE3 /* UEListItem.swift */; };
1E0D89192A1E84AE00786FE3 /* UEItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D89182A1E84AE00786FE3 /* UEItem.swift */; };
1E0D891B2A1E9BEF00786FE3 /* UEView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D891A2A1E9BEF00786FE3 /* UEView.swift */; };
1E0D891D2A1EBBBF00786FE3 /* MatiereItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0D891C2A1EBBBF00786FE3 /* MatiereItem.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -34,7 +41,7 @@
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
1E0D88DF2A1E759A00786FE3 /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1E0D88DF2A1E759A00786FE3 /* AverageCalculator.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AverageCalculator.app; sourceTree = BUILT_PRODUCTS_DIR; };
1E0D88E22A1E759A00786FE3 /* AppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppApp.swift; sourceTree = "<group>"; }; 1E0D88E22A1E759A00786FE3 /* AppApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppApp.swift; sourceTree = "<group>"; };
1E0D88E42A1E759A00786FE3 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; }; 1E0D88E42A1E759A00786FE3 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
1E0D88E62A1E759F00786FE3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 1E0D88E62A1E759F00786FE3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@ -44,6 +51,12 @@
1E0D88F92A1E759F00786FE3 /* AppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 1E0D88F92A1E759F00786FE3 /* AppUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AppUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
1E0D88FD2A1E75A000786FE3 /* AppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppUITests.swift; sourceTree = "<group>"; }; 1E0D88FD2A1E75A000786FE3 /* AppUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppUITests.swift; sourceTree = "<group>"; };
1E0D88FF2A1E75A000786FE3 /* AppUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppUITestsLaunchTests.swift; sourceTree = "<group>"; }; 1E0D88FF2A1E75A000786FE3 /* AppUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppUITestsLaunchTests.swift; sourceTree = "<group>"; };
1E0D89122A1E7C4500786FE3 /* CalculatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CalculatorView.swift; sourceTree = "<group>"; };
1E0D89142A1E7F5800786FE3 /* BlocListItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlocListItem.swift; sourceTree = "<group>"; };
1E0D89162A1E838700786FE3 /* UEListItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UEListItem.swift; sourceTree = "<group>"; };
1E0D89182A1E84AE00786FE3 /* UEItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UEItem.swift; sourceTree = "<group>"; };
1E0D891A2A1E9BEF00786FE3 /* UEView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UEView.swift; sourceTree = "<group>"; };
1E0D891C2A1EBBBF00786FE3 /* MatiereItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatiereItem.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -51,6 +64,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
1E0D890F2A1E7B9C00786FE3 /* Model in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -74,17 +88,19 @@
1E0D88D62A1E759900786FE3 = { 1E0D88D62A1E759900786FE3 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
1E0D89112A1E7C0800786FE3 /* Views */,
1E0D88E12A1E759A00786FE3 /* App */, 1E0D88E12A1E759A00786FE3 /* App */,
1E0D88F22A1E759F00786FE3 /* AppTests */, 1E0D88F22A1E759F00786FE3 /* AppTests */,
1E0D88FC2A1E75A000786FE3 /* AppUITests */, 1E0D88FC2A1E75A000786FE3 /* AppUITests */,
1E0D88E02A1E759A00786FE3 /* Products */, 1E0D88E02A1E759A00786FE3 /* Products */,
1E0D890D2A1E7B9C00786FE3 /* Frameworks */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
1E0D88E02A1E759A00786FE3 /* Products */ = { 1E0D88E02A1E759A00786FE3 /* Products */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
1E0D88DF2A1E759A00786FE3 /* App.app */, 1E0D88DF2A1E759A00786FE3 /* AverageCalculator.app */,
1E0D88EF2A1E759F00786FE3 /* AppTests.xctest */, 1E0D88EF2A1E759F00786FE3 /* AppTests.xctest */,
1E0D88F92A1E759F00786FE3 /* AppUITests.xctest */, 1E0D88F92A1E759F00786FE3 /* AppUITests.xctest */,
); );
@ -127,6 +143,26 @@
path = AppUITests; path = AppUITests;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
1E0D890D2A1E7B9C00786FE3 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
1E0D89112A1E7C0800786FE3 /* Views */ = {
isa = PBXGroup;
children = (
1E0D89122A1E7C4500786FE3 /* CalculatorView.swift */,
1E0D89142A1E7F5800786FE3 /* BlocListItem.swift */,
1E0D89162A1E838700786FE3 /* UEListItem.swift */,
1E0D89182A1E84AE00786FE3 /* UEItem.swift */,
1E0D891A2A1E9BEF00786FE3 /* UEView.swift */,
1E0D891C2A1EBBBF00786FE3 /* MatiereItem.swift */,
);
path = Views;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
@ -143,8 +179,11 @@
dependencies = ( dependencies = (
); );
name = App; name = App;
packageProductDependencies = (
1E0D890E2A1E7B9C00786FE3 /* Model */,
);
productName = App; productName = App;
productReference = 1E0D88DF2A1E759A00786FE3 /* App.app */; productReference = 1E0D88DF2A1E759A00786FE3 /* AverageCalculator.app */;
productType = "com.apple.product-type.application"; productType = "com.apple.product-type.application";
}; };
1E0D88EE2A1E759F00786FE3 /* AppTests */ = { 1E0D88EE2A1E759F00786FE3 /* AppTests */ = {
@ -257,8 +296,14 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
1E0D89152A1E7F5800786FE3 /* BlocListItem.swift in Sources */,
1E0D88E52A1E759A00786FE3 /* ContentView.swift in Sources */, 1E0D88E52A1E759A00786FE3 /* ContentView.swift in Sources */,
1E0D891D2A1EBBBF00786FE3 /* MatiereItem.swift in Sources */,
1E0D89132A1E7C4500786FE3 /* CalculatorView.swift in Sources */,
1E0D88E32A1E759A00786FE3 /* AppApp.swift in Sources */, 1E0D88E32A1E759A00786FE3 /* AppApp.swift in Sources */,
1E0D89192A1E84AE00786FE3 /* UEItem.swift in Sources */,
1E0D891B2A1E9BEF00786FE3 /* UEView.swift in Sources */,
1E0D89172A1E838700786FE3 /* UEListItem.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -419,6 +464,7 @@
DEVELOPMENT_ASSET_PATHS = "\"App/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"App/Preview Content\"";
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES;
@ -430,7 +476,7 @@
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = djyohann.App; PRODUCT_BUNDLE_IDENTIFIER = djyohann.App;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = AverageCalculator;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -447,6 +493,7 @@
DEVELOPMENT_ASSET_PATHS = "\"App/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"App/Preview Content\"";
ENABLE_PREVIEWS = YES; ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES;
@ -458,7 +505,7 @@
); );
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = djyohann.App; PRODUCT_BUNDLE_IDENTIFIER = djyohann.App;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = AverageCalculator;
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0; SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -577,6 +624,13 @@
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
/* End XCConfigurationList section */ /* End XCConfigurationList section */
/* Begin XCSwiftPackageProductDependency section */
1E0D890E2A1E7B9C00786FE3 /* Model */ = {
isa = XCSwiftPackageProductDependency;
productName = Model;
};
/* End XCSwiftPackageProductDependency section */
}; };
rootObject = 1E0D88D72A1E759900786FE3 /* Project object */; rootObject = 1E0D88D72A1E759900786FE3 /* Project object */;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

@ -1,6 +1,7 @@
{ {
"images" : [ "images" : [
{ {
"filename" : "1024.png",
"idiom" : "universal", "idiom" : "universal",
"platform" : "ios", "platform" : "ios",
"size" : "1024x1024" "size" : "1024x1024"

@ -0,0 +1,41 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF4",
"green" : "0xEF",
"red" : "0xEF"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0xF4",
"green" : "0xEF",
"red" : "0xEF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"localizable" : true
}
}

@ -9,13 +9,7 @@ import SwiftUI
struct ContentView: View { struct ContentView: View {
var body: some View { var body: some View {
VStack { CalculatorView()
Image(systemName: "globe")
.imageScale(.large)
.foregroundColor(.accentColor)
Text("Hello, world!")
}
.padding()
} }
} }

@ -0,0 +1,37 @@
//
// BlocListItem.swift
// App
//
// Created by BREUIL Yohann on 24/05/2023.
//
import SwiftUI
struct BlocListItem: View {
var body: some View {
VStack(alignment: .leading) {
Label("Blocs", systemImage: "doc.on.doc.fill")
.font(.title)
Text("Vous devez avoir la moyenne à chacun de ces blocs pour avoir votre diplôme.")
HStack {
Label("Total", systemImage: "doc.on.doc.fill")
Spacer()
Label("11.67", systemImage: "graduationcap.circle.fill")
}
HStack {
Label("Total", systemImage: "doc.on.doc.fill")
Spacer()
Label("11.67", systemImage: "graduationcap.circle.fill")
}
}
.padding()
.background(Color("ListItemBackgroundColor"))
.cornerRadius(12)
}
}
struct BlocListItem_Previews: PreviewProvider {
static var previews: some View {
BlocListItem()
}
}

@ -0,0 +1,29 @@
//
// CalculatorView.swift
// App
//
// Created by BREUIL Yohann on 24/05/2023.
//
import SwiftUI
import Model
struct CalculatorView: View {
var body: some View {
NavigationStack {
ScrollView {
BlocListItem()
Divider()
UEListItem()
}
.navigationTitle("Calculette")
}
}
}
struct CalculatorView_Previews: PreviewProvider {
static var previews: some View {
CalculatorView()
}
}

@ -0,0 +1,37 @@
//
// MatiereItem.swift
// App
//
// Created by BREUIL Yohann on 24/05/2023.
//
import SwiftUI
struct MatiereItem: View {
@State private var note = 12.5
var body: some View {
VStack {
HStack() {
Text("Qualité de Développement")
Spacer()
Text("6")
}
HStack {
Slider(
value: $note,
in: 0...20,
step: 0.1
)
Text("\(note)")
}
Divider()
}
}
}
struct MatiereItem_Previews: PreviewProvider {
static var previews: some View {
MatiereItem()
}
}

@ -0,0 +1,37 @@
//
// UEItem.swift
// App
//
// Created by BREUIL Yohann on 24/05/2023.
//
import SwiftUI
struct UEItem: View {
@State private var note = 12.5
var body: some View {
VStack {
HStack() {
Text("UE1 Génie Logiciel")
Spacer()
Text("6")
}
HStack {
Slider(
value: $note,
in: 0...20,
step: 0.1
)
Text("\(note)")
}
Divider()
}
}
}
struct UEItem_Previews: PreviewProvider {
static var previews: some View {
UEItem()
}
}

@ -0,0 +1,71 @@
//
// UEListItem.swift
// App
//
// Created by BREUIL Yohann on 24/05/2023.
//
import SwiftUI
struct UEListItem: View {
var body: some View {
NavigationStack {
VStack(alignment: .leading) {
Label("UEs", systemImage: "doc.fill")
.font(.title)
Text("Détails des UEs")
LazyVStack {
HStack {
UEItem()
NavigationLink(destination: UEView()) {
Image(systemName: "square.and.pencil")
}
Divider()
}
.padding()
HStack {
UEItem()
NavigationLink(destination: UEView()) {
Image(systemName: "square.and.pencil")
}
Divider()
}
.padding()
HStack {
UEItem()
NavigationLink(destination: UEView()) {
Image(systemName: "square.and.pencil")
}
Divider()
}
.padding()
HStack {
UEItem()
NavigationLink(destination: UEView()) {
Image(systemName: "square.and.pencil")
}
Divider()
}
.padding()
HStack {
UEItem()
NavigationLink(destination: UEView()) {
Image(systemName: "square.and.pencil")
}
Divider()
}
.padding()
}
}
.padding()
.background(Color("ListItemBackgroundColor"))
.cornerRadius(12)
}
}
}
struct UEListItem_Previews: PreviewProvider {
static var previews: some View {
UEListItem()
}
}

@ -0,0 +1,62 @@
//
// UEView.swift
// App
//
// Created by BREUIL Yohann on 24/05/2023.
//
import SwiftUI
struct UEView: View {
var body: some View {
NavigationStack {
ScrollView {
UEItem()
VStack(alignment: .leading) {
Label("Coefficcient : 6", systemImage: "xmark.circle.fill")
Label("Détails des notes ", systemImage: "note.text")
}
LazyVStack {
HStack {
Button(action: {}) {
Image(systemName: "lock")
}
MatiereItem()
}
HStack {
Button(action: {}) {
Image(systemName: "lock")
}
MatiereItem()
}
HStack {
Button(action: {}) {
Image(systemName: "lock")
}
MatiereItem()
}
HStack {
Button(action: {}) {
Image(systemName: "lock")
}
MatiereItem()
}
}
}
.navigationTitle("UE1 Génie logiciel")
.toolbar {
Button(action: {}) {
Text("Edit")
}
}
}
}
}
struct UEView_Previews: PreviewProvider {
static var previews: some View {
UEView()
}
}

@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Workspace <Workspace
version = "1.0"> version = "1.0">
<FileRef
location = "group:Model">
</FileRef>
<FileRef <FileRef
location = "group:App/App.xcodeproj"> location = "group:App/App.xcodeproj">
</FileRef> </FileRef>

@ -0,0 +1,9 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc

@ -0,0 +1,28 @@
// swift-tools-version: 5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "Model",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "Model",
targets: ["Model"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "Model",
dependencies: []),
.testTarget(
name: "ModelTests",
dependencies: ["Model"]),
]
)

@ -0,0 +1,3 @@
# Model
A description of this package.

@ -0,0 +1,6 @@
public struct Model {
public private(set) var text = "Hello, World!"
public init() {
}
}

@ -0,0 +1,11 @@
import XCTest
@testable import Model
final class ModelTests: XCTestCase {
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.
XCTAssertEqual(Model().text, "Hello, World!")
}
}
Loading…
Cancel
Save