> For the complete documentation index, see [llms.txt](https://nsl-solution.gitbook.io/livesolution/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nsl-solution.gitbook.io/livesolution/viewer/sdk-ios/4.0.10-greater-than-4.9.10.md).

# 4.0.10 -> 4.9.10 마이그레이션 가이드

### 1. ShoppingLive.shared 제거

ShoppingLive.shared.xx 를 ShoppingLive.xx 형태로 변경하였습니다.

```swift
// AS-IS
ShoppingLive.shared.cartUrl = "https://www.someURL.com"
ShoppingLive.shared.onViewerStarted = onViewerStarted
ShoppingLive.shared.showToastMessage(message: "안녕하세요")

// TO-BE
ShoppingLive.cartUrl = "https://www.someURL.com"
ShoppingLive.onViewerStarted = onViewerStarted
ShoppingLive.showToastMessage(message: "안녕하세요")
```

초기화 & 설정 부분은 다음과 같이 변경되었습니다.

```swift
// AS-IS
ShoppingLive.shared.lottieClass = SomethingLottieView.self

// TO-BE
ShoppingLive.setLottieClass(LottieAnimationView.self)
```

### 2. 콜백 메소드 변경

숏클립 방송 타입이 추가되면서 id 이외에 viewerType 항목이 같이 전달됩니다.

viewerType은 "LIVE", "REPLAY", "SHORTCLIP" 값이 제공됩니다.

```swift
// AS-IS
func onViewerStarted(broadcastId: Int)
func onViewerFinished(broadcastId: Int, status: String)
func onBroadcastChanged(previousBroadcastId: Int, currentBroadcastId: Int)

// TO-BE
func onViewerStarted(id: Int, viewerType: String)
func onViewerFinished(id: Int, viewerType: String, status: String?)
func onBroadcastChanged(previousId: Int, previousViewerType: String, currentId: Int, currentViewerType: String)
```

### 3. startPIP() -> presentPIP()

뷰어를 PIP 전환하기 위한 메소드명이 변경되었습니다.

```swift
// AS-IS
ShoppingLive.shared.startPIP()

// TO-BE
ShoppingLive.presentPIP()
```
