title: Initializers may only be declared within a type swift 3
body: <p>I got problem with writing a function in a class. I create a class with initialiser and I try to create function, but I am getting the error, wit initializer, could you help me? </p>
  
  <blockquote>
    <p>Initializers may only be declared within a type.</p>
  </blockquote>
  
  <p><strong>My code:</strong></p>
  
  <pre><code>class JsonParams {
  let Login_Token = "00000000000000000000000000000000"
  init() {
  }
  
  func Jsonrequests (userName: String, password: String){
  
      let param : [String: Any] = ["jsonrpc": "2.0", "id": 1, "method": "call", "params": [ self.Login_Token, "session", "login", [ "username": self.userName, "password": self.password]]]
      self.param = param
  
      return
  }
  </code></pre>