It's been so long I don't even know what I changed. Removed the contacts tab completely, before it was still in the app just not accessible. Switched over from RichTextView to iosMath saving about 4MB. Couple small design tweaks. Reduced total app size from 10MB to 4.5

This commit is contained in:
Isaac Greene 2023-06-06 10:42:22 -04:00
parent 0dc0267dbd
commit 099728c760
17 changed files with 222 additions and 395 deletions

View file

@ -6,7 +6,6 @@
//
import SwiftUI
import RichTextView
struct HelpView: View {
@State var mathSheet = false
@ -26,6 +25,10 @@ struct HelpView: View {
Button("See our math", action: {
self.mathSheet.toggle()
})
.frame(width: 130, height: 40, alignment: .center)
.background(.tertiary)
.foregroundColor(.primary)
.cornerRadius(12)
.padding(30)
.sheet(isPresented: self.$mathSheet, content: {
algorithmView()
@ -65,39 +68,11 @@ struct algorithmView: View {
}
struct mathView: View {
@State var mathString:String = "[math] \\frac{t}{d} &= p [/math]"
var body: some View {
mathLaTeX_inator(mathString: $mathString)
.padding(30)
.frame(maxHeight: 300)
HStack {
Spacer()
MathView(latex: "\\frac{t}{d} = p")
.frame(width: 200, height: 50)
}
}
}
struct mathLaTeX_inator: UIViewRepresentable {
@Environment(\.colorScheme) var colorScheme
@Binding var mathString:String
func makeUIView(context: Context) -> RichTextView {
let richTextView = RichTextView(
input: mathString,
latexParser: LatexParser(),
font: UIFont.systemFont(ofSize: UIFont.systemFontSize),
textColor: (colorScheme == .dark ? UIColor.white : UIColor.black),
frame: CGRect.zero,
completion: nil
)
return richTextView
}
func updateUIView(_ uiView: RichTextView, context: Context) {
uiView.update(
input: mathString,
latexParser: LatexParser(),
font: UIFont.systemFont(ofSize: UIFont.systemFontSize),
textColor: (colorScheme == .dark ? UIColor.white : UIColor.black),
completion: nil
)
}
}