Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stack Overflow Answer 2

This is an answer to Stack Overflow question here where the questioner was asking how to update a cell in a UITableView. This demo shows how to connect data to UI using ALTableViewHelper available on Framework Central, and so remove the need for any code to copy the data when it updates.

The main 'engine' is this section:

tableView.setHelperString("""
section
    headertext "Conversation Status"
    body
        Conversation
            $.viewWithTag(1).text <~ conversations[conversations.count-1]["title"]
            $.viewWithTag(2).text <~ "At \\(dateFormat.stringFromDate(conversations[conversations.count-1]["update"]))"
        UpdateButton
            $.viewWithTag(1).isAnimating <~ FakeConversationGetter.singleton.busy
""", context: self)

where the data is connected with the UI. Filling and updating the UITableView is fully handled once the connections are described.

$ is the view added, and <~ is the 'connect this to that' operator.

What isn't shown in this example is that sections and section views can be 'multiplied' by the contents of arrays - one section or view for each array member.

Releases

Packages

Contributors

Languages