Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // SheetViewController.swift
- // Swiss IT-Factory AR
- //
- // Created by Intern on 7/23/18.
- // Copyright © 2018 Swiss IT-Factory. All rights reserved.
- //
- import UIKit
- import Alamofire
- import SwiftyJSON
- class IssuesSheetViewController: UIViewController, HalfSheetPresentingProtocol, UITableViewDelegate, UITableViewDataSource, searchSheetDelegate {
- var transitionManager: HalfSheetPresentationManager!
- var projectlistArray:[PROJECTLIST] = [PROJECTLIST]()
- // func getSearchList(searchList: PROJECTLIST) {
- // //login(withUsername: "GLAJQI", andPassword: "blackberry1", andProjectList: searchList)
- // self.tableView.reloadData()
- //
- // }
- func getSearchListArray(searchlist: [PROJECTLIST]) {
- projectlistArray = searchlist
- self.tableView.reloadData()
- }
- @IBOutlet var tableView: UITableView!
- override func viewDidLoad() {
- super.viewDidLoad()
- tableView.contentInset = UIEdgeInsetsMake(12, 0, 0, 0)
- tableView.delegate = self
- tableView.dataSource = self
- let projectList:PROJECTLIST = PROJECTLIST(object: Any.self)
- //projectList.pROID = "1216*"
- //login(withUsername: "GLAJQI", andPassword: "blackberry1", andProjectList: projectList)
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- // Dispose of any resources that can be recreated.
- }
- @IBAction func showAction(_ sender: Any) {
- let myVC:IssuesSearchSheetViewController = UIStoryboard(name: "Issues", bundle: nil).instantiateViewController(withIdentifier: "searchVC") as! IssuesSearchSheetViewController
- myVC.delegate = self
- presentUsingHalfSheet(myVC)
- }
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return projectlistArray.count
- }
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) as! SearchTableViewCell
- let myProList:PROJECTLIST = projectlistArray[indexPath.row]
- cell.label1?.text = myProList.pROID
- cell.txtDevisID.text = myProList.dEVISID
- cell.txtBuKrs.text = myProList.bUKRS
- cell.txtProfitCenter.text = myProList.pRCTR
- cell.label2.text = myProList.bAUBEGINN! + " - " + myProList.bAUENDE!
- cell.txtVerantowortliche_Person.text = myProList.vEREIN
- cell.txtProjektbeze.text = myProList.pROBEZ
- cell.txtPSPElement.text = myProList.pSPNR
- return cell
- }
- }
- extension IssuesSheetViewController: HalfSheetCompletionProtocol {
- func didDismiss() {
- print("dismissed!")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement