Search
 
SCRIPT & CODE EXAMPLE
 

SWIFT

didSelectRowAt in table view

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    // 1: try loading the "Detail" view controller and typecasting it to be DetailViewController
    if let vc = storyboard?.instantiateViewController(withIdentifier: "Detail") as? DetailViewController {
        // 2: success! Set its selectedImage property
        vc.selectedImage = pictures[indexPath.row]

        // 3: now push it onto the navigation controller
        navigationController?.pushViewController(vc, animated: true)
    }
}
Comment

PREVIOUS NEXT
Code Example
Swift :: load image from url in Image swiftui (iOS 15) 
Swift :: swft image 
Swift :: uilabel make bold 
Swift :: swiftui popover 
Swift :: swift pdf thumbnail 
Swift :: swift infinite while loop 
Swift :: switch button swift 5 
Swift :: swiftui crop image 
Swift :: how to make text selectable swiftui 
Swift :: timer in swift stack overflow 
Swift :: setting a local notification at specific time every day swift 
Swift :: and or in swift 
Swift :: swift how to set warning message 
Swift :: adding label to navigation bar 
Swift :: how to loop in swift 
Swift :: Swift Access Array Elements 
Swift :: Swift Remove an Element from a Set 
Swift :: Working of Recursion in Swift 
Swift :: rotate sfsymbol horizontal flip swiftui 
Swift :: command compileswift failed with a nonzero exit code 
Swift :: map vs compactmap in swiftui 
Swift :: Swift Escape Sequences 
Swift :: swiftui slide menu 
Swift :: swift how to append an element 
Swift :: key path expression as functions ios swift 
Swift :: octobercms add extra slash to css url 
Swift :: how to convert a url to string in swift 
Ruby :: rails delete child on parent delete 
Ruby :: rails delete link 
Ruby :: ruby check if block given 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =