Skip to content

Instantly share code, notes, and snippets.

@yccheok
Created September 9, 2024 19:55
Show Gist options
  • Save yccheok/f72761cb53c100145a6b025cdb9dcc91 to your computer and use it in GitHub Desktop.
Save yccheok/f72761cb53c100145a6b025cdb9dcc91 to your computer and use it in GitHub Desktop.
class OnboardingViewControllerTemplate: UIViewController {
@IBOutlet weak var demoImageView: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
print(">>>> self.demoImageView.bounds.width \(self.demoImageView.bounds.width)")
demoImageView.subviews.forEach({ $0.removeFromSuperview() })
let v = GradientView()
v.frame = CGRect(
x: 0,
y: self.demoImageView.bounds.height - 100,
width: self.demoImageView.bounds.width,
height: 100
)
self.demoImageView.addSubview(v)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment