> For the complete documentation index, see [llms.txt](https://docs.wishi.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wishi.me/the-formal-stuff/ios-sdk/public-protocols.md).

# Public protocols

**Once the user tap on an icon - callback**

<pre class="language-swift"><code class="lang-swift"><strong>func onItemClick(url: String) {}
</strong></code></pre>

**Error handling**

```swift
func sdkFailure(error: SDKError) {}
// interface
public enum SDKError: Error {
    case sdkNotInitialized
    case missingClientInfoAndUserData
    case missingClientId
    case failToInitSDK
    case failToAuthenticate
    case failToGenerateToken
    case failToGetUserStatus
}
```

**ViewController presented on host application**

```swift
func presented(viewController: UIViewController) {}
```

**Selecting items callback**

```swift
 func didSelectItems(fromController controller: QuizViewController, quizObject: WSQuiz, selectedOptions: [WSQuizAnswer], lastSelectedOption: WSQuizAnswer) {
            
 }
```

**screen selection is done- callback**

```swift
func screenSelectionDone(fromController controller: QuizViewController, quizObject: WSQuiz, selectedOptions: [WSQuizAnswer]) {
        
    }
```

**No new messages to read - callback**

```swift
// callback will be called once message queue (user read all messages inside)
func onReadMessages(unreadMessage: Int) {}

```
