> For the complete documentation index, see [llms.txt](https://docs.wepin.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wepin.io/deprecated/ios-swift-sdk/methods.md).

# 메서드

Wepin widget iOS SDK에서 제공하는 메서드 입니다.

## openWidget

<mark style="color:blue;">`openWidget`</mark> 는 위젯 윈도우를 보여 줍니다. 사용자 로그인 여부에 따라 위젯 윈도우에 표시되는 화면은 다릅니다. 로그인이 되어 있지 않으면 로그인 화면이 표시됩니다.

### 예시

```swift
let wepin = Wepin.instance()
wepin.openWidget(){ (result, error) -> Void in
    if let _ = error {
        // Do error handling
        return 
    }
}
```

## closeWidget

<mark style="color:blue;">`closeWidget`</mark> 는 위젯 윈도우를 닫습니다. 윈도우를 닫아도 로그아웃 되지 않습니다.&#x20;

### 예시

```swift
let wepin = Wepin.instance()
wepin.closeWidget(){ (result, error) -> Void in
    if let _ = error {
        // Do error handling
        return 
    }
}
```

## getAccounts

앱에서 사용 가능한 계정 정보를 받습니다.  계정 정보에는 네트워크 이름과 주소가 들어 있습니다. 계정반정보는환 <mark style="color:blue;">`Account`</mark>의 배열입니다. <mark style="color:blue;">`getAccounts`</mark> 는 위젯 로그인 이후에 사용 가능한 메서드입니다. &#x20;

<pre class="language-swift"><code class="lang-swift"><strong>let wepin = Wepin.instance()
</strong><strong>wepin.getAccounts() { (accounts, error) -> Void in
</strong><strong>    if let _ = error {
</strong><strong>        // Do error handling
</strong><strong>        return
</strong><strong>    }
</strong><strong>    // Do something with accounts 
</strong><strong>}
</strong></code></pre>

### Account

<mark style="color:blue;">`getAccounts`</mark> 함수의 반환 값 클래스의 인터페이스는 아래와 같습니다.

```swift
public struct Account {
    var address: String;  // 계정주소
    var network: String;  // 계정 블록체인 네트워크
}
```

* **address:** *string*\
  계정 주소
* **network**: *string*\
  계정의 블록체인 네트워크 입니다. 각 네트워크의 이름은 아래에서 확인 가능합니다.&#x20;

{% content-ref url="/pages/jNG611rZkq69C8zZKglh" %}
[지원 블록체인](/wepin/supported-blockchains.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wepin.io/deprecated/ios-swift-sdk/methods.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
