From 2712ee8a0cf96c6169afefde4d20a0e555f12702 Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Fri, 24 Jul 2020 17:23:24 +0530 Subject: added logo, fixed BERT Q/A and added clear button for text fields --- .../AppIcon.appiconset/Contents.json | 18 ++++++++++++++++ .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 0 -> 559 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 0 -> 1231 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 0 -> 1824 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 0 -> 881 bytes .../AppIcon.appiconset/Icon-App-29x29@2x-1.png | Bin 0 -> 1776 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 0 -> 1776 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 0 -> 2726 bytes .../AppIcon.appiconset/Icon-App-40x40@1x-1.png | Bin 0 -> 1231 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 0 -> 1231 bytes .../AppIcon.appiconset/Icon-App-40x40@2x-1.png | Bin 0 -> 2444 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 0 -> 2444 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 0 -> 3671 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 0 -> 3671 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 0 -> 5800 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 0 -> 2328 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 0 -> 4692 bytes .../AppIcon.appiconset/Icon-App-83.5x83.5@2x.png | Bin 0 -> 5267 bytes .../Assets.xcassets/AppIcon.appiconset/Qrious.png | Bin 0 -> 21408 bytes Qrious/ContentView.swift | 24 +++++++++++++++++++-- Qrious/DetailedView.swift | 2 +- 21 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x-1.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png create mode 100644 Qrious/Assets.xcassets/AppIcon.appiconset/Qrious.png diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Contents.json b/Qrious/Assets.xcassets/AppIcon.appiconset/Contents.json index 9221b9b..8a8b2f9 100644 --- a/Qrious/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Qrious/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,91 +1,109 @@ { "images" : [ { + "filename" : "Icon-App-20x20@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "20x20" }, { + "filename" : "Icon-App-20x20@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "20x20" }, { + "filename" : "Icon-App-29x29@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "29x29" }, { + "filename" : "Icon-App-29x29@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "29x29" }, { + "filename" : "Icon-App-40x40@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "40x40" }, { + "filename" : "Icon-App-40x40@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "40x40" }, { + "filename" : "Icon-App-60x60@2x.png", "idiom" : "iphone", "scale" : "2x", "size" : "60x60" }, { + "filename" : "Icon-App-60x60@3x.png", "idiom" : "iphone", "scale" : "3x", "size" : "60x60" }, { + "filename" : "Icon-App-20x20@1x.png", "idiom" : "ipad", "scale" : "1x", "size" : "20x20" }, { + "filename" : "Icon-App-40x40@1x.png", "idiom" : "ipad", "scale" : "2x", "size" : "20x20" }, { + "filename" : "Icon-App-29x29@1x.png", "idiom" : "ipad", "scale" : "1x", "size" : "29x29" }, { + "filename" : "Icon-App-29x29@2x-1.png", "idiom" : "ipad", "scale" : "2x", "size" : "29x29" }, { + "filename" : "Icon-App-40x40@1x-1.png", "idiom" : "ipad", "scale" : "1x", "size" : "40x40" }, { + "filename" : "Icon-App-40x40@2x-1.png", "idiom" : "ipad", "scale" : "2x", "size" : "40x40" }, { + "filename" : "Icon-App-76x76@1x.png", "idiom" : "ipad", "scale" : "1x", "size" : "76x76" }, { + "filename" : "Icon-App-76x76@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "76x76" }, { + "filename" : "Icon-App-83.5x83.5@2x.png", "idiom" : "ipad", "scale" : "2x", "size" : "83.5x83.5" }, { + "filename" : "Qrious.png", "idiom" : "ios-marketing", "scale" : "1x", "size" : "1024x1024" diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 0000000..2f925fc Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000..f1c205b Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000..b03a82b Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000..5681b84 Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png new file mode 100644 index 0000000..8eafeb0 Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x-1.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000..8eafeb0 Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 0000000..c3912fe Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x-1.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x-1.png new file mode 100644 index 0000000..f1c205b Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x-1.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 0000000..f1c205b Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png new file mode 100644 index 0000000..5546f5a Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x-1.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000..5546f5a Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 0000000..670f6c5 Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000..670f6c5 Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000..a447ee4 Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 0000000..8241ba9 Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 0000000..296d0ed Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000..fbfdf07 Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/Qrious/Assets.xcassets/AppIcon.appiconset/Qrious.png b/Qrious/Assets.xcassets/AppIcon.appiconset/Qrious.png new file mode 100644 index 0000000..fee6c99 Binary files /dev/null and b/Qrious/Assets.xcassets/AppIcon.appiconset/Qrious.png differ diff --git a/Qrious/ContentView.swift b/Qrious/ContentView.swift index 2af0f96..87c7eb2 100644 --- a/Qrious/ContentView.swift +++ b/Qrious/ContentView.swift @@ -81,6 +81,25 @@ extension UIApplication { } } +struct ClearButton: ViewModifier +{ + @Binding var text: String + public func body(content: Content) -> some View{ + ZStack(alignment: .trailing){ + content + if !text.isEmpty{ + Button(action:{ + self.text = "" + }){ + Image(systemName: "delete.left") + .foregroundColor(Color(UIColor.opaqueSeparator)) + } + .padding(.trailing, 8) + } + } + } +} + class configuration: ObservableObject { @Published var question: String = "Results show what are the compounds?" } @@ -114,7 +133,7 @@ struct ContentView: View { Form{ Section(header: Text("Search Query")){ - TextField("Search Query",text: $query) + TextField("Search Query",text: $query).modifier(ClearButton(text: $query)) } @@ -123,6 +142,7 @@ struct ContentView: View { HStack{ Text("No. Of Articles:") TextField("No. Of Articles", text: $noOfArticles) + .modifier(ClearButton(text: $noOfArticles)) .keyboardType(.numberPad) }.disabled(!advance) HStack{ @@ -134,7 +154,7 @@ struct ContentView: View { } Section(header: Text("Query for AI Model")){ - TextField("",text: $ques, onEditingChanged: {_ in self.config.question = self.ques}) + TextField("",text: $ques, onEditingChanged: {_ in self.config.question = self.ques}).modifier(ClearButton(text: $ques)) } diff --git a/Qrious/DetailedView.swift b/Qrious/DetailedView.swift index ee08bf0..d8fd751 100644 --- a/Qrious/DetailedView.swift +++ b/Qrious/DetailedView.swift @@ -53,7 +53,7 @@ struct DetailedView: View { self.description1 = decodedData["description"].string! self.paperURL = decodedData["figshare_url"].string! print("Finding Answer") - self.candidates = String(BERT().findAnswer(for: configuration().question, in: self.description1)) + self.candidates = String(BERT().findAnswer(for: self.config.question, in: self.description1)) //return decodedData } -- cgit v1.2.3