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

179
Views
How to properly animate SCNView height?

I'm trying to animate SCNView height, but it seems like there are some visual issue.

When content is growing it looks like everything is ok, but when I'm trying to decrease the height, view just jumps to final height instantly.

let newHeight = scene.frame.height + (open ? 100.0 : -100.0)
UIView.animate(withDuration: 1.0, animations: {
    self.scene.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: newHeight)
}) { finished in
    self.open = !self.open
}

See Code Running in Sumulator

With regular view everything works fine.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Set contentMode of SCNView to .scaleToFill where needed (e.g. in viewDidLoad). It works as expected.

let view: SCNView 
...
view.contentMode = .scaleToFill
over 4 years ago · Santiago Trujillo Report

0

There is a relationship between this behavior and the content mode of scene. You may try:

             scene.contentMode = .scaleToFill
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!