Swift App runs but no buttons appear - swift

I wrote a Swift app but only the window appears when it runs. I can't see any buttons.
Here is my code... I've tried removing the .white attribute thinking maybe it was hidden behind a layer. Nothing.
//
// ViewController.swift
// BraviaRemote
//
// Created by Ed Gilroy on 7/2/17.
// Copyright © 2017 Edward Williams. All rights reserved.
//
import Cocoa
import Alamofire
class ViewController: NSViewController, NSTextFieldDelegate {
#IBAction func MenuButton(_ sender: NSButtonCell) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAABgAw==")
}
#IBAction func ReturnButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAgAAAJcAAAAjAw==")
}
#IBAction func InfoButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAAA6Aw==")
}
#IBAction func GuideButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAgAAAKQAAABbAw==")
}
#IBAction func SelectButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAABlAw==")
}
#IBAction func ChnUpButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAAAQAw==")
}
#IBAction func ChnDownButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAAARAw==")
}
#IBAction func VolUpButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAAASAw==")
}
#IBAction func VolDownButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAAATAw==")
}
#IBAction func LeftButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAAA0Aw==")
}
#IBAction func RightButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAAAzAw==")
}
#IBAction func UpButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAAB0Aw==")
}
#IBAction func DownButton(_ sender: NSButton) {
triggerRemoteControl(irccc: "AAAAAQAAAAEAAAB1Aw==")
}
#IBAction func OnOffButton(_ sender: NSSegmentedControl){
}
#IBOutlet weak var IPField: NSTextField!
var IPAddress: String? {
didSet {
if IPField != nil { IPAddress = "http://\(IPAddress!)/sony/IRCC?" }
else {IPAddress = "http://192.168.2.7/sony/IRCC?"}
if let ip = IPAddress { print (ip) } //Unwraps optional
}
}
override func controlTextDidChange(_ obj: Notification) {
if let txtField = obj.object as? NSTextField {
if txtField.tag == 0 {
//Validation (for later)
IPAddress = txtField.stringValue
}
}
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
func viewDidLoad() {
super.viewDidLoad()
}
}
override func viewDidAppear() {
// Window Properties, including solid colour, lack of resize, movable by background.
view.window?.titlebarAppearsTransparent = true
view.window?.backgroundColor = NSColor.white
view.window?.styleMask.remove(.resizable)
view.window?.isMovableByWindowBackground = true
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
struct SOAPEncoding: ParameterEncoding {
let service: String
let action: String
let IRCCC: String
func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest {
var urlRequest = try urlRequest.asURLRequest()
guard parameters != nil else { return urlRequest }
if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil {
urlRequest.setValue("text/xml", forHTTPHeaderField: "Content-Type")
}
let soapBody = "<?xml version=\"1.0\" encoding=\"utf-8\"?><s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><s:Body><u:\(action) xmlns:u=\"\(service)\"><IRCCCode>\(IRCCC)</IRCCCode></u:X_SendIRCC></s:Body></s:Envelope>"
urlRequest.httpBody = soapBody.data(using: String.Encoding.utf8)
return urlRequest
}
}
func triggerRemoteControl(irccc: String) {
Alamofire.request(IPAddress!,
method: .post,
parameters: ["parameter" : "value"],
encoding: SOAPEncoding(service: "urn:schemas-sony-com:service:IRCC:1",
action: "X_SendIRCC", IRCCC: irccc)).responseString { response in
print(response)
}
}
}

Three errors:
First, you are overriding viewDidLoad() and defining another viewDidLoad() inside of it.
Your code:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
func viewDidLoad() {
super.viewDidLoad()
}
}
Should just look like this:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
Second, you are overriding viewDidAppear but never calling super.
Your code:
override func viewDidAppear() {
// Window Properties, including solid colour, lack of resize, movable by background.
view.window?.titlebarAppearsTransparent = true
view.window?.backgroundColor = NSColor.white
view.window?.styleMask.remove(.resizable)
view.window?.isMovableByWindowBackground = true
}
Should look like this:
override func viewDidAppear() {
super.viewDidAppear()
// Window Properties, including solid colour, lack of resize, movable by background.
view.window?.titlebarAppearsTransparent = true
view.window?.backgroundColor = NSColor.white
view.window?.styleMask.remove(.resizable)
view.window?.isMovableByWindowBackground = true
}
Third, you are overriding the IPAdress didSet and then setting it again. This will cause an infinite loop. You are also comparing a textField to nil, which it will never be, because it's a NSTextField!, instead of checking whether it's empty or not. I can't really make sense of what you're trying to achieve here but you should rip all this overriding nonsense out until you can clearly formulate your intention.

Related

ViewController doesn't pass data on completion

I have 2 ViewControllers.
TimerViewController passes a variable to the EditTimerViewConroller. EditTimerViewConroller edits it and should pass it back, but it looks like code in .completion is not executed.
Any advice how to fix it?
My code is:
TimerViewController
import UIKit
import AVFoundation //play sounds
class TimerViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
var player: AVAudioPlayer!
var timer = Timer()
var totalTime = 10.0
var secondsRemaining = 10.0
var secondsPassed = 0.0
let timerStep = 0.1
#IBOutlet weak var timerLabel: UILabel!
#IBOutlet weak var progressBar: UIProgressView!
#IBAction func startPressed(_ sender: UIButton) {
//works fine
}
#IBAction func editTimerButtinPresed(_ sender: UIButton) {
self.performSegue(withIdentifier: "goToEditTimer", sender: self)
let editTimer = EditTimerViewController()
editTimer.completion = { [weak self] duration in
DispatchQueue.main.async {
self?.totalTime = Double(duration!)
print("editTimer completed, totalTime now is \(self?.totalTime)")
}
}
}
func playSound(fileName: String) {
//works fine
}
#objc func updateTimer() {
//works fine
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "goToEditTimer" {
let destinationVC = segue.destination as! EditTimerViewController
destinationVC.duration = Int(totalTime)
print("Pasing duration = \(totalTime) to Edit screen")
}
}
EditTimerViewController
import UIKit
class EditTimerViewController: UIViewController {
let maxDuration = 60
var duration: Int? //timer duraton is passed from Timer
public var completion: ((Int?) -> Void)?
override func viewDidLoad() {
super.viewDidLoad()
durationSlider.minimumValue = 0
durationSlider.maximumValue = Float(maxDuration)
durationSlider.value = Float(duration!)
durationLabel.text = String(duration!) + "s"
}
#IBOutlet weak var durationLabel: UILabel!
#IBOutlet weak var durationSlider: UISlider!
#IBAction func durationSliderChanged(_ sender: UISlider) {
duration = Int(sender.value)
print(duration!)
durationLabel.text = String(duration!) + "s"
}
#IBAction func cancelPressed(_ sender: UIButton) {
print("Cancel pressed, dismissing Edit screen")
self.dismiss(animated: true, completion: nil)
}
#IBAction func savePressed(_ sender: UIButton) {
print("Save pressed, duration is \(duration!)")
completion?(duration!)
self.dismiss(animated: true, completion: nil)
}
}
In the output after pressing Save button I see
Save pressed, duration is 11
but after it there is no sign of
editTimer completed, totalTime now is 11
and timer duration never changes
Change
#IBAction func editTimerButtinPresed(_ sender: UIButton) {
self.performSegue(withIdentifier: "goToEditTimer", sender: self)
let editTimer = EditTimerViewController()
editTimer.completion = { [weak self] duration in
DispatchQueue.main.async {
self?.totalTime = Double(duration!)
print("editTimer completed, totalTime now is \(self?.totalTime)")
}
}
}
To
#IBAction func editTimerButtinPresed(_ sender: UIButton) {
self.performSegue(withIdentifier: "goToEditTimer", sender: self)
}
And move completion inside prepare
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "goToEditTimer" {
let destinationVC = segue.destination as! EditTimerViewController
destinationVC.duration = Int(totalTime)
print("Pasing duration = \(totalTime) to Edit screen")
destinationVC.completion = { [weak self] duration in
DispatchQueue.main.async {
self?.totalTime = Double(duration!)
print("editTimer completed, totalTime now is \ (self?.totalTime)")
}
}
}
}

Dynamically changing background color in VC

I am stuck with this piece of my homework. Maybe someone can explain me how to solve it.
"VC contains a controller with a built-in controller. Both the parent and child controller have three buttons: Green, Yellow, Violet. When you click on one of the buttons in the parent controller, the background color of the child controller changes to the appropriate one. When you click on the button in the child, the background of the parent changes."
Here is what I made in my code
Parent VC
import UIKit
class OrangeViewController: UIViewController, VioletControllerDelegate {
var delegate: VioletControllerDelegate?
override func viewDidLoad() {
super.viewDidLoad()
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let vcV = segue.destination as! VioletViewController
vcV.bgColor = view.backgroundColor
vcV.delegate = self
}
#IBAction func greenOButton(_ sender: Any) {
//TO DO
}
#IBAction func yellowOButton(_ sender: Any) {
//TO DO
}
#IBAction func purpleOButton(_ sender: Any) {
//TO DO
}
func setColor(color: String) {
view.backgroundColor = UIColor(named: color)
}
}
Child VC
import UIKit
protocol VioletControllerDelegate{
func setColor ( color : String)
}
class VioletViewController: UIViewController {
var bgColor : UIColor?
var delegate: VioletControllerDelegate?
override func viewDidLoad() {
super.viewDidLoad()
var bgColor = view.backgroundColor
}
#IBAction func setGreen(_ sender: Any) {
delegate?.setColor( color: "green")
}
#IBAction func setYellow(_ sender: Any) {
delegate?.setColor( color: "yellow")
}
#IBAction func setViolet(_ sender: Any) {
delegate?.setColor( color: "violet")
}
func setColor ( color : String){
view.backgroundColor = UIColor(named: color)
}
}
Thank you!
I did it. In case someone will need something like this I am posting my answer:
Parent VC
import UIKit
class OrangeViewController: UIViewController, VioletControllerDelegate {
var childVC: VioletViewController?
override func viewDidLoad() {
super.viewDidLoad()
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let vcV = segue.destination as! VioletViewController
self.childVC = vcV
vcV.delegate = self
}
#IBAction func greenOButton(_ sender: Any) {
childVC?.view.backgroundColor = UIColor.green
}
#IBAction func yellowOButton(_ sender: Any) {
childVC?.view.backgroundColor = UIColor.yellow
}
#IBAction func purpleOButton(_ sender: Any) {
childVC?.view.backgroundColor = UIColor.purple
}
func setColor( color : UIColor) {
view.backgroundColor = color
}
}
Child VC
import UIKit
protocol VioletControllerDelegate{
func setColor ( color : UIColor)
}
class VioletViewController: UIViewController {
var delegate: VioletControllerDelegate?
override func viewDidLoad() {
super.viewDidLoad()
}
#IBAction func setGreen(_ sender: Any) {
delegate?.setColor( color: UIColor.green)
}
#IBAction func setYellow(_ sender: Any) {
delegate?.setColor( color: UIColor.yellow)
}
#IBAction func setViolet(_ sender: Any) {
delegate?.setColor( color: UIColor.purple)
}
}

How can I make variables inside an IBAction public to all view controllers?

So I'm trying to make a Chess Time app, where both players have access to a clock and they change the time between bullet(3minutes), Blitz(5minutes), and Rapid(10Minutes). Well in my second view controller SettingsController I made 3 IBActions UIButtons for this.
#IBAction func bulletPressed(_ sender: UIButton) {
var storedTime = bullet
self.delegate?.storedTimeTimer()
self.navigationController?.popViewController(animated: true)
}
#IBAction func blitzPressed(_ sender: UIButton) {
var storedTime = blitz
}
#IBAction func rapidPressed(_ sender: UIButton) {
var storedTime = rapid
}
This is my SettingsController, my whole point is trying to get the storedTime into the first controller. I tried to use a delegate, but I couldn't get it to work.
Here is the full First Controller:
import UIKit
class ChessTimer: UIViewController {
#IBOutlet weak var playerTimer1: UILabel!
#IBOutlet weak var playerTimer2: UILabel!
var timer = Timer()
var time = 10
var isTimerRunning = false
override func viewDidLoad() {
super.viewDidLoad()
if isTimerRunning == false {
runTimer()
}
}
#IBAction func restartButton(_ sender: UIButton) {
}
#IBAction func pausePressed(_ sender: UIButton) {
timer.invalidate()
}
#IBAction func settingsPressed(_ sender: UIButton) {
performSegue(withIdentifier: "goToSettings", sender: self)
}
func runTimer() {
timer = Timer.scheduledTimer(timeInterval: 1, target: self,selector:
(#selector(ChessTimer.updateTimer)),userInfo: nil, repeats: true)
isTimerRunning = true
}
#objc func updateTimer() {
if storedTime! < 1 {
timer.invalidate()
playerTimer1.text = "00:00"
playerTimer2.text = "00:00"
}
else {
storedTime! -= 1
playerTimer1.text = prodTimeString(time: TimeInterval(storedTime)!)
}
}
func prodTimeString(time: TimeInterval) -> String {
let prodMinutes = Int(time) / 60 % 60
let prodSeconds = Int(time) % 60
return String(format: "%02d:%02d", prodMinutes, prodSeconds)
}
#IBAction func playerButton1(_ sender: UIButton) {
}
#IBAction func playerButton2(_ sender: UIButton) {
}
}
extension ChessTimer: SettingsControllerDelegate {
func storedTimeTimer() {
}
}
This is the second full controller
import UIKit
class SettingsController: UIViewController {
var bullet = "03:00"
var blitz = "05:00"
var rapid = "10:00"
var storedTime = 0
var delegate: SettingsControllerDelegate?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
#IBAction func bulletPressed(_ sender: UIButton) {
var storedTime = bullet
self.delegate?.storedTimeTimer()
self.navigationController?.popViewController(animated: true)
}
#IBAction func blitzPressed(_ sender: UIButton) {
var storedTime = blitz
}
#IBAction func rapidPressed(_ sender: UIButton) {
var storedTime = rapid
}
}
protocol SettingsControllerDelegate {
func storedTimeTimer()
}
This can be achieved using a Constants.swift file.
Click File -> New -> File -> Swift File and then name it Constants.swift.
In Constants.swift, declare var storedTime = 0.
Delete var storedTime = 0 from your view controllers, you'll only need it in Constants.swift. (So delete it from SettingsController, etc.)
The storedTime variable will now be public to all view controllers. 👍
Hope this helps someone!

Swift AVFoundation

This is actually two problems
they are marked with //*****************************
I put the entire class in this post,
the first is
//====================================
//====================================
#IBAction func btnMakeReport(_ sender: Any) {
let settings = AVCapturePhotoSettings()
//**************** self is erroring... getting...
// /Users/vyoumans/Documents/vyDEVELOPMENT/iOS/TESTS/camtest11/camtest11/VCCam02a.swift:104:61: Argument type 'VCCam02a' does not conform to expected type 'AVCapturePhotoCaptureDelegate'
photoOutput?.capturePhoto(with: settings, delegate: self)
Could I get some sugestions on why self would not confirm to AVCapturePhotoCaptureDelagate.
the second...
//************** image is error... but I define image above.
I declare image at the begining of the class. This error in //====================================
extension ViewController: AVCapturePhotoCaptureDelegate {
at bottom of app
Thanks
//-------- begining of code . ------------
'
import UIKit
import AVFoundation
//====================================
class VCCam02a: UIViewController {
var captureSession = AVCaptureSession()
var backCamera: AVCaptureDevice?
var frontCamera: AVCaptureDevice?
var currentCamrera: AVCaptureDevice?
var photoOutput: AVCapturePhotoOutput?
var cameraPreviewLayer: AVCaptureVideoPreviewLayer?
// var image: UIImage?
var image: UIImage?
override func viewDidLoad() {
super.viewDidLoad()
setupCaptureSession()
setupDevice()
setupInputOutput()
setupPreviewLayer()
startRunningCaptureSession()
}
//====================================
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
//====================================
//====================================
func setupCaptureSession() {
captureSession.sessionPreset = AVCaptureSession.Preset.photo
}
//====================================
func setupDevice() {
let deviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [AVCaptureDevice.DeviceType.builtInWideAngleCamera], mediaType: AVMediaType.video, position: AVCaptureDevice.Position.unspecified)
let devices = deviceDiscoverySession.devices
for device in devices {
if device.position == AVCaptureDevice.Position.back {
backCamera = device
} else if device.position == AVCaptureDevice.Position.front {
frontCamera = device
}
}
currentCamrera = backCamera
}
//====================================
func setupInputOutput() {
do {
let captureDeviceInput = try AVCaptureDeviceInput(device: currentCamrera!)
captureSession.addInput(captureDeviceInput)
photoOutput = AVCapturePhotoOutput()
photoOutput?.setPreparedPhotoSettingsArray([AVCapturePhotoSettings(format: [AVVideoCodecKey: AVVideoCodecType.jpeg])], completionHandler: nil)
captureSession.addOutput(photoOutput!)
} catch {
print(error)
}
}
//====================================
func setupPreviewLayer() {
cameraPreviewLayer = AVCaptureVideoPreviewLayer(session: captureSession)
cameraPreviewLayer?.videoGravity = AVLayerVideoGravity.resizeAspectFill
cameraPreviewLayer?.connection?.videoOrientation = AVCaptureVideoOrientation.portrait
cameraPreviewLayer?.frame = self.view.frame
self.view.layer.insertSublayer(cameraPreviewLayer!, at: 0)
}
//====================================
func startRunningCaptureSession() {
captureSession.startRunning()
}
//====================================
//====================================
#IBAction func btnMakeReport(_ sender: Any) {
let settings = AVCapturePhotoSettings()
//**************** self is erroring... getting...
// /Users/vyoumans/Documents/vyDEVELOPMENT/iOS/TESTS/camtest11/camtest11/VCCam02a.swift:104:61: Argument type 'VCCam02a' does not conform to expected type 'AVCapturePhotoCaptureDelegate'
photoOutput?.capturePhoto(with: settings, delegate: self)
// performSegue(withIdentifier: "showPhoto_Segue", sender: nil)
}
//====================================
#IBAction func btnCancel(_ sender: UIButton) {
dismiss(animated: true, completion: nil)
}
//====================================
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "showPhoto_Segue" {
let VCPreviewViewController = segue.destination as! VCPreviewViewController
VCPreviewViewController.image = self.image
}
}
//====================================
//====================================
//====================================
//====================================
//====================================
//====================================
//====================================
//====================================
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
//====================================
extension ViewController: AVCapturePhotoCaptureDelegate {
func photoOutput(_ output: AVCapturePhotoOutput, didFinishProcessingPhoto photo: AVCapturePhoto, error: Error?) {
if let imageData = photo.fileDataRepresentation() {
//************** image is error... but I define image above.
///Users/vyoumans/Documents/vyDEVELOPMENT/iOS/TESTS/camtest11/camtest11/VCCam02a.swift:143:13: Use of unresolved identifier 'image'
image = UIImage(data: imageData)
performSegue(withIdentifier: "showPhoto_Segue", sender: nil)
}
}
}
//====================================
//====================================
//====================================
//====================================
//====================================
'
Ok, this line:
photoOutput?.capturePhoto(with: settings, delegate: self)
Seems to be the problem. It sounds like you're getting a compiler error that self does not conform to the AVCapturePhotoCaptureDelegate protocol.
That's pretty self-explanatory. If your class conforms to the AVCapturePhotoCaptureDelegate protocol, you need to add that conformance to the class definition, or to an extension:
class VCCam02a: UIViewController, AVCapturePhotoCaptureDelegate
You will then need to implement all the methods in that protocol needed to handle the type of capture you are doing. To Quote the docs:
All methods in this protocol are optional at compile time, but at run
time your delegate object must respond to certain methods depending on
your photo settings:
(See the Apple docs on the protocol for more information.)

Passing Data through 3 view Controllers [Swift 3.0 - Xcode]

Im passing data through 3 VCs, so in the end I want to achieve sending data from the third VC to the first. I send Data from V2 to V3 with a segue and then send it back from V3 to V2 by delegate. Im then trying to send it from V2 to V1 through a segue but I cant seem to collect the data (sent back from V3) in V2 to then send to V1.
The data from V3 doesn't show up in V1, but the code still runs.
Can anyone help?
heres my code from V2 and V3:
V2:
import UIKit
class SecondViewController: UIViewController, thirdDelegate {
var GetBack: String?
var SendForward = [String]()
var Datacollect = [String]()
var Collect = [String]()
let ct = "Conner#2"
let new = "All#2"
#IBOutlet var Hinput: UITextField!
#IBOutlet var Ninput: UITextField!
#IBAction func MAP(_ sender: Any) {
if Hinput.text != ""{
performSegue(withIdentifier: "SegueSearch", sender: self)}
}
#IBAction func Info(_ sender: Any) {
performSegue(withIdentifier: "SegueInfo", sender: self)
}
func DataToPass(ArrayName: [String]) { //function from delegate
Datacollect = ArrayName
print(ArrayName)
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?){
if segue.identifier == "SegueSearch"{
let thirdController = segue.destination as! ThirdViewController
SendForward.append(Hinput.text!)
SendForward.append(ct)
thirdController.height = SendForward
thirdController.delegate = self
} else if segue.identifier == "SegueInfo" {
let firstController = segue.destination as! ViewController
if Datacollect.count != 0{
Collect.append(Datacollect[1])
Collect.append(Datacollect[0])}
Collect.append(Ninput.text!)
Collect.append(new)
firstController.AllData = Collect
}
}
override func viewDidLoad() {
super.viewDidLoad()
print("check",Datacollect)
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
Is this the part that isn't working?
func DataToPass(ArrayName: [String]) {
Datacollect = ArrayName
print(ArrayName)
}
V3:
import UIKit
protocol thirdDelegate{
func DataToPass (ArrayName: [String])
}
class ThirdViewController: UIViewController {
var height = [String]()
var SendBack = [String]()
let ko = "Keith#3"
var delegate: thirdDelegate! = nil
#IBOutlet var Houtput: UILabel!
#IBAction func Home(_ sender: Any) {
let StrH = String(height[0])
SendBack.append(ko)
SendBack.append(StrH!)
delegate.DataToPass(ArrayName: SendBack)
}
override func viewDidLoad() {
Houtput.text = height[0]
super.viewDidLoad()
print(height)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
}
}