# CocoaPods로 InboxUI 설정하기

<Aside type="caution" title="레거시 모듈">
Pushwoosh InboxUI는 이전 버전과의 호환성을 위해 유지됩니다. 새 프로젝트에서는 최신 UIKit 대체품인 [Pushwoosh InboxKit](/ko/developer/pushwoosh-sdk/ios-sdk/setting-up-pushwoosh-inboxkit-ios/)을 사용하세요.
</Aside>

1\. 프로젝트 디렉터리의 터미널에서 '**pod init**' 명령을 실행합니다.

2\. 새로 생성된 Podfile을 엽니다.

3\. 프로젝트 이름 대상 아래에 Pushwoosh 종속성을 추가합니다:

```ruby
# Uncomment the next line to define a global platform for your project 
# platform: ios, ‘9.0’

target ‘MyApp’ do 
   # Comment the next line if you don’t want to use dynamic frameworks 
   use_frameworks!

   # Pods for MyApp
   pod 'PushwooshInboxUI'

end
```

<Aside type="note">
_PushwooshInboxUI.xcframework_를 사용하려면 Podfile에 **pod 'PushwooshInboxUIXCFramework'**를 사용하세요.



**Catalyst 통합**

Catalyst는 .xcframework를 사용하므로 **Pushwoosh** 대신 **PushwooshXCFramework** pod를 사용해야 합니다:

```
pod 'PushwooshXCFramework'
```
</Aside>

4\. 프로젝트 디렉터리의 터미널에서 다음 명령을 실행합니다:

```
pod install
```

5\. 새로 생성된 \<_your_project_name_\>**.xcworkspace** 파일을 엽니다.

6\. 잘했습니다! 이제 프로젝트에 Pushwoosh InboxUI를 통합했습니다.

## Pushwoosh InboxUI 코드 추가

앱에 Inbox UI를 표시하려면 Inbox 뷰 컨트롤러를 추가하세요:

<Tabs syncKey="code-example">
<TabItem label="Swift">
```swift
self.navigationController?.pushViewController(PWIInboxUI.createInboxController(with: PWIInboxStyle.default()), animated: true)
```
</TabItem>

<TabItem label="Objective-C">
```objective-c
[self.navigationController pushViewController:[PWIInboxUI createInboxControllerWithStyle:[PWIInboxStyle  defaultStyle]] animated:YES];
```
</TabItem>
</Tabs>

Inbox가 앱의 모양과 일치하도록 하려면 `PWIInboxStyle`의 파라미터를 변경하세요. 글꼴, 배경색 등과 같은 파라미터를 사용자 정의할 수 있습니다.

<Tabs syncKey="code-example">
<TabItem label="Swift">
```swift
//creating a new Inbox style
let inboxStyle = PWIInboxStyle.customStyle(withDefaultImageIcon: UIImage.init(named: "custom_image"),
textColor: UIColor.darkText,
accentColor: UIColor.blue,
font: UIFont.systemFont(ofSize: 17))

inboxStyle?.backgroundColor = UIColor.init(white: 1, alpha: 1)
inboxStyle?.listErrorMessage = NSLocalizedString("Custom error message", comment: "Custom error message")
inboxStyle?.listEmptyMessage = NSLocalizedString("Custom empty message", comment: "Custom empty message")

PWIInboxStyle.setupDefaultStyle(inboxStyle)
```
</TabItem>

<TabItem label="Objective-C">
```objective-c
//creating a new Inbox style
PWIInboxStyle *inboxStyle = [PWIInboxStyle  customStyleWithDefaultImageIcon:[UIImage imageNamed:@"custom_image"]
textColor:UIColor.darkTextColor
accentColor:UIColor.blueColor
font:[UIFont systemFontOfSize:17]];

inboxStyle.backgroundColor = [UIColor colorWithWhite:1 alpha:1];
inboxStyle.listErrorMessage = NSLocalizedString(@"Custom error message", @"Custom error message");
inboxStyle.listEmptyMessage = NSLocalizedString(@"Custom empty message", @"Custom empty message");

[PWIInboxStyle setupDefaultStyle:inboxStyle];
```
</TabItem>
</Tabs>

## 사용자 정의

Inbox UI 스타일을 사용자 정의하려면 다음을 참조하세요:

<LinkCard
  title="PWIInboxStyle.h"
  href="https://github.com/Pushwoosh/pushwoosh-ios-sdk/blob/master/iOS_SDK/PushwooshInboxUI/PushwooshInboxUI/Public/PWIInboxStyle.h"
/>

<LinkCard
  title="PWIInboxUI.h"
  href="https://github.com/Pushwoosh/pushwoosh-ios-sdk/blob/master/iOS_SDK/PushwooshInboxUI/PushwooshInboxUI/Public/PWIInboxUI.h"
/>


자세한 내용은 [Inbox 샘플](https://github.com/Pushwoosh/pushwoosh-quickstart-ios/tree/main/inbox)을 참조하세요.