小编koi*_*ira的帖子

如何在IB中创建PKPaymentButton?

以下代码来自WWDC 2015 Session 702 Apple Pay in Apps - Emporium:Apple Pay的简单购物体验

    if PKPaymentAuthorizationViewController.canMakePaymentsUsingNetworks(ProductTableViewController.supportedNetworks) {

        let button = PKPaymentButton(type: .Buy, style: .Black)
        button.addTarget(self, action: #selector(ProductTableViewController.applePayButtonPressed), forControlEvents: .TouchUpInside)

        button.center = applePayView.center
        button.autoresizingMask = [.FlexibleLeftMargin, .FlexibleRightMargin]
        applePayView.addSubview(button)
    }
Run Code Online (Sandbox Code Playgroud)

我想知道我们是否可以在IB中创建这个按钮.

interface-builder ios swift applepay

6
推荐指数
2
解决办法
1986
查看次数

标签 统计

applepay ×1

interface-builder ×1

ios ×1

swift ×1