LaunchScreenViewController.swift 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // LaunchScreenViewController.swift
  3. // DigiNetS
  4. //
  5. // Created by Qindi on 31/08/22.
  6. //
  7. import UIKit
  8. import NotificationBannerSwift
  9. import NexilisLite
  10. class LaunchScreenViewController: UIViewController {
  11. @IBOutlet weak var imageSS: UIImageView!
  12. override func viewDidLoad() {
  13. super.viewDidLoad()
  14. if !CheckConnection.isConnectedToNetwork() {
  15. let imageView = UIImageView(image: UIImage(systemName: "xmark.circle.fill"))
  16. imageView.tintColor = .white
  17. let banner = FloatingNotificationBanner(title: "Check your connection".localized(), subtitle: nil, titleFont: UIFont.systemFont(ofSize: 16), titleColor: nil, titleTextAlign: .left, subtitleFont: nil, subtitleColor: nil, subtitleTextAlign: nil, leftView: imageView, rightView: nil, style: .danger, colors: nil, iconPosition: .center)
  18. banner.show()
  19. return
  20. }
  21. if PrefsUtil.getIconDock() != nil {
  22. let data = try? Data(contentsOf: URL(string: PrefsUtil.getUrlDock()!)!) //make sure your image in this url does exist, otherwise unwrap in a if let check / try-catch
  23. if data != nil {
  24. imageSS.image = UIImage(data: data!)
  25. }
  26. }
  27. }
  28. }