错误:init(type:style)不可用Swift 4中的PKPaymentButton创建错误

问题描述 投票:1回答:1

我一直在想这个,我收到这个错误:

error: init(type:style) is unavailable 

Swift 4中的PKPaymentButton创建错误

经过5个小时的点击后尝试将swift的版本从4.0更改为3.2然后构建成功。

这是一个迅速的错误吗?有人提出过错误吗?

我的XCode是9.2

ios swift swift4
1个回答
1
投票

似乎Swift 4和iOS 11 SDK不再导入init(type:style:)

也许你可以使用init(paymentButtonType:paymentButtonStyle:)

init(paymentButtonType: PKPaymentButtonType, paymentButtonStyle: PKPaymentButtonStyle)

© www.soinside.com 2019 - 2024. All rights reserved.