Skip to content

Commit

Permalink
UI changes and added app icon
Browse files Browse the repository at this point in the history
  • Loading branch information
benlellouch committed May 5, 2023
1 parent c32b8d3 commit dd8201c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
12 changes: 8 additions & 4 deletions Kitchen Converter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -424,11 +424,13 @@
DEVELOPMENT_TEAM = NCSMBFF244;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_CFBundleDisplayName = Convert;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -454,11 +456,13 @@
DEVELOPMENT_TEAM = NCSMBFF244;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_CFBundleDisplayName = Convert;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations = UIInterfaceOrientationPortrait;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"images" : [
{
"filename" : "DALL·E 2023-05-05 01.52.41 - An app icon for an application which is used to convert various units used in cooking, designed by google, 1024x1024 pixels.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 20 additions & 6 deletions Kitchen Converter/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct ContentView: View {
@State private var from: Unit = units[0]
@State private var to: Unit = units[1]
@State private var input: String = "0"
@FocusState private var inputFocus: Bool
private var output: Double {
return ((ContentView.conversions[from.symbol]?[to.symbol] ?? {x in 0})(Double(input) ?? 0))
}
Expand All @@ -74,8 +75,15 @@ struct ContentView: View {

var body: some View {
VStack {
Text("Unit Converter")
.font(.title)
VStack{
Text("Unit Converter")
.font(.largeTitle)
.fontWeight(.black)
Text("Kitchen Essentials")
.font(.title3)
.fontWeight(.semibold)
}

Spacer()
VStack{

Expand All @@ -89,7 +97,7 @@ struct ContentView: View {
Text(unit.symbol).tag(unit)
}

}.onChange(of: from, perform: {value in if (from.type != to.type || from.name == to.name ) {to = filteredUnits[0] }}).frame(width: 80)
}.onChange(of: from, perform: {value in if (from.type != to.type || from.name == to.name ) {to = filteredUnits[0] }}).frame(width: 80).pickerStyle(.inline)

Text("➡️")
Text("To")
Expand All @@ -98,10 +106,14 @@ struct ContentView: View {
ForEach(filteredUnits){ unit in
Text(unit.symbol).tag(unit)
}
}.frame(width: 80)
}.frame(width: 80).pickerStyle(.inline)
}.padding()
HStack {
TextField("", text: $input).numbersOnly($input, includeDecimal: true).textFieldStyle(.roundedBorder).frame(minWidth: 50,idealWidth: 50,maxWidth:70)
TextField("", text: $input).numbersOnly($input, includeDecimal: true)
.textFieldStyle(.roundedBorder)
.frame(minWidth: 50,idealWidth: 50,maxWidth:70)
.focused($inputFocus)

Text("\(from.symbol)")
.font(.headline)

Expand All @@ -118,10 +130,12 @@ struct ContentView: View {
}
}.padding()
Spacer()
VStack{Text("Made with ♥️ for Mamou")}.frame(alignment: .bottom)
Spacer()
VStack{Text("Made with ♥️ for Mamou").font(.footnote)}.frame(alignment: .bottom)

}
.padding()
.onTapGesture(perform: {inputFocus = false})
}

}
Expand Down

0 comments on commit dd8201c

Please sign in to comment.