Skip to content

Commit 4f862de

Browse files
committed
Format files
1 parent 8994907 commit 4f862de

41 files changed

Lines changed: 581 additions & 657 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/Examples/SwiftUI/MinimalSupportDocs.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
// Created by H. Kamran on 11/11/20.
66
//
77

8-
import SwiftUI
98
import SupportDocs
9+
import SwiftUI
1010

1111
struct MinimalSupportDocs: View {
1212
let dataSource = URL(string: "https://raw.githubusercontent.com/aheze/SupportDocs/DataSource/_data/supportdocs_datasource.json")!
1313

1414
@State var supportDocsPresented: Bool = false
1515
var body: some View {
1616
Button("Present SupportDocs from SwiftUI!") { supportDocsPresented = true }
17-
.sheet(isPresented: $supportDocsPresented, content: {
18-
SupportDocsView(dataSource: dataSource, isPresented: $supportDocsPresented)
19-
})
17+
.sheet(isPresented: $supportDocsPresented, content: {
18+
SupportDocsView(dataSource: dataSource, isPresented: $supportDocsPresented)
19+
})
2020
}
2121
}

Documentation/Examples/SwiftUI/SupportDocsWithCategories.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Created by H. Kamran on 11/11/20.
66
//
77

8-
import SwiftUI
98
import SupportDocs
9+
import SwiftUI
1010

1111
struct SupportDocsWithCategories: View {
1212
let dataSource = URL(string: "https://raw.githubusercontent.com/aheze/SupportDocs/DataSource/_data/supportdocs_datasource.json")!
@@ -21,15 +21,15 @@ struct SupportDocsWithCategories: View {
2121
tags: ["fastFood"],
2222
displayName: "These aren't really healthy",
2323
displayColor: UIColor.red
24-
)
24+
),
2525
]
2626
)
2727

2828
@State var supportDocsPresented: Bool = false
2929
var body: some View {
3030
Button("Present SupportDocs from SwiftUI!") { supportDocsPresented = true }
31-
.sheet(isPresented: $supportDocsPresented, content: {
32-
SupportDocsView(dataSource: dataSource, options: options)
33-
})
31+
.sheet(isPresented: $supportDocsPresented, content: {
32+
SupportDocsView(dataSource: dataSource, options: options)
33+
})
3434
}
3535
}

Documentation/Examples/SwiftUI/SupportOptions.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
// Created by H. Kamran on 11/11/20.
66
//
77

8-
import SwiftUI
98
import SupportDocs
9+
import SwiftUI
1010

