Skip to content

Commit a48f720

Browse files
fix: providing tint color to category views
1 parent f414bf4 commit a48f720

1 file changed

Lines changed: 6 additions & 14 deletions

File tree

Sources/EmojiPicker/Views/EmojiPickerView.swift

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// The MIT License (MIT)
2-
// Copyright © 2022 Egor Badmaev
2+
// Copyright © 2022 Ivan Izyumkin
33
//
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files (the "Software"), to deal
@@ -76,21 +76,12 @@ final class EmojiPickerView: UIView {
7676
return bounds.width * 0.13
7777
}
7878

79-
// MARK: - Init
80-
81-
init() {
82-
super.init(frame: .zero)
83-
84-
setupCategoryViews()
85-
}
86-
87-
required init?(coder: NSCoder) {
88-
fatalError("init(coder:) has not been implemented")
89-
}
79+
// MARK: - Override
9080

9181
override func draw(_ rect: CGRect) {
9282
super.draw(rect)
9383

84+
setupCategoryViews()
9485
setupView()
9586
}
9687

@@ -137,14 +128,15 @@ final class EmojiPickerView: UIView {
137128
categoryIndex: categoryIndex,
138129
selectedEmojiCategoryTintColor: selectedEmojiCategoryTintColor
139130
)
140-
// Installing selected state for first categoryView
131+
132+
/// We need to set _selected_ state for the first category (default at the start).
141133
categoryView.updateCategoryViewState(selectedCategoryIndex: 0)
142134
categoryViews.append(categoryView)
143135
categoriesStackView.addArrangedSubview(categoryView)
144136
}
145137
}
146138

147-
/// Scrolls collectionView to header for selected category.
139+
/// Scrolls collection view to the header of selected category.
148140
///
149141
/// - Parameter section: Selected category index.
150142
private func scrollToHeader(for section: Int) {

0 commit comments

Comments
 (0)