You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
3.3 KiB
103 lines
3.3 KiB
// |
|
// businessCardViewControllers.swift |
|
// FireBoltt |
|
// |
|
// Created by ecell on 2022/11/22. |
|
// Copyright © 2022 Sheldon. All rights reserved. |
|
// |
|
|
|
import UIKit |
|
import AVFoundation |
|
|
|
class businessCardViewControllers: ViewController { |
|
|
|
|
|
var payArr:[String] = [MultiLanguageKey_FB.weChatPayCodeFB.localized, |
|
MultiLanguageKey_FB.qqRemindFB.localized, |
|
MultiLanguageKey_FB.facebookRemindFB.localized, |
|
MultiLanguageKey_FB.whatsappRemindFB.localized, |
|
MultiLanguageKey_FB.twitterRemindFB.localized] |
|
|
|
var imgArr:[String] = ["fb_icon_wechat", |
|
"fb_icon_qq", |
|
"fb_icon_facebook", |
|
"fb_icon_whatsapp", |
|
"fb_icon_Twitter"] |
|
var tableView:UITableView? |
|
|
|
override func loadView() { |
|
super.loadView() |
|
} |
|
override func makeUI() { |
|
super.makeUI() |
|
|
|
|
|
} |
|
|
|
override func viewDidLoad() { |
|
super.viewDidLoad() |
|
|
|
//创建表视图 |
|
if #available(iOS 13.0, *) { |
|
self.tableView = UITableView(frame: CGRect(x: 0, y: 0, width: Int(view.frame.size.width), height: Int(kScreenH)), style:UITableView.Style.insetGrouped) |
|
} else { |
|
// Fallback on earlier versions |
|
} |
|
self.tableView!.delegate = self |
|
self.tableView!.dataSource = self |
|
self.tableView?.rowHeight = 50 |
|
self.tableView?.isScrollEnabled = false |
|
self.tableView!.register(UITableViewCell.self, forCellReuseIdentifier: "SwiftCell") |
|
//设置允许单元格多选 |
|
self.view.addSubview(self.tableView!) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
extension businessCardViewControllers: UITableViewDelegate { |
|
// 选中 |
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
|
let viewModel = UpdataQRCodeImgViewModels() |
|
viewModel.titleName = self.payArr[indexPath.row] |
|
viewModel.payType = indexPath.row + 4 |
|
viewModel.viewType = "MP" |
|
self.navigator.show(segue: .upDataQRCodeImg(ViewModel: viewModel), sender: self) |
|
|
|
} |
|
} |
|
|
|
extension businessCardViewControllers: UITableViewDataSource { |
|
|
|
func numberOfSections(in tableView: UITableView) -> Int { |
|
|
|
return 1 |
|
|
|
} |
|
|
|
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
|
|
|
return payArr.count |
|
|
|
} |
|
|
|
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
|
|
|
let identify:String = "SwiftCell" |
|
let cell = tableView.dequeueReusableCell(withIdentifier: identify, for: indexPath) |
|
cell.selectionStyle = UITableViewCell.SelectionStyle.none |
|
cell.textLabel?.text = self.payArr[indexPath.row] |
|
cell.imageView?.image = UIImage(named: self.imgArr[indexPath.row]) |
|
cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator |
|
return cell |
|
} |
|
|
|
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { |
|
return 10 |
|
} |
|
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { |
|
return nil |
|
} |
|
|
|
}
|
|
|