我无法快速通过协议传递值

时间:2018-09-07 09:43:51

标签: swift uiviewcontroller swift-protocols

我需要将选择行方法中的[boomer@bzha kubernetes]$ curl http://10.110.200.24:8080/apis/extensions/v1beta1/watch/namespaces/kube-system/deployments {"type":"ADDED","object":{"kind":"Deployment","apiVersion":"extensions/v1beta1","metadata":{"name":"influxdb","namespace":"kube-system","selfLink":"/apis/extensions/v1beta1/namespaces/kube-system/deployments/influxdb","uid":"37a07ded-6a25-11e8-b67e-0050568ddfc2","resourceVersion":"6896550","generation":2,"creationTimestamp":"2018-06-07T07:34:31Z","labels":{"k8s-app":"influxdb","task":"monitoring"},"annotations":{"deployment.kubernetes.io/revision":"2"}},"spec":{"replicas":1,"selector":{"matchLabels":{"k8s-app":"influxdb","task":"monitoring"}},"template":{"metadata":{"creationTimestamp":null,"labels":{"k8s-app":"influxdb","task":"monitoring"}},"spec":{"volumes":[{"name":"tz-config","hostPath":{"path":"/usr/share/zoneinfo/Asia/Shanghai","type":""}}],"containers":[{"name":"influxdb","image":"hub.skyinno.com/google_containers/heapster-influxdb-amd64:v1.3.3","resources":{"limits":{"cpu":"4","memory":"4Gi"},"requests":{"cpu":"100m","memory":"128Mi"}},"volumeMounts":[{"name":"tz-config","mountPath":"/etc/localtime"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"IfNotPresent"}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","securityContext":{},"schedulerName":"default-scheduler"}},"strategy":{"type":"RollingUpdate","rollingUpdate":{"maxUnavailable":1,"maxSurge":1}}},"status":{"observedGeneration":2,"replicas":1,"updatedReplicas":1,"readyReplicas":1,"availableReplicas":1,"conditions":[{"type":"Available","status":"True","lastUpdateTime":"2018-06-07T07:34:31Z","lastTransitionTime":"2018-06-07T07:34:31Z","reason":"MinimumReplicasAvailable","message":"Deployment has minimum availability."}]}}} {"type":"ADDED","object":{"kind":"Deployment","apiVersion":"extensions/v1beta1","metadata":{"name":"prometheus-core","namespace":"kube-system","selfLink":"/apis/extensions/v1beta1/namespaces/kube-system/deployments/prometheus-core","uid":"fa7b06da-6a2a-11e8-9521-0050568ddfc2","resourceVersion":"8261846","generation":6,"creationTimestamp":"2018-06-07T08:15:45Z","labels":{"app":"prometheus","component":"core"},"annotations":{"deployment.kubernetes.io/revision":"6"}},"spec":{"replicas":1,"selector":{"matchLabels":{"app":"prometheus","component":"core"}},"template":{"metadata":{"name":"prometheus-main","creationTimes ...... 中的值传递给ScheduleViewController表单元格。

这是我的协议

MySchedularViewController

从中传递值确实选择了行方法

protocol ScheduleViewControllerDelegate {
    func mySchedule(imgIcon: [String], proName: [String], proTime: [String])
}

在myScheduleViewController中获取协议

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        scheduleViewControllerDelegate?.mySchedule(imgIcon: ["hello"], proName: [programNameArray[indexPath.row]], proTime: [programTimeArray[indexPath.row]])

        print("Row Selected")
    }

我为创建协议的ViewController(ScheduleViewController)创建了两个实例。它会引起任何问题吗?

0 个答案:

没有答案