title: reading UserDefaults before init() or inside of init()
body: <p>I'm having a problem getting my default_ip from my UserDefaults to a SocketManager.</p>
  <pre><code>final class Service: ObservableObject{    
      let defaults = UserDefaults.init(suiteName: &quot;group.com.Scheduled-countdown.settings&quot;)
      let manager = SocketManager(socketURL: URL(string: &quot;http://172.20.10.4:3000&quot;)!, config: [.log(false),.compress,.path(&quot;/ws&quot;)])
  
      init(){
          let default_ip = defaults?.string(forKey: &quot;ip_adress&quot;) ?? &quot;Nothing&quot;
          let ipString : String = &quot;http://\(default_ip):3000&quot;
          //let manager = SocketManager(socketURL: URL(string: ipString)!, config: [.log(false),.compress,.path(&quot;/ws&quot;)])
          
          print(ipString)
          print(default_ip)
       }
  }
  </code></pre>
  <p>if I have the SocketManager above init() it connects but I can't have the default_ip because above because it says</p>
  <blockquote>
  <p>Cannot use instance member 'defaults' within property initializer;
  property initializers run before 'self' is available</p>
  </blockquote>
  <p>So how would I fix this?</p>
  <p>I also uploaded the video to show the problem
  <a href="https://www.youtube.com/watch?v=teqr20AnTVM" rel="nofollow noreferrer">https://www.youtube.com/watch?v=teqr20AnTVM</a></p>