Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
¿Cómo agregar Pull para actualizar el controlador a la vista de desplazamiento?

Hola, en mi aplicación, quiero agregar Pull para actualizar el controlador a la vista de desplazamiento. Escribo el siguiente código pero no obtengo ninguna respuesta.

Cada vez que me desplazo por la vista en ese momento, no se llama al método de destino.

 @IBOutlet var scrool: UIScrollView! var refreshControl = UIRefreshControl() override func viewDidLoad() { super.viewDidLoad() // Add refresh control for the Home page scroll view. self.refreshControl.tintColor = UIColor.appcolor self.refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh") self.refreshControl.addTarget(self, action: #selector(refresh(sender:)), for: UIControl.Event.valueChanged) self.scrool.isScrollEnabled = true self.scrool.alwaysBounceVertical = true scrool.addSubview(refreshControl) } @objc func refresh(sender:AnyObject) { // Code to refresh table view self.getHomePageApi() refreshControl.endRefreshing() }
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Hola, resolví este problema cuando escribo este código en viewwillappear() excepto en la función viewdidload(), funcionará bien.

 var refreshControl:RefreshControl! override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) refreshControl = RefreshControl() refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged) scrool.refreshControl = refreshControl } @objc func refresh() { // Code to refresh table view refreshControl.endRefreshing() self.getHomePageApi() }
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda