Skip to content

Commit 1a0025b

Browse files
refactor: made minor updates in code and comments
1 parent c8d75ff commit 1a0025b

11 files changed

Lines changed: 61 additions & 35 deletions

File tree

EmojiPicker.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'EmojiPicker'
3-
s.version = '2.1.1'
3+
s.version = '2.1.2'
44
s.license = 'MIT'
55
s.summary = 'Emoji picker for iOS like on MacOS'
66
s.homepage = 'https://github.com/htmlprogrammist/EmojiPicker'

EmojiPicker.xcodeproj/project.pbxproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
F011B17E297202540088F3FA /* CODE_OF_CONDUCT.md in Resources */ = {isa = PBXBuildFile; fileRef = F011B17C297202540088F3FA /* CODE_OF_CONDUCT.md */; };
11+
F011B17F297202540088F3FA /* CONTRIBUTING.md in Resources */ = {isa = PBXBuildFile; fileRef = F011B17D297202540088F3FA /* CONTRIBUTING.md */; };
1012
F0A434F42971A0C200663826 /* EmojiPickerViewModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0A434F32971A0C200663826 /* EmojiPickerViewModelTests.swift */; };
1113
F0A434F82971A0DC00663826 /* UnicodeManagerStub.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0A434F62971A0DB00663826 /* UnicodeManagerStub.swift */; };
1214
F0A434FA2971A3B900663826 /* ArrayExtensionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0A434F92971A3B900663826 /* ArrayExtensionTests.swift */; };
@@ -57,6 +59,8 @@
5759
/* End PBXContainerItemProxy section */
5860

5961
/* Begin PBXFileReference section */
62+
F011B17C297202540088F3FA /* CODE_OF_CONDUCT.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CODE_OF_CONDUCT.md; sourceTree = "<group>"; };
63+
F011B17D297202540088F3FA /* CONTRIBUTING.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = CONTRIBUTING.md; sourceTree = "<group>"; };
6064
F0A434F32971A0C200663826 /* EmojiPickerViewModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmojiPickerViewModelTests.swift; sourceTree = "<group>"; };
6165
F0A434F62971A0DB00663826 /* UnicodeManagerStub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UnicodeManagerStub.swift; sourceTree = "<group>"; };
6266
F0A434F92971A3B900663826 /* ArrayExtensionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayExtensionTests.swift; sourceTree = "<group>"; };
@@ -139,6 +143,8 @@
139143
F0BB7EC6297157D3004EEBFC /* Tests */,
140144
F0BB7ED9297158BC004EEBFC /* EmojiPicker.podspec */,
141145
F0BB7F34297169E4004EEBFC /* LICENSE */,
146+
F011B17C297202540088F3FA /* CODE_OF_CONDUCT.md */,
147+
F011B17D297202540088F3FA /* CONTRIBUTING.md */,
142148
F0BB7EBB297157D3004EEBFC /* Products */,
143149
);
144150
sourceTree = "<group>";
@@ -377,6 +383,7 @@
377383
};
378384
F0BB7EC1297157D3004EEBFC = {
379385
CreatedOnToolsVersion = 13.4.1;
386+
LastSwiftMigration = 1340;
380387
};
381388
};
382389
};
@@ -411,7 +418,9 @@
411418
files = (
412419
F0BB7ED829715831004EEBFC /* README.md in Resources */,
413420
F0BB7F18297159A6004EEBFC /* Localizable.strings in Resources */,
421+
F011B17F297202540088F3FA /* CONTRIBUTING.md in Resources */,
414422
F0BB7F35297169E5004EEBFC /* LICENSE in Resources */,
423+
F011B17E297202540088F3FA /* CODE_OF_CONDUCT.md in Resources */,
415424
F0BB7EDB297158BD004EEBFC /* EmojiPicker.podspec in Resources */,
416425
);
417426
runOnlyForDeploymentPostprocessing = 0;

Example App/AppImport/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ let package = Package(
1111
targets: ["AppImport"]),
1212
],
1313
dependencies: [
14-
.package(url: "https://github.com/htmlprogrammist/EmojiPicker", .upToNextMajor(from: "2.1.1"))
14+
.package(url: "https://github.com/htmlprogrammist/EmojiPicker", .upToNextMajor(from: "2.1.2"))
1515
],
1616
targets: [
1717
.target(

Example App/iOS Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/EmojiPicker/ViewModel/EmojiPickerViewModel.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import Foundation
2323

24-
/// Protocol for the ViewModel which using in EmojiPickerViewController.
24+
/// Protocol for a ViewModel which is being used in `EmojiPickerViewController`.
2525
protocol EmojiPickerViewModelProtocol {
2626
/// The observed variable that is responsible for the choice of emoji.
2727
var selectedEmoji: Observable<String> { get set }
@@ -37,10 +37,12 @@ protocol EmojiPickerViewModelProtocol {
3737
func sectionHeaderViewModel(for section: Int) -> String
3838
}
3939

40-
/// ViewModel which using in EmojiPickerViewController.
40+
/// Emoji Picker view model.
4141
final class EmojiPickerViewModel: EmojiPickerViewModelProtocol {
4242

43+
/// Observable object of selected emoji.
4344
var selectedEmoji = Observable<String>(value: "")
45+
/// Observable object of selected category index of an emoji.
4446
var selectedEmojiCategoryIndex = Observable<Int>(value: 0)
4547

4648
/// All emoji categories.

Sources/EmojiPicker/Views/EmojiCollectionViewCell.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ import UIKit
2323

2424
final class EmojiCollectionViewCell: UICollectionViewCell {
2525

26-
var emoji: String? {
27-
didSet {
28-
emojiLabel.text = emoji
29-
}
30-
}
31-
3226
// MARK: - Private Properties
3327

3428
private let emojiLabel: UILabel = {
@@ -51,6 +45,12 @@ final class EmojiCollectionViewCell: UICollectionViewCell {
5145
fatalError("init(coder:) has not been implemented")
5246
}
5347

48+
// MARK: - Public Methods
49+
50+
public func configure(with emoji: String) {
51+
emojiLabel.text = emoji
52+
}
53+
5454
// MARK: - Private Methods
5555

5656
private func setupLayout() {

Sources/EmojiPicker/Views/EmojiCollectionViewHeader.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ import UIKit
2323

2424
final class EmojiCollectionViewHeader: UICollectionReusableView {
2525

26-
var categoryName: String = "" {
27-
didSet {
28-
headerLabel.text = categoryName
29-
}
30-
}
31-
3226
// MARK: - Private Properties
3327

3428
private let headerLabel: UILabel = {
@@ -51,6 +45,12 @@ final class EmojiCollectionViewHeader: UICollectionReusableView {
5145
fatalError("init(coder:) has not been implemented")
5246
}
5347

48+
// MARK: - Public Methods
49+
50+
public func configure(with text: String) {
51+
headerLabel.text = text
52+
}
53+
5454
// MARK: - Private Methods
5555

5656
private func setupLayout() {

Sources/EmojiPicker/Views/EmojiPickerView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ protocol EmojiPickerViewDelegate: AnyObject {
3131

3232
final class EmojiPickerView: UIView {
3333

34+
// MARK: - Internal Properties
35+
3436
weak var delegate: EmojiPickerViewDelegate?
3537

3638
var selectedEmojiCategoryTintColor: UIColor = .systemBlue

0 commit comments

Comments
 (0)