Tuesday, January 30, 2024
HomeiOS Developmentios - Easy methods to make a UIButton on A View.xib with...

ios – Easy methods to make a UIButton on A View.xib with swipe function go to a ViewController


I’ve created a View.xib file that accommodates a UILabel and UIButton. And a ViewController that accommodates a web page management swipe function that references the UILabel and UIButton. I’ve created 3 pages for this function, after I swipe UILabel shows completely different textual content on every web page. How do I do that for the UILabel to go to completely different ViewControllers for every of the three pages.

View.swift code

class View: UIView {

@IBOutlet weak var title: UILabel!
@IBOutlet weak var propertyInfo: UIButton!

ViewController code

var pages : [View] {
    
    get {
let page1: View = Bundle.predominant.loadNibNamed("View", proprietor: self, choices: nil)?.first as! View
        page1.title.textual content = "ApartmentA3"
let page2: View = Bundle.predominant.loadNibNamed("View", proprietor: self, choices: nil)?.first as! View
        page2.title.textual content = "APARTMENT A4"
let page3: View = Bundle.predominant.loadNibNamed("View", proprietor: self, choices: nil)?.first as! View
        page3.title.textual content = "APARTMENT A5"
return [page1, page2, page3]
    }



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments