Getting this error while trying to use if statement in Swift
Referencing operator function '>' on 'BinaryInteger' requires that 'KotlinInt' conform to 'BinaryInteger'
Here's the code:
let unreadCount = message.unreadCount ?? 0
if unreadCount > 0 {
HStack {
Image("unread")
Text(unreadCount)
.font(.system(size17,weight .bold))
.foregroundColor(Color("unreadGreen"))
}
}
is this the right way to fix this thing?
instead of
*if* unreadCount > 0 {
using
if
<http://Swift.Int|Swift.Int>(unreadCount) > 0 {
error is gone code is compiled well but is it the correct thing to do?