Skip to content

Commit d41e61c

Browse files
fixed code formatting issues in the demo app
1 parent 8bd58ae commit d41e61c

File tree

2 files changed

+38
-40
lines changed

2 files changed

+38
-40
lines changed

DemoAppSwiftUI/AppDelegate.swift

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,75 +4,77 @@
44

55
import StreamChat
66
import StreamChatSwiftUI
7-
import UIKit
87
import SwiftUI
8+
import UIKit
99

1010
class AppDelegate: NSObject, UIApplicationDelegate {
1111

1212
var streamChat: StreamChat?
1313

1414
var chatClient: ChatClient = {
1515
var config = ChatClientConfig(apiKey: .init(apiKeyString))
16-
//config.isLocalStorageEnabled = true
16+
// config.isLocalStorageEnabled = true
1717
config.applicationGroupIdentifier = applicationGroupIdentifier
18-
18+
1919
let client = ChatClient(config: config)
2020
return client
2121
}()
2222

23-
func application(_ application: UIApplication,
24-
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
23+
func application(
24+
_ application: UIApplication,
25+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
26+
) -> Bool {
2527
/*
26-
//Customizations, uncomment to customize.
27-
var colors = ColorPalette()
28-
colors.tintColor = Color(.streamBlue)
29-
30-
var fonts = Fonts()
31-
fonts.footnoteBold = Font.footnote
32-
33-
let images = Images()
34-
images.reactionLoveBig = UIImage(systemName: "heart.fill")!
35-
36-
let appearance = Appearance(colors: colors, images: images, fonts: fonts)
37-
38-
let channelNamer: ChatChannelNamer = { channel, currentUserId in
39-
"This is our custom name: \(channel.name ?? "no name")"
40-
}
41-
let utils = Utils(channelNamer: channelNamer)
28+
//Customizations, uncomment to customize.
29+
var colors = ColorPalette()
30+
colors.tintColor = Color(.streamBlue)
4231

43-
streamChat = StreamChat(chatClient: chatClient, appearance: appearance, utils: utils)
44-
45-
*/
32+
var fonts = Fonts()
33+
fonts.footnoteBold = Font.footnote
34+
35+
let images = Images()
36+
images.reactionLoveBig = UIImage(systemName: "heart.fill")!
37+
38+
let appearance = Appearance(colors: colors, images: images, fonts: fonts)
39+
40+
let channelNamer: ChatChannelNamer = { channel, currentUserId in
41+
"This is our custom name: \(channel.name ?? "no name")"
42+
}
43+
let utils = Utils(channelNamer: channelNamer)
44+
45+
streamChat = StreamChat(chatClient: chatClient, appearance: appearance, utils: utils)
46+
47+
*/
4648

4749
/*
48-
let messageTypeResolver = CustomMessageTypeResolver()
49-
let utils = Utils(messageTypeResolver: messageTypeResolver)
50+
let messageTypeResolver = CustomMessageTypeResolver()
51+
let utils = Utils(messageTypeResolver: messageTypeResolver)
5052

51-
streamChat = StreamChat(chatClient: chatClient, utils: utils)
52-
*/
53+
streamChat = StreamChat(chatClient: chatClient, utils: utils)
54+
*/
5355

5456
streamChat = StreamChat(chatClient: chatClient)
5557

5658
DispatchQueue.main.asyncAfter(deadline: .now() + 2.5) {
5759
withAnimation {
5860
AppState.shared.userState = .notLoggedIn
59-
}
61+
}
6062
}
6163

6264
return true
6365
}
6466

65-
func application(_ application: UIApplication,
66-
configurationForConnecting connectingSceneSession: UISceneSession,
67-
options: UIScene.ConnectionOptions) -> UISceneConfiguration {
67+
func application(
68+
_ application: UIApplication,
69+
configurationForConnecting connectingSceneSession: UISceneSession,
70+
options: UIScene.ConnectionOptions
71+
) -> UISceneConfiguration {
6872
let sceneConfig = UISceneConfiguration(name: nil, sessionRole: connectingSceneSession.role)
6973
sceneConfig.delegateClass = SceneDelegate.self
7074
return sceneConfig
7175
}
72-
7376
}
7477

7578
extension UIColor {
7679
static let streamBlue = UIColor(red: 0, green: 108.0 / 255.0, blue: 255.0 / 255.0, alpha: 1)
7780
}
78-

DemoAppSwiftUI/GroupNameView.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//
2-
// Copyright © 2021 Stream.io Inc. All rights reserved.
2+
// Copyright © 2021 Stream.io Inc. All rights reserved.
33
//
44

5-
import SwiftUI
65
import StreamChatSwiftUI
6+
import SwiftUI
77

88
struct GroupNameView: View, KeyboardReadable {
99

@@ -60,7 +60,6 @@ struct GroupNameView: View, KeyboardReadable {
6060
}
6161
}
6262
.listStyle(.plain)
63-
6463
}
6564
.navigationTitle("Name of Group Chat")
6665
.alert(isPresented: $viewModel.errorShown) {
@@ -71,7 +70,6 @@ struct GroupNameView: View, KeyboardReadable {
7170
}
7271
.modifier(HideKeyboardOnTapGesture(shouldAdd: keyboardShown))
7372
}
74-
7573
}
7674

7775
struct GroupControlsView: View {
@@ -121,8 +119,6 @@ struct GroupControlsView: View {
121119
EmptyView()
122120
}
123121
.isDetailLink(false)
124-
125122
}
126123
}
127-
128124
}

0 commit comments

Comments
 (0)