1111
struct SupportOptionsExample: View {
1212
let dataSource = URL(string: "https://raw.githubusercontent.com/aheze/SupportDocs/DataSource/_data/supportdocs_datasource.json")!
1313
let options = SupportOptions(
1414
categories: [
15-
.init(tags: ["boba"], displayName: "Boba is awesome!")
15+
.init(tags: ["boba"], displayName: "Boba is awesome!"),
1616
],
1717
navigationBar: .init(
1818
title: "Support",

Documentation/Examples/UIKit/MinimalSupportDocs.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
// Created by H. Kamran on 11/11/20.
66
//
77

8-
import UIKit
98
import SupportDocs
9+
import UIKit
1010

1111
class MinimalSupportDocs: UIViewController {
1212
/**
1313
Connect this inside the storyboard.
14-
14+
1515
This is just for demo purposes, so it's not connected yet.
1616
*/
17-
@IBAction func presentButtonPressed(_ sender: Any) {
17+
@IBAction func presentButtonPressed(_: Any) {
1818
let dataSource = URL(string: "https://raw.githubusercontent.com/aheze/SupportDocs/DataSource/_data/supportdocs_datasource.json")!
1919

2020
let supportDocsViewController = SupportDocsViewController(dataSource: dataSource)
21-
self.present(supportDocsViewController, animated: true, completion: nil)
21+
present(supportDocsViewController, animated: true, completion: nil)
2222
}
2323
}

Documentation/Examples/UIKit/SupportDocsWithCategories.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
// Created by H. Kamran on 11/11/20.
66
//
77

8-
import UIKit
9-
import SwiftUI
108
import SupportDocs
9+
import SwiftUI
10+
import UIKit
1111

1212
class SupportDocsWithCategories: UIViewController {
1313
/**
1414
Connect this inside the storyboard.
1515

1616
This is just for demo purposes, so it's not connected yet.
1717
*/
18-
@IBAction func presentButtonPressed(_ sender: Any) {
18+
@IBAction func presentButtonPressed(_: Any) {
1919
let dataSource = URL(string: "https://raw.githubusercontent.com/aheze/SupportDocs/DataSource/_data/supportdocs_datasource.json")!
2020

2121
var options = SupportOptions()
@@ -33,6 +33,6 @@ class SupportDocsWithCategories: UIViewController {
3333
options.categories = [bobaCategory, fastFoodCategory]
3434

3535
let supportDocsViewController = SupportDocsViewController(dataSource: dataSource, options: options)
36-
self.present(supportDocsViewController, animated: true, completion: nil)
36+
present(supportDocsViewController, animated: true, completion: nil)
3737
}
3838
}

Documentation/Examples/UIKit/SupportOptions.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
// Created by H. Kamran on 11/11/20.
66
//
77

8-
import UIKit
9-
import SwiftUI
108
import SupportDocs
9+
import SwiftUI
10+
import UIKit
1111

1212
class SupportOptionsExample: UIViewController {
13-
@IBOutlet weak var presentButton: UIButton!
14-
@IBAction func presentButtonPressed(_ sender: Any) {
13+
@IBOutlet var presentButton: UIButton!
14+
@IBAction func presentButtonPressed(_: Any) {
1515
let dataSource = URL(string: "https://raw.githubusercontent.com/aheze/SupportDocs/DataSource/_data/supportdocs_datasource.json")!
1616

1717
// MARK: - UIKit way to make `SupportOptions`
18+
1819
var options = SupportOptions()
1920
options.categories = [SupportOptions.Category(tags: ["boba"], displayName: "Boba is awesome!")]
2021
options.navigationBar.title = "Support"
@@ -31,6 +32,6 @@ class SupportOptionsExample: UIViewController {
3132
options.other.error404 = URL(string: "https://aheze.github.io/SupportDocs/404")!
3233

3334
let supportDocsViewController = SupportDocsViewController(dataSource: dataSource, options: options)
34-
self.present(supportDocsViewController, animated: true, completion: nil)
35+
present(supportDocsViewController, animated: true, completion: nil)
3536
}
3637
}

Example/Example/AppDelegate.swift

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,22 @@ import UIKit
99

1010
@main
1111
class AppDelegate: UIResponder, UIApplicationDelegate {
12-
13-
14-
15-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
12+
func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
1613
// Override point for customization after application launch.
1714
return true
1815
}
1916

2017
// MARK: UISceneSession Lifecycle
2118

22-
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
19+
func application(_: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options _: UIScene.ConnectionOptions) -> UISceneConfiguration {
2320
// Called when a new scene session is being created.
2421
// Use this method to select a configuration to create the new scene with.
2522
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
2623
}
2724

28-
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
25+
func application(_: UIApplication, didDiscardSceneSessions _: Set<UISceneSession>) {
2926
// Called when the user discards a scene session.
3027
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
3128
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
3229
}
33-
34-
3530
}
36-

Example/Example/Footer.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ import SwiftUI
1010
struct Footer: View {
1111
var body: some View {
1212
Button(action: {
13-
let urlToOpen = URL.init(string: "https://www.apple.com")!
13+
let urlToOpen = URL(string: "https://www.apple.com")!
1414
if UIApplication.shared.canOpenURL(urlToOpen) {
1515
UIApplication.shared.open(urlToOpen)
1616
}
1717
}) {
1818
(
1919
Text("Didn't find what you were looking for? Contact us at our ")
2020
+
21-
Text("website")
22-
.underline()
23-
.foregroundColor(Color.blue)
21+
Text("website")
22+
.underline()
23+
.foregroundColor(Color.blue)
2424
+
25-
Text("!")
25+
Text("!")
2626
)
2727
.frame(maxWidth: .infinity, alignment: .leading)
2828
.font(Font.system(size: 16, weight: .regular))

Example/Example/PlaygroundsView/PlaygroundsView.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,37 @@
88
import SwiftUI
99

1010
struct PlaygroundsView: View {
11-
1211
@State var dataSourceURL = ""
1312
var body: some View {
1413
ZStack {
1514
Color(UIColor.secondarySystemBackground)
1615
VStack {
17-
1816
VStack(alignment: .leading) {
1917
Text("Data Source")
2018
.foregroundColor(Color.secondary)
2119
.padding(EdgeInsets(top: 16, leading: 20, bottom: 0, trailing: 20))
22-
20+
2321
TextField("Data", text: $dataSourceURL)
2422
.textFieldStyle(RoundedBorderTextFieldStyle())
2523
.padding()
2624
.background(Color.white)
2725
.cornerRadius(12)
2826
.padding(EdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16))
2927
}
30-
28+
3129
VStack(alignment: .leading) {
3230
Text("Categories")
3331
.foregroundColor(Color.secondary)
3432
.padding(EdgeInsets(top: 16, leading: 20, bottom: 0, trailing: 20))
35-
33+
3634
Text("Nil (Display all documents)")
3735
.foregroundColor(Color.secondary)
3836
.padding()
3937
.frame(maxWidth: .infinity, alignment: .leading)
4038
.background(Color.white)
4139
.cornerRadius(12)
4240
.padding(EdgeInsets(top: 0, leading: 16, bottom: 0, trailing: 16))
43-
4441
}
45-
4642
}
4743
}
4844
}

0 commit comments

Comments
 (0)