This library to show a view to pick emojis for iOS.
- iOS 14.0 or later
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.
In Xcode navigate to File → Swift Packages → Add Package Dependency. Use this URL to add the dependency:
https://github.com/tahabozdemir/TBEmojiPicker
Once you have your Swift package set up, adding as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.package(url: "https://github.com/tahabozdemir/TBEmojiPicker", .upToNextMajor(from: "1.0.0"))
]
import SwiftUI
import TBEmojiPicker
struct ContentView: View {
@State var selected: String = ""
@State var isSheet: Bool = false
var body: some View {
VStack {
Text("Selected Emoji is : \(selected)")
Button("Select an Emoji") {
isSheet.toggle()
}
.sheet(isPresented: $isSheet) {
TBEmojiPicker(selectedEmoji: $selected)
}
}
}
}
A binding to the selected emoji variable
TBEmojiPicker(selectedEmoji: $selected)
Color of the border of the selected emoji. The default value of this property is Color.blue
.
TBEmojiPicker(selectedEmoji: $selected, selectedColor: Color.orange)
Count of grid column. The default value of this property is 5
TBEmojiPicker(selectedEmoji: $selected, columnCount: 5)
Color of the border of the selected emoji The default value of this property is BottomNavBar(backgroundColor: .black, foregroundColor: .white)
.
TBEmojiPicker(selectedEmoji: $selected, bottomNavBar: BottomNavBar(backgroundColor: Color.orange, foregroundColor: .white))