> 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/en/widget-integration/ios-swift-sdk/pin-pad-library/init.md).

# Initialization

The method for initializing the Wepin iOS PIN Pad Library is as follows.

Before creating an instance of `WepinPin`, please pass the App ID and App Key to the `WepinPinParams` object as shown below.

```swift
let initPinParam = WepinPinParams(appId: appId, appKey: appKey)
```

Please create a `WepinPin` instance by passing the previously created `WepinPinParams`.

```swift
var wepinPin = WepinPin(initPinParam);
```

After creating the `WepinPin` instance, call the `initialize` method to complete the initialization.

```swift
await wepinPin?.initialize(attributes: attributes)
```

#### parameters

&#x20;`attributes` \<WepinPinAttributes>

* `language` \<String>\
  The default language setting for the PIN pad screen is `'en'`. Currently supported languages are `'ko'`, `'en'`, and `'ja'`.

#### Return value

`<Bool>`\
Returns **true** if successful, and **false** if it fails.

### Example

```swift
let appKey: String = "Wepin-App-Key"
let appId: String = "Wepin-App-ID"
var wepinPin: WepinPin? = nil
let initPinParam = WepinPinParams(appId: appId, appKey: appKey)
wepinPin = WepinPin(initPinParam)
// Call initialize function
let attributes = WepinPinAttributes(language: "en")
if let res = try await wepinPin?.initialize(attributes: attributes) {
    self.tvResult.text = "Successed: \(res)"
} else {
    self.tvResult.text = "Failed: No result returned from initialization"
}
```

## isInitialized

You can use the `isInitialized` method to check if the `WepinPin` instance has been successfully initialized.

* \<Bool>\
  Returns **true** if initialization was successful and **false** if it failed.

```swift
let result = wepinPin!.isInitialized()
```

## changeLanguage

```swift
wepinPin!.changeLanguage(language: "ko")
```

Changes the language displayed on the PIN pad screen. Currently, only `'ko'`, `'en'`, and `'ja'` are supported.<br>

**Parameters**

* &#x20;`language` \<String>

### **Return value**

* \<Void>

### Example

```swift
wepinPin!.changeLanguage(language: "ko")
```


---

# 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/en/widget-integration/ios-swift-sdk/pin-pad-library/init.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.
