AlarmViewController.swift 931 B

1234567891011121314151617181920212223242526272829
  1. // LoopFollow
  2. // AlarmViewController.swift
  3. import SwiftUI
  4. import UIKit
  5. class AlarmViewController: UIViewController {
  6. override func viewDidLoad() {
  7. super.viewDidLoad()
  8. let alarmsView = AlarmsContainerView()
  9. let hostingController = UIHostingController(rootView: alarmsView)
  10. addChild(hostingController)
  11. view.addSubview(hostingController.view)
  12. hostingController.view.translatesAutoresizingMaskIntoConstraints = false
  13. NSLayoutConstraint.activate([
  14. hostingController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
  15. hostingController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor),
  16. hostingController.view.topAnchor.constraint(equalTo: view.topAnchor),
  17. hostingController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
  18. ])
  19. hostingController.didMove(toParent: self)
  20. }
  21. }