Loading...
Answers
MenuCreating a TableView Programmatically with multiple cell in swift
Answers
class MyViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
let tableView = UITableView()
override func viewDidLoad() {
super.viewDidLoad()
// Set the table view's frame
tableView.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.height)
// Set the data source and delegate
tableView.dataSource = self
tableView.delegate = self
// Register the custom cell class
tableView.register(CustomTableViewCell.self, forCellReuseIdentifier: "CustomCell")
// Add the table view as a subview
view.addSubview(tableView)
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "CustomCell", for: indexPath) as! CustomTableViewCell
cell.textLabel?.text = "Row \(indexPath.row)"
return cell
}
}
Related Questions
-
Can you offer 1-month or 1-week trials on in-app purchases?
You can't offer trials or even easily make refunds accessible via in-app purchases. What you can do is actually make manual deposits or write checks back to the users who ask for it. But the purchase behavior associated with in-app purchases really shouldn't require any promise of a refund. In fact, doing so might make people *less* likely to purchase being that you're telegraphing a weak offering. Happy to talk through alternate ways of testing pricing and willingness to pay in a call.TW
-
What would be the cost to program an an app like Whatsapp? iOS only.
Well, the biggest cost here wouldn't be in the app, but in the server infrastructure. As usual with connected apps, people often forget they have to be connected to servers. The app itself is just a view to what the servers provide, so it's not the major cost. 20K $ to 100K $ should be enough. On server stuff, I expect it to be a lot more, particularly if you aim for a wide audience (several million $). On a Whatsapp clone, I'd consider: - solutions for performing calls through servers, not that easy. Look at what Twilio provides. WebRTC is an upcoming protocol that will ease that (web & mobile). - solutions for API, IM and user accounts management. Look at StackMob or Parse which are MBaaS (Mobile Backend as a Service). Hope it helps!AJ
-
Where Can I find more clients for iOS Development Jobs?
Have you tried AdWords and a website/landing page for you or your business? I know a company in Brazil that is doing exactly this: * They have a website/landing page setup that explains how they charge for the application and has a call-to-action button to ask for an evaluation of the project the client have * They have thought and described a way to evaluate projects roughly so that the client may have an idea of time / costs of the project * Their website has images of applications they have developed before in a portfolio They are doing great, actually they have more people asking them projects than they are able to develop and they started rejecting offers.AM
-
Do motivational quote apps on the App Store marketplace have potential for success?
For whatever reason, Quotes are immensely popular and one of the highest searched terms on Search Engines. Now, because there are countless Apps already, you'd definitely need to monetize with advertising or perhaps implementing something that the user could personalize the quotes with. Pictures, backgrounds, etcLF
-
How should I hire an app developer?
First, you need to consult with someone who understands the complexity of the app that you request it. This person can be your friends who have background in CS or IT. Usually, people usually hire some freelancer or developer team and you pay it hourly. Once finished, you can just ask those team to migrate the ownership to you and hire some freshgrads in computer to just do maintenance of your app. you can check https://www.freelancer.com/.HH
the startups.com platform
Copyright © 2025 Startups.com. All rights reserved.