无法从Sinch Framework导入协议 - SinRegionInfo

时间:2017-05-24 22:15:44

标签: objective-c swift frameworks protocols sinch

我有一个项目,我已经建立了我试图包含用于进行SMS验证的sinch框架。我将Sinch添加到VIA cocoapods项目中,并通过手动将文件夹/框架添加到我的xcode文件系统中。

我现在遇到的问题是我的CountrySelectionViewController.swift版本无法访问Sinch框架内定义的SinRegionInfo协议......我不确定出了什么问题。 CountrySelectionViewController.swift中的代码/错误示例如下:

var entries:Array <SINRegionInfo> = []; ---&GT;使用未声明的类型'SinRegionInfo'

奇怪的是,我的项目中的所有内容与示例项目中的内容似乎相同,但在示例项目中,访问协议没有问题。

CountrySelectionViewController.swift

import UIKit
import SinchVerification

class CountrySelectionViewController : UITableViewController {

var isoCountryCode: String?

var onCompletion: ((String) -> Void)?

var entries: Array<SINRegionInfo> = [];

override func viewDidLoad() {
    super.viewDidLoad();
    let regionList = PhoneNumberUtil().regionList(forLocale: Locale.current);
    entries = regionList.entries.sorted(by: { (a: SINRegionInfo, b: SINRegionInfo) -> Bool in
        return a.countryDisplayName < b.countryDisplayName;
    })
}

override func viewWillAppear(_ animated: Bool) {
    let row = entries.index { (region: SINRegionInfo) -> Bool in
        return region.isoCountryCode == isoCountryCode;
    }
    if row != nil {
        tableView.selectRow(at: IndexPath.init(row: Int(row!), section: 0), animated: animated, scrollPosition: .middle);
    }
} 

0 个答案:

没有答案
相关问题