The configuration for changing navigationBarTitleColor, navigationBarBackgroundColor, navigationBarItemColor has been removed from ALKConfiguration.
Instead use UINavigationBar.appearance to change the navigation bar title, background and bar item color
let navigationBarProxy = UINavigationBar.appearance(whenContainedInInstancesOf: [ALKBaseNavigationViewController.self])
/// Background color
navigationBarProxy.barTintColor
= UIColor(red: 0.93, green: 0.94, blue: 0.95, alpha: 1.0)
/// Title text color
navigationBarProxy.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
navigationBarProxy.isTranslucent = false
/// Icons tint color
navigationBarProxy.tintColor = .white-
ALKConfiguration.conversationViewCustomCellTextColor, has been deprecated. Use styleALKMessageStyle.infoMessageorALKMessageStyle.dateSeparator. -
ALKConfiguration.conversationViewCustomCellBackgroundColor, has been deprecated. Use styleALKMessageStyle.infoMessageorALKMessageStyle.dateSeparator.
Use below config for changing the style for date cell or channel info messages.
For example to change the style in date separator you can config as below:
ALKMessageStyle.dateSeparator = Style(font: UIFont.systemFont(ofSize: 12), text: UIColor.black, background: .red)For example to change the style for channel info messages you can config as below:
ALKMessageStyle.infoMessage = Style(font: UIFont.systemFont(ofSize: 12), text: UIColor.black , background: .red)ALKConfiguration.navigationBarBackgroundColor, has been deprecated. UseUIAppearancefor navigation bar configuration.ALKConfiguration.navigationBarItemColor, has been deprecated. UseUIAppearancefor navigation bar configuration.ALKConfiguration.navigationBarTitleColor, has been deprecated. UseUIAppearancefor navigation bar configuration.
If you are using ALKBaseNavigationViewController to present the conversation then, you can customize it like this:
// Use `appearance(whenContainedInInstancesOf:)` method to limit the changes to instances of `ALKBaseNavigationViewController`.
let navigationBarProxy = UINavigationBar.appearance(whenContainedInInstancesOf: [ALKBaseNavigationViewController.self])
navigationBarProxy.tintColor = UIColor.blue
navigationBarProxy.barTintColor = UIColor.gray
navigationBarProxy.titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black] // title color-
ALKConfiguration.hideContactInChatBar, has been deprecated. UseALKConfiguration.chatBar.showOptionsto only show some options.config.optionsToShow = .some([.gallery, .location, .camera, .video])
-
ALKConfiguration.hideAllOptionsInChatBarhas been deprecated. UseALKConfiguration.chatBar.showOptionsto hide the all attachment options.configuration.chatBar.optionsToShow = .none
- ConversationList configuration
ALKConfiguration.rightNavBarImageForConversationListView, has been deprecated. UseALKConfiguration.navigationItemsForConversationListto add buttons in the navigation bar
// ConversationList
var navigationItemsForConversationList = [ALKNavigationItem]()
// Example for button with text
let buttonOne = ALKNavigationItem(identifier: 1234, text: "FAQ")
// Adding an item in the list
navigationItemsForConversationList.append(buttonOne)
// Example for button with icon
let buttonTwo = ALKNavigationItem(identifier:23456, icon: UIImage(named: "icon_download", in: Bundle(for: ALKConversationListViewController.self), compatibleWith: nil)!)
// Adding an item in the list
navigationItemsForConversationList.append(buttonTwo)
config.navigationItemsForConversationList = navigationItemsForConversationList
// Add an Observer to get the event callback
NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: ALKNavigationItem.NSNotificationForConversationListNavigationTap), object: nil, queue: nil, using: { notification in
guard let notificationUserInfo = notification.userInfo else { return }
let identifier = notificationUserInfo["identifier"] as! Int
print("Navigation button click for identifier in ConversationList is : ",identifier)
})- ConversationView configuration
// ConversationView
var navigationItemsForConversationView = [ALKNavigationItem]()
let buttonOne = ALKNavigationItem(identifier: 1234, text: "FAQ")
// Adding an item in the list
navigationItemsForConversationView.append(buttonOne)
// Example for button with icon
let buttonTwo = ALKNavigationItem(identifier:23456, icon: UIImage(named: "icon_download", in: Bundle(for: ALKConversationListViewController.self), compatibleWith: nil)!)
// Adding an item in the list
navigationItemsForConversationView.append(buttonOne)
config.navigationItemsForConversationView = navigationItemsForConversationView