Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

239
Views
Agregar subvista en la parte superior de cada ViewController

Quiero colocar una UIView personalizada sobre cada pantalla del controlador de vista. Quiero hacer esto para mostrar el progreso de la descarga del video. Creo una vista personalizada usando xib y uso este código:

 let window = UIApplication.shared.keyWindow! window.subviews(CustomView)

pero este código no funciona para resolver este problema.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Puede escribir este código para agregar la subvista en el controlador de vista.

 let window = UIApplication.shared.keyWindow! window.addSubview(CustomView)
over 4 years ago · Santiago Trujillo Report

0

UIApplication.topWindow.addSubview(CustomView) extension UIApplication { static var topWindow: UIWindow { if #available(iOS 15.0, *) { let scenes = UIApplication.shared.connectedScenes let windowScene = scenes.first as? UIWindowScene return windowScene!.windows.first! } return UIApplication.shared.windows.filter { $0.isKeyWindow }.first! } }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!