Please.
I am currently implementing UITableViewCell, but how do I configure two labels in one cell?
With just one Cell,
override functableView(_tableView:UITableView, cellForRowAtindexPath:IndexPath)->UITableViewCell{
let_cell=tableView.dueReusableCell(withIdentifier:cellIdentifier, for:indexPath) as UITableViewCell
letcell=_cell
cell.textLabel?.text="a"
return cell
}
I can do it with , but how can I implement it if I want to display another character in the same cell?
***Additional ***
Create a cell instance,
<variable name>:label=cell.viewWithTag(x)as?UILabel
In , I set up a tag for each object and specified it in viewWithTag().
Could you ask me one additional question?
I often hear MagicNumber, but I don't think this kind of coating is a problem for individuals, but will it be effective for development involving people other than myself?Or is there an efficient method that is easier to understand?This may be an abstract question, but I appreciate your cooperation.
I often hear MagicNumber, but I don't think this kind of coating is a problem for individuals, but will this kind of method be effective for development involving people other than myself?
The problem with magic numbers is that you can't read only the code such as "why" and so on, so
Enable variable names to convey intentions
1.08*price=>(1+tax)*price
Write the reason for this in the comments
It can be avoided in such a way as
I will add additional information below the question.
I think it will be easier to get answers including the title if you ask again
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
581 PHP ssh2_scp_send fails to send files as intended
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
© 2024 OneMinuteCode. All rights reserved.