# 새 프로젝트 설정(iOS)

## 준비 사항

* Project ID (Service ID) [키 발급](https://devguide.remotemonster.com/livestreamingplatform/tutorial-simplelivestreaming-viewer/create-key)
* Xcode 개발 환경
* iOS 10.0 이상

## 새 프로젝트 생성 및 설정

Xcode에서 Swift기반의 새 프로젝트를 생성합니다.

프로젝트 생성 후 `Build Settings`에서 `Enable Bitcode`를 `No`로 선택합니다.

![Bitcode](https://3811894497-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrdAZk9HNSaEEQb594k%2F-LsGD4SKrlMCZkKqDlLh%2F-LsGD6-_4vcyQdtK88NI%2Fios-getting-started-010-enable_bitcode.png?generation=1572246946136164\&alt=media)

Objective-C 환경이라면 ALWAYS\_EMBED\_SWIFT\_STANDARD\_LIBRARIES를 Yes로 선택합니다.

![ALWAYS\_EMBED\_SWIFT\_STANDARD\_LIBRARIES](https://3811894497-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrdAZk9HNSaEEQb594k%2F-LsGD4SKrlMCZkKqDlLh%2F-LsGD6-bjWRwTt861Qjr%2Fios-getting-started-020-alway_embed_swift_standard_libraries.png?generation=1572246946030740\&alt=media)

또한 Info.plist에서 다음 항목을 required로 선택합니다.

* Privacy: Bluetooth, Microphone, Camera

![Settings](https://3811894497-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrdAZk9HNSaEEQb594k%2F-LsGD4SKrlMCZkKqDlLh%2F-LsGD6-dWy-6MLgYBTzD%2Fios-getting-started-030-privacy.png?generation=1572246945718714\&alt=media)

## Cocoapods를 이용하여 SDK 설치

`Podfile`에 `pod 'RemoteMonster', '~> 2.6.11'`을 추가합니다.

{% code title="Podfile" %}

```
target 'MyApp' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!
  pod 'RemoteMonster', '~> 2.6.11'
end
```

{% endcode %}

Podfile 수정 후 터미널에서 `pod install` 를 실행합니다. 필요 시 `pod update`를 실행합니다.

```bash
$ pod install
```

업데이트가 정상적으로 이루어지지 않는 경우 cocoapods의 로컬 저장소를 먼저 업데이트 후 사용해 보시기 바랍니다.

```
$ pod repo update
$ pod update
```

## 수동으로 import하여 SDK 설치

아래의 링크를 통해 iOS SDK의 최신 버전을 다운로드 받아 풀어 놓습니다.

{% embed url="<https://github.com/remotemonster/ios-sdk>" %}

RemoteMonster iOS SDK 폴더 안에 다음 3개의 폴더가 있습니다. 이 3개의 폴더를 프로젝트 트리창에 놓습니다.

```
RemoteMonster.framework
SwiftProtobuf.framework
WebRTC.framework
```

![Framework](https://3811894497-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrdAZk9HNSaEEQb594k%2F-LsGD4SKrlMCZkKqDlLh%2F-LsGD6-fPfhc82Nr5nld%2Fios-getting-started-040-import.png?generation=1572246945376908\&alt=media)

Build Phases에 Copy Files 항목을 추가 하고, 위 단계에서 추가한 Frameworks를 복사 대상으로 추가 하여 줍니다.

![Copy Frameworks](https://3811894497-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrdAZk9HNSaEEQb594k%2F-LsGD4SKrlMCZkKqDlLh%2F-LsGD6-h3WKa818wbEZY%2Fios-getting-started-050-build_phases_copy_files_frameworks.png?generation=1572246943743465\&alt=media)

## Service Id, Service Key 입력

* 스토리보드 파일을 열어 `RemonCall`을 추가합니다.
  * Xcode의 네비게이터 영역에서 스토리보드 파일을 찾아 엽니다. Object 컴포넌트를 삽입 후 Class를 RemonCall으로, Module은 RemoteMonster로 수정합니다.

![](https://3811894497-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrdAZk9HNSaEEQb594k%2F-LsGb_qcTVL-ggde67pw%2F-LsGbb9A2jNkr1RAbP6T%2Fios-getting-started-060-storyboard_insert_remonclass.png?generation=1572253628300156\&alt=media)

* Xcode의 유틸리티 영역에서 `Service Id`와 `Service Key`를 입력합니다.

![](https://3811894497-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrdAZk9HNSaEEQb594k%2F-LsGD4SKrlMCZkKqDlLh%2F-LsGD6-jVrUp8bQvLxQl%2Fios-getting-started-070-serviceid_key.png?generation=1572246945455928\&alt=media)

프로젝트 설정을 완료했습니다. 이어서 기능을 구현에 대해 알아봅니다.

[단순 통화 앱 만들기(iOS)](https://github.com/RemoteMonster/remon-devguide-ko-2019/tree/f32c3e15637cf2b089461da0c2b5c5b8b154cbe3/livestreamingplatform/tutorial-simplelivestreaming-viewer/simplevideocall-code-ios.md)
