Posts

Post not yet marked as solved
0 Replies
244 Views
What are the basic requirments of having a simple phone app using using a phone number to connect connect to one another.I just want to create a basic app where I cam cimmunucate with my app using two of my iphone. where for example Phone 1 # (917) 555 - 1234 dails Phone 2 # (213) 666 - 4321. How do I registar phone numbers?
Posted Last updated
.
Post not yet marked as solved
2 Replies
431 Views
Is it possible to create a toggle switch to silence an iPhone's ringtone in my app using swift? If so, what is the line of code? Thank you for you feedback in advance!
Posted Last updated
.
Post marked as solved
1 Replies
479 Views
Below I have my code where I have a button to randomly display names on a label from a list on a tableview. Im trying to only display the names that have been checkmarked on the tableview. I would appreciate the help, Thank you in advance.import UIKit class ViewController: UIViewController,UITableViewDataSource, UITableViewDelegate { let names = ["Eric","Matt","Amy","Chris","John"] @IBOutlet weak var tableView: UITableView! @IBOutlet weak var mainLabel: UILabel! override func viewDidLoad() { super.viewDidLoad() tableView.delegate = self tableView.dataSource = self // Do any additional setup after loading the view. } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return names.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell") let text = names[indexPath.row] cell?.textLabel?.text = text return cell! } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if tableView.cellForRow(at: indexPath)?.accessoryType == UITableViewCell.AccessoryType.none{ tableView.cellForRow(at: indexPath)?.accessoryType = UITableViewCell.AccessoryType.checkmark }else{ tableView.cellForRow(at: indexPath)?.accessoryType = UITableViewCell.AccessoryType.none } } @IBAction func randomButton(_ sender: Any) { self.mainLabel.text = self.names.randomElement() } }
Posted Last updated
.
Post not yet marked as solved
1 Replies
268 Views
I created a simple tableview using the code below with a UITableView in the storyboard and when i lauch the iphone simulator nothing appears.I an hoping someone help me trouble shoot this issue. thank you in advance!!!import UIKit class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate { @IBOutlet weak var tableView: UITableView! func numberOfSections(in tableView: UITableView) -> Int { return 1 } func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return data.count } func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "cell")! let text = data[indexPath.row] cell.textLabel?.text = text return cell } override func viewDidLoad() { super.viewDidLoad() for i in 0...1000{ data.append("\(i)") } // Do any additional setup after loading the view. } private var data: [String] = [] }
Posted Last updated
.