get local currency iap swift
extension SKProduct {
fileprivate static var formatter: NumberFormatter {
let formatter = NumberFormatter()
formatter.numberStyle = .currency
return formatter
}
var localizedPrice: String {
if self.price == 0.00 {
return "Get"
} else {
let formatter = SKProduct.formatter
formatter.locale = self.priceLocale
guard let formattedPrice = formatter.string(from: self.price) else {
return "Unknown Price"
}
return formattedPrice
}
}
}
Also in Swift:
- how to use alamofire pod in swift 5
- how to screen record swift stackoverflow
- swift ns_enum generic name
- swift find difference between two arrays
- chating App in swift
- int in swift
- swift set uiimage color
- swift loop through array
- fizbuzz in swift
- uilabel center text programmatically swift
- loop through array swift
- swift zstack
- conert data to string swift
- how can i find range of a string in another string swift
- disable dark mode swift
- swift 5 make a phone call
- swift test if simulator
- swift convert string to ns muteable string
- run a function only once swift
- swift uicollectionview cell size
- swift resource exceeds maximum size
- swift animate a label ishidden
- UI API called on a background thread
- view will appear