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
-
Whats are some ways to beta test an iOS app?
Apple will allow a developer to register 100 UDID devices per 12 month cycle to test via TestFlight or HockeyApp. Having started with TestFlight, I would really encourage you NOT to use it, and go directly to HockeyApp. HockeyApp is a much better product. There is also enterprise distribution which allows you far more UDID's but whether you qualify for enterprise distribution is difficult to say. As part of your testing, I'd encourage to explicitly ask your testers to only register one device. One of the things we experienced was some testers registering 3 devices but only used one, essentially wasting those UDID's where we could have given to other testers. Who you invite to be a tester should be selective as well. I think you should have no more than 10 non-user users. These people should be people who have either built successful mobile apps or who are just such huge consumers of similar mobile apps to what you're building, that they can give you great product feedback even though they aren't your user. Specifically, they can help point out non obvious UI problems and better ways to implement particular features. The rest of your users should be highly qualified as actually wanting what you're building. If they can't articulate why they should be the first to use what you're building, they are likely the wrong tester. The more you can do to make them "beg" to be a tester, the higher the sign that the feedback you're getting from them can be considered "high-signal." In a limited beta test, you're really looking to understand the biggest UX pain-points. For example, are people not registering and providing you the additional permissions you are requiring? Are they not completing an action that could trigger virality? How far are they getting in their first user session? How much time are they spending per user session? Obviously, you'll be doing your fair share of bug squashing, but the core of it is around improving the core flows to minimize friction as much as possible. Lastly, keep in mind that even with highly motivated users, their attention spans and patience for early builds is limited, so make sure that each of your builds really make significant improvements. Happy to talk through any of this and more about mobile app testing.TW
-
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
-
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
-
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
-
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
the startups.com platform
Copyright © 2025 Startups.com. All rights reserved.