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
-
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
-
For our new social app, should we focus on capturing more user data upon registration or simplifying the process to increase our potential user base?
Try not to think of your "conversion" as a single instance in your app users experience, but a series of nodes that have no try end point. Starting with the on-boarding process after they've DL'd the app it's important to understand what your conversion funnel looks like sequentially. For example, try breaking out the content into a few input opportunities so users can give you the base-level info (and not impede signups or frustrate the process before they get into seeing the value of the app); inversely some users may want to put it all up front, so giving them an outlet to do that as a work-around to your sequenced process may be advisable. Like with most apps, it depends on the types of users you are targeting, but generally speaking try not to create too many roadblocks early on (if your primary goal is first growing total users.) If this is a problem you have already encountered on the app then I'd seek a quick fix remedy for the time being (even as simple as some text and link/CTA that takes them off that part of the screen but refer them later to it via a message etc.) either way though there are some interesting things you can do to find the right solution(s) to this and calibrate over time - things such as doing A/B or MVT testing with your layout options, using push notifications, gamifying user input etc can all be tools at your disposal to find and solve these sorts of issues. Tying this to investor preferences too is an important (but nuanced) tightrope to walk. Other factors such as security should certainly be taken into account, the exercise here is to lay out all of these details and find ways to test/validate your assumptions and solutions. As to what a potential investor prefers, oftentimes that boils down to the individual group or person you're pitching, the context you choose to provide on your chosen path and how effective you are at providing that context. But the question you ask is a classic one in app development - do you focus on the denominator (total users) first or on the numerator (the activity of what those users are doing.) there are arguments to be made for both, but you have to think what the most compelling narrative is for your app purpose and investor audience. I've worked with many app-preneurs to build and maintain their conversion funnels/apps and maximize UGC/engagement (as well as go on to raise about a total of $250M+ in aggregate across venture financing paths); so if you'd like to talk about any other details feel free to reach out. good luck!JG
-
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
-
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.