我将myp项目从Swift 2.3升级到3。
来自SwiftyStoreKit' Github的示例代码:
.SwiftyStoreKit.purchaseProduct("com.musevisions.SwiftyStoreKit.Purchase1", quantity: 1, atomically: true) { result in
switch result {
case .success(let purchase):
我的代码:
func purchase(_ productId : String) {
NetworkActivityIndicatorManager.NetworkOperationStarted()
SwiftyStoreKit.purchaseProduct(productId, completion: {
result in
NetworkActivityIndicatorManager.networkOperationFinished()
switch result
{
case success(let purchase):
(数量和原子上都有默认值):
public class func purchaseProduct(_ productId: String, quantity: Int = 1, atomically: Bool = true, applicationUsername: String = "", completion: @escaping (PurchaseResult) -> Void) {
答案 0 :(得分:1)
<h1>current:{{ form.search.value()|default('') }} - jinja2 format</h1>
<form action="." method="post">
{% csrf_token %}
{{ form }}
<button type="submit">submit</button>
</form>
是枚举result
的一个实例。因此,在您的交换机中,您在成功之前缺少PurchaseResult
或.
。
更改此行
PurchaseResult.
带
case success(let purchase):
或
case .success(let purchase):