Skip to content

Commit

Permalink
Add a workaround for swiftui bug preventing menu button from being pr…
Browse files Browse the repository at this point in the history
…essed twice before re-rendering; update supported canteens
  • Loading branch information
TheJKM committed Jan 14, 2020
1 parent 066e529 commit 5b1227f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
8 changes: 4 additions & 4 deletions MensaGuthaben.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@
CODE_SIGN_ENTITLEMENTS = MensaGuthaben/MensaGuthaben.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1.1.113;
CURRENT_PROJECT_VERSION = 1.1.132;
DEVELOPMENT_ASSET_PATHS = "\"MensaGuthaben/Preview Content\"";
DEVELOPMENT_TEAM = EBQF48FD36;
ENABLE_PREVIEWS = YES;
Expand All @@ -516,7 +516,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.5;
MARKETING_VERSION = 1.1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.johanneskreutz.mensaguthaben;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "MensaGuthaben 20.11.19";
Expand All @@ -533,7 +533,7 @@
CODE_SIGN_ENTITLEMENTS = MensaGuthaben/MensaGuthaben.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1.1.113;
CURRENT_PROJECT_VERSION = 1.1.132;
DEVELOPMENT_ASSET_PATHS = "\"MensaGuthaben/Preview Content\"";
DEVELOPMENT_TEAM = EBQF48FD36;
ENABLE_PREVIEWS = YES;
Expand All @@ -547,7 +547,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.5;
MARKETING_VERSION = 1.1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.johanneskreutz.mensaguthaben;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "MensaGuthaben 20.11.19";
Expand Down
3 changes: 1 addition & 2 deletions MensaGuthaben/Views/Helpers/ChartsContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// MensaGuthaben
//
// Created by Johannes Kreutz on 24.09.19.
// Copyright © 2019 Johannes Kreutz. All rights reserved.
// Copyright © 2019 - 2020 Johannes Kreutz. All rights reserved.
//
// This file is part of MensaGuthaben.
//
Expand Down Expand Up @@ -47,7 +47,6 @@ struct ChartsContainer: UIViewRepresentable {
}

func updateUIView(_ uiView: LineChartView, context: UIViewRepresentableContext<ChartsContainer>) {
print("Update")
setupChartData(chart: uiView)
}

Expand Down
5 changes: 3 additions & 2 deletions MensaGuthaben/Views/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import SwiftUI

struct MainView: View {
@State private var showSettingsModal: Bool = false
@State private var buttonText: String = ""
@EnvironmentObject var balance: Balance
@EnvironmentObject var settings: SettingsStore
@EnvironmentObject var historyData: HistoryData
Expand Down Expand Up @@ -69,15 +70,15 @@ struct MainView: View {
)
}.padding(.leading, 2).padding(.trailing, 2)
}

}.padding()
}
.navigationBarTitle("MensaGuthaben")
.navigationBarItems(trailing: Button(action: {
self.showSettingsModal = true
}) {
Image(systemName: "line.horizontal.3")
}).sheet(isPresented: $showSettingsModal, onDismiss: {self.showSettingsModal = false}, content: {
Text(self.buttonText)
}).sheet(isPresented: $showSettingsModal, onDismiss: {self.showSettingsModal = false; self.buttonText = (self.buttonText == "") ? " " : ""}, content: {
SettingsView(sceneDelegate: self.sceneDelegate).environmentObject(self.settings)
})
}
Expand Down
4 changes: 2 additions & 2 deletions MensaGuthaben/Views/SupportedCanteensView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import SwiftUI

struct SupportedCanteensView: View {
let supported: [String] = ["HS Aschaffenburg", "Uni Bamberg", "Uni Bochum", "TU Braunschweig", "TU Darmstadt", "h_da Darmstadt", "TU Dresden Emeal", "Westfälische Hochschule Gelsenkirchen", "Uni Gießen", "TU Ilmenau", "Uni Saarland", "Uni Ulm", "FH Würzburg", "Uni Würzburg"]
let untested: [String] = ["Uni Bayreuth (nur Druckguthaben)", "Uni Bielefeld (nur neuere Karten)", "FH Brandenburg", "Uni Bremen", "HS Bremerhaven", "TU Clausthal", "HS Freiburg", "DH Gera Eisenbach", "Uni Greifswald", "MLU Halle", "HAW Hamburg", "HS Hannover", "Uni Heidelberg", "Uni Hohenheim (nur neuere Karten)", "HS Koblenz", "Uni Koblenz", "FH Köln", "Uni Köln", "Uni Leipzig", "Uni Lüneburg", "Uni Magdeburg", "DHBW Mosbach", "HS Offenburg", "Uni Osnabrück", "HS Osnabrück", "HS für Gestaltung Schwäbisch Gmünd", "Uni Stuttgart", "HS Zittau/Görlitz"]
let supported: [String] = ["HS Aschaffenburg", "Uni Bamberg", "Uni Bochum", "TU Braunschweig", "TU Darmstadt", "h_da Darmstadt", "TU Dresden Emeal", "Westfälische Hochschule Gelsenkirchen", "Uni Gießen", "Uni Hannover", "HS Hannover", "TU Ilmenau", "Uni Saarland", "Uni Ulm", "FH Würzburg", "Uni Würzburg"]
let untested: [String] = ["Uni Bayreuth (nur Druckguthaben)", "Uni Bielefeld (nur neuere Karten)", "FH Brandenburg", "Uni Bremen", "HS Bremerhaven", "TU Clausthal", "HS Freiburg", "DH Gera Eisenbach", "Uni Greifswald", "MLU Halle", "HAW Hamburg", "Uni Heidelberg", "Uni Hohenheim (nur neuere Karten)", "HS Koblenz", "Uni Koblenz", "FH Köln", "Uni Köln", "Uni Leipzig", "Uni Lüneburg", "Uni Magdeburg", "DHBW Mosbach", "HS Offenburg", "Uni Osnabrück", "HS Osnabrück", "HS für Gestaltung Schwäbisch Gmünd", "Uni Stuttgart", "HS Zittau/Görlitz"]

private func getSupported() -> String {
var supportedString: String = ""
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The app is tested with the following universities:
- TU Dresden Emeal
- Westfälische Hochschule Gelsenkirchen
- Uni Gießen
- Uni Hannover
- HS Hannover
- TU Ilmenau
- Uni Saarland
- Uni Ulm
Expand All @@ -36,7 +38,6 @@ However, it should also work with the cards of these universities, but they are
- Uni Greifswald
- MLU Halle
- HAW Hamburg
- HS Hannover
- Uni Heidelberg
- Uni Hohenheim (only newer cards)
- HS Koblenz
Expand Down

0 comments on commit 5b1227f

Please sign in to comment.