^^^^
Why can't I Drag from Main.storyboard to my ViewController
I may not be fully understanding your question but, why would you need to link your Main.storyboard and your ViewController? They're already linked by default. If you're talking about linking something like a button with your ViewController, you'd click and hold your button, textview, label, etc.. press control and drag into your ViewController.
What cannot you drag ? For connecting an object ? For dragging an object ?
Please, be more explicit when you post on the forum ; others are not here to guess what you mean by ^^^^^
Yeah when i do that i get a UIviewController.h and it tells me i dont have permission to modifiy the file.
Yeah sorry im new to swift. Im trying to create a table for a class that trascends into another table for example
first -> first second -> first third
second-> second second -> second third
third -> third second -> third third
but im also having trouble with that because I dont think im identifying it correctly.
import UIKit
class FirstTableViewController: UITableViewController{
var FirstTableArray = [String]()
var SecondArray = [SecondTableViewController]()
var ThirdArray = [ThirdTableViewController]()
/
override func viewDidLoad() {
super.viewDidLoad()
/
FirstTableArray = [ "First","Second","Third","Fourth","Fifth"]
SecondArray = [SecondTableViewController(SecondTitle: [ "1", "2", "3"]),
SecondTable(SecondTitle: ["1","Secon2dSecond","Third3Second"]),
SecondTable(SecondTitle: ["FirstThird","SecondThird","ThirdThird"]),
SecondTable(SecondTitle: ["1","Secon2dSecond","Third3Second"]),
ThirdArray = [ThirdTableViewController(thirdTitle:["1", "2", "3"])],
ThirdView(ThirdViewArray: ["3","4","4"]),
ThirdView(ThirdViewArray: ["asdkljf","asdfasd","asdfas"]),
ThirdView(ThirdViewArray: ["asdkljf"])]
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
/
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int
{
return FirstTableArray.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let Cell = self.tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
Cell.textLabel?.text = FirstTableArray[indexPath.row]
return Cell
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let indexPath : NSIndexPath = self.tableView.indexPathForSelectedRow!
let DestViewController = segue.destinationViewController as! SecondTableViewController
var SecondTableArrayTwo : SecondTable
SecondTableArrayTwo = SecondArray[indexPath.row]
DestViewController.SecondArray = SecondTableArrayTwo.SecondTitle
var ThirdAnswerArray : ThirdTable
ThirdAnswerArray = ThirdArray[indexPath.row]
DestViewController.SecondAnswerArray = ThirdAnswerArray.ThirdViewArray
}
/
class SecondTableViewController: UITableViewController {
var SecondArray = [String]()
var SecondAnswerArray = [String]()
override func viewDidLoad() {
super.viewDidLoad()
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return SecondArray.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let Cell = self.tableView.dequeueReusableCellWithIdentifier("SecondCell", forIndexPath: indexPath) as UITableViewCell
Cell.textLabel?.text = SecondArray[indexPath.row]
return Cell
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let indexPath : NSIndexPath = self.tableView.indexPathForSelectedRow!
let DestViewController = segue.destinationViewController as! ViewController
DestViewController.FirstString = SecondAnswerArray[indexPath.row]}
}
class ThirdTableViewController: UITableViewController {
var ThirdArray = [String]()
var ThirdAnswerArray = [String]()
override func viewDidLoad() {
super.viewDidLoad()
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return ThirdArray.count
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let Cell = self.tableView.dequeueReusableCellWithIdentifier("ThirdCell", forIndexPath: indexPath) as UITableViewCell
Cell.textLabel?.text = ThirdArray[indexPath.row]
return Cell
}
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
let indexPath : NSIndexPath = self.tableView.indexPathForSelectedRow!
let DestViewController = segue.destinationViewController as! ViewController
DestViewController.SecondAnswerArray = ThirdAnswerArray[indexPath.row]}
}
/
struct SecondTable {
var SecondTitle : [String]
}
struct ThirdView {
var ThirdTitle = [String]()
}
}
This is what im working on and when i try to connect the Table view controllers i get the UIviewController.h file...