├── README.md └── Smitch ├── .gitignore ├── Broadcast ├── Broadcast.entitlements ├── Info.plist └── SampleHandler.swift ├── Podfile ├── Podfile.lock ├── Smitch.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── cardoso.xcuserdatad │ │ └── UserInterfaceState.xcuserstate ├── xcshareddata │ └── xcschemes │ │ ├── Broadcast.xcscheme │ │ ├── BroadcastSetupUI.xcscheme │ │ └── Smitch.xcscheme └── xcuserdata │ └── cardoso.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── Smitch.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── cardoso.xcuserdatad │ ├── IDEFindNavigatorScopes.plist │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist └── Smitch ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ └── Contents.json └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Info.plist ├── Join ├── JoinViewController+Constraints.swift ├── JoinViewController+Handlers.swift ├── JoinViewController+Views.swift └── JoinViewController.swift ├── Smitch.entitlements ├── Watch ├── WatchViewController+Chat.swift ├── WatchViewController+Constraints.swift ├── WatchViewController+Stream.swift ├── WatchViewController+StreamDelegate.swift ├── WatchViewController+Views.swift └── WatchViewController.swift └── generateUserId.swift /README.md: -------------------------------------------------------------------------------- 1 | # 💬 Twitch Clone App with Stream Chat and Dolby.io [![](https://img.shields.io/twitter/url?url=https%3A%2F%2Fgithub.com%2FGetStream%2Ftwitch-example-ios)](https://twitter.com/intent/tweet?text=Want%20to%20build%20an%20app%20similar%20to%20Twitch%20for%20iOS%3F%20Learn%20how%3A&url=https%3A%2F%2Fgithub.com%2FGetStream%2Ftwitch-example-ios) 2 | 3 | 4 | 5 | ## 📚 Tutorial 6 | 7 | This repository contains the completed Xcode project following the [How to Build a Twitch Clone Game Live Streaming App for iOS](https://getstream.io/blog/twitch-game-livestreaming-app-tutorial-ios/) tutorial. You should read it before trying to run this project as it contains it may contain useful information not present in this README. 8 | 9 | ## ⚙️ Setup 10 | 11 | ## Requirements 12 | - Xcode 11+ 13 | - iOS 13+ 14 | - A [Stream](https://getstream.io/accounts/signup/) account 15 | - A [Dolby.io](https://dolby.io/organizations/register) account 16 | 17 | ### Configuration 18 | 19 | You should place your [Stream Chat](https://getstream.io/chat) and [Dolby.io](https://dolby.io) credentials in [`AppDelegate.swift`](Smitch/Smitch/AppDelegate.swift#L18-#L23). 20 | 21 | ### Dependencies 22 | 23 | To install the dependencies, use CocoaPods in the Smitch folder: 24 | 25 | ```bash 26 | $ pod install --repo-update 27 | ``` 28 | 29 | ### Running 30 | 31 | Run this sample app as any normal app, but only on real devices. If you run in a simulator, the chat will work, but you won't be able to watch or stream your screen due to limitations of the simulator. 32 | 33 | ## 🔗 Helpful Links 34 | 35 | - [Build an iMessage Clone with The Stream Chat iOS SDK](https://getstream.io/blog/build-imessage-clone/) 36 | - [Stream Chat iOS Tutorial](https://getstream.io/tutorials/ios-chat/) 37 | - [Stream Chat iOS Repo](https://github.com/GetStream/stream-chat-swift) 38 | - [Stream Chat iOS Docs](http://getstream.io/chat/docs?language=swift) 39 | -------------------------------------------------------------------------------- /Smitch/.gitignore: -------------------------------------------------------------------------------- 1 | Pods 2 | -------------------------------------------------------------------------------- /Smitch/Broadcast/Broadcast.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.application-groups 6 | 7 | group.so.cardo.Smitch.Group 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Smitch/Broadcast/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Broadcast 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | NSExtension 24 | 25 | NSExtensionPointIdentifier 26 | com.apple.broadcast-services-upload 27 | NSExtensionPrincipalClass 28 | $(PRODUCT_MODULE_NAME).SampleHandler 29 | RPBroadcastProcessMode 30 | RPBroadcastProcessModeSampleBuffer 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /Smitch/Broadcast/SampleHandler.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SampleHandler.swift 3 | // Broadcast 4 | // 5 | // Created by Matheus Cardoso on 5/24/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | import ReplayKit 10 | import VoxeetScreenShareKit 11 | class SampleHandler: RPBroadcastSampleHandler, VoxeetScreenShareKitDelegate { 12 | private var screenShareService: VoxeetScreenShareKit? 13 | override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) { 14 | screenShareService = VoxeetScreenShareKit(appGroup: "group.so.cardo.Smitch.Group") 15 | screenShareService?.delegate = self 16 | screenShareService?.broadcastStarted(withSetupInfo: setupInfo) 17 | } 18 | override func broadcastPaused() { 19 | screenShareService?.broadcastPaused() 20 | } 21 | override func broadcastResumed() { 22 | screenShareService?.broadcastResumed() 23 | } 24 | override func broadcastFinished() { 25 | screenShareService?.broadcastFinished() 26 | } 27 | override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) { 28 | screenShareService?.processSampleBuffer(sampleBuffer, with: sampleBufferType) 29 | } 30 | func finishBroadcastWithError(error: Error) { 31 | self.finishBroadcastWithError(error) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Smitch/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'Smitch' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for Smitch 9 | pod 'StreamChat', '~> 2.1' 10 | pod 'VoxeetSDK', '~> 2.3' 11 | pod 'VoxeetScreenShareKit', '~> 1.0' 12 | end 13 | -------------------------------------------------------------------------------- /Smitch/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Nuke (8.4.1) 3 | - RxCocoa (5.1.1): 4 | - RxRelay (~> 5) 5 | - RxSwift (~> 5) 6 | - RxGesture (3.0.2): 7 | - RxCocoa (~> 5.1) 8 | - RxSwift (~> 5.1) 9 | - RxRelay (5.1.1): 10 | - RxSwift (~> 5) 11 | - RxSwift (5.1.1) 12 | - SnapKit (5.0.1) 13 | - Starscream (3.1.1) 14 | - StreamChat (2.2.1): 15 | - Nuke (~> 8.4) 16 | - RxGesture (~> 3.0) 17 | - SnapKit (~> 5.0) 18 | - StreamChatCore (= 2.2.1) 19 | - SwiftyGif (~> 5.2.0) 20 | - StreamChatClient (2.2.1): 21 | - Starscream (~> 3.1) 22 | - StreamChatCore (2.2.1): 23 | - RxCocoa (~> 5.1) 24 | - RxSwift (~> 5.1) 25 | - StreamChatClient (= 2.2.1) 26 | - SwiftyGif (5.2.0) 27 | - VoxeetScreenShareKit (1.0.0) 28 | - VoxeetSDK (2.3.0) 29 | 30 | DEPENDENCIES: 31 | - StreamChat (~> 2.1) 32 | - VoxeetScreenShareKit (~> 1.0) 33 | - VoxeetSDK (~> 2.3) 34 | 35 | SPEC REPOS: 36 | trunk: 37 | - Nuke 38 | - RxCocoa 39 | - RxGesture 40 | - RxRelay 41 | - RxSwift 42 | - SnapKit 43 | - Starscream 44 | - StreamChat 45 | - StreamChatClient 46 | - StreamChatCore 47 | - SwiftyGif 48 | - VoxeetScreenShareKit 49 | - VoxeetSDK 50 | 51 | SPEC CHECKSUMS: 52 | Nuke: d780e3507a86b86c589ab3cc5cd302d5456f06fb 53 | RxCocoa: 32065309a38d29b5b0db858819b5bf9ef038b601 54 | RxGesture: d6bd7447ca3a596c7a9702a6a2b6a2bb5d8bae54 55 | RxRelay: d77f7d771495f43c556cbc43eebd1bb54d01e8e9 56 | RxSwift: 81470a2074fa8780320ea5fe4102807cb7118178 57 | SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb 58 | Starscream: 4bb2f9942274833f7b4d296a55504dcfc7edb7b0 59 | StreamChat: 4930b589810a17e1336f0a5fa15ebb52f02371e5 60 | StreamChatClient: 8a5e67f875ac6db1ecbd063574327b573b897722 61 | StreamChatCore: 703fc23bb9327cdc0f14ed29aa3b9a5fbb4b4053 62 | SwiftyGif: b85c6b33a9411859d9e1db998b6a8214aea942df 63 | VoxeetScreenShareKit: 2e53c58e0fa0099c3a8b091082c18a788d3b99ab 64 | VoxeetSDK: 1b580287e382c62e03000e6c810282bbbbf0537c 65 | 66 | PODFILE CHECKSUM: c43f06b96cef186785899bbb5faae2290b420626 67 | 68 | COCOAPODS: 1.9.1 69 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 51; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 11820D623B52D339D3248A67 /* Pods_Smitch.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 849933D164F6C200849F4445 /* Pods_Smitch.framework */; }; 11 | 8026C11124634ABB00F7F143 /* generateUserId.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8026C11024634ABB00F7F143 /* generateUserId.swift */; }; 12 | 80941BF72477561F00170C61 /* WatchViewController+Chat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80941BF62477561F00170C61 /* WatchViewController+Chat.swift */; }; 13 | 80941C21247B04B400170C61 /* WatchViewController+Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80941C20247B04B400170C61 /* WatchViewController+Stream.swift */; }; 14 | 80941C23247B051B00170C61 /* WatchViewController+StreamDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80941C22247B051B00170C61 /* WatchViewController+StreamDelegate.swift */; }; 15 | 80941C29247B318300170C61 /* ReplayKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80941BFE247AFD7000170C61 /* ReplayKit.framework */; }; 16 | 80941C2C247B318300170C61 /* SampleHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80941C2B247B318300170C61 /* SampleHandler.swift */; }; 17 | 80941C30247B318300170C61 /* Broadcast.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 80941C28247B318300170C61 /* Broadcast.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 18 | 80941C34247B319400170C61 /* VoxeetScreenShareKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 80941C1E247B004000170C61 /* VoxeetScreenShareKit.framework */; }; 19 | 80941C35247B319500170C61 /* VoxeetScreenShareKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 80941C1E247B004000170C61 /* VoxeetScreenShareKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 20 | 80A0B1A92461D449003ACDFD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80A0B1A82461D449003ACDFD /* AppDelegate.swift */; }; 21 | 80A0B1AD2461D449003ACDFD /* JoinViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80A0B1AC2461D449003ACDFD /* JoinViewController.swift */; }; 22 | 80A0B1B02461D449003ACDFD /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 80A0B1AE2461D449003ACDFD /* Main.storyboard */; }; 23 | 80A0B1B22461D44E003ACDFD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 80A0B1B12461D44E003ACDFD /* Assets.xcassets */; }; 24 | 80A0B1B52461D44E003ACDFD /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 80A0B1B32461D44E003ACDFD /* LaunchScreen.storyboard */; }; 25 | 80A0B1BF2461E80B003ACDFD /* WatchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80A0B1BE2461E80B003ACDFD /* WatchViewController.swift */; }; 26 | 80E00A642477213B000D4627 /* JoinViewController+Views.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80E00A632477213B000D4627 /* JoinViewController+Views.swift */; }; 27 | 80E00A662477218F000D4627 /* JoinViewController+Constraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80E00A652477218F000D4627 /* JoinViewController+Constraints.swift */; }; 28 | 80E00A68247721D8000D4627 /* JoinViewController+Handlers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80E00A67247721D8000D4627 /* JoinViewController+Handlers.swift */; }; 29 | 80E00A6B24772596000D4627 /* WatchViewController+Views.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80E00A6A24772596000D4627 /* WatchViewController+Views.swift */; }; 30 | 80E00A6D24772645000D4627 /* WatchViewController+Constraints.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80E00A6C24772645000D4627 /* WatchViewController+Constraints.swift */; }; 31 | /* End PBXBuildFile section */ 32 | 33 | /* Begin PBXContainerItemProxy section */ 34 | 80941C2E247B318300170C61 /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = 80A0B19D2461D448003ACDFD /* Project object */; 37 | proxyType = 1; 38 | remoteGlobalIDString = 80941C27247B318300170C61; 39 | remoteInfo = Broadcast; 40 | }; 41 | /* End PBXContainerItemProxy section */ 42 | 43 | /* Begin PBXCopyFilesBuildPhase section */ 44 | 80941C1C247AFD7100170C61 /* Embed App Extensions */ = { 45 | isa = PBXCopyFilesBuildPhase; 46 | buildActionMask = 2147483647; 47 | dstPath = ""; 48 | dstSubfolderSpec = 13; 49 | files = ( 50 | 80941C30247B318300170C61 /* Broadcast.appex in Embed App Extensions */, 51 | ); 52 | name = "Embed App Extensions"; 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | 80941C36247B319500170C61 /* Embed Frameworks */ = { 56 | isa = PBXCopyFilesBuildPhase; 57 | buildActionMask = 2147483647; 58 | dstPath = ""; 59 | dstSubfolderSpec = 10; 60 | files = ( 61 | 80941C35247B319500170C61 /* VoxeetScreenShareKit.framework in Embed Frameworks */, 62 | ); 63 | name = "Embed Frameworks"; 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXCopyFilesBuildPhase section */ 67 | 68 | /* Begin PBXFileReference section */ 69 | 8026C11024634ABB00F7F143 /* generateUserId.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = generateUserId.swift; sourceTree = ""; }; 70 | 80941BF62477561F00170C61 /* WatchViewController+Chat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WatchViewController+Chat.swift"; sourceTree = ""; }; 71 | 80941BF8247AFD0100170C61 /* Smitch.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Smitch.entitlements; sourceTree = ""; }; 72 | 80941BFE247AFD7000170C61 /* ReplayKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ReplayKit.framework; path = System/Library/Frameworks/ReplayKit.framework; sourceTree = SDKROOT; }; 73 | 80941C0A247AFD7100170C61 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 74 | 80941C1E247B004000170C61 /* VoxeetScreenShareKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = VoxeetScreenShareKit.framework; path = Pods/VoxeetScreenShareKit/VoxeetScreenShareKit.framework; sourceTree = ""; }; 75 | 80941C20247B04B400170C61 /* WatchViewController+Stream.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WatchViewController+Stream.swift"; sourceTree = ""; }; 76 | 80941C22247B051B00170C61 /* WatchViewController+StreamDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WatchViewController+StreamDelegate.swift"; sourceTree = ""; }; 77 | 80941C28247B318300170C61 /* Broadcast.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = Broadcast.appex; sourceTree = BUILT_PRODUCTS_DIR; }; 78 | 80941C2B247B318300170C61 /* SampleHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SampleHandler.swift; sourceTree = ""; }; 79 | 80941C2D247B318300170C61 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 80 | 80941C37247B323B00170C61 /* Broadcast.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Broadcast.entitlements; sourceTree = ""; }; 81 | 80A0B1A52461D449003ACDFD /* Smitch.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Smitch.app; sourceTree = BUILT_PRODUCTS_DIR; }; 82 | 80A0B1A82461D449003ACDFD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 83 | 80A0B1AC2461D449003ACDFD /* JoinViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JoinViewController.swift; sourceTree = ""; }; 84 | 80A0B1AF2461D449003ACDFD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 85 | 80A0B1B12461D44E003ACDFD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 86 | 80A0B1B42461D44E003ACDFD /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 87 | 80A0B1B62461D44E003ACDFD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 88 | 80A0B1BE2461E80B003ACDFD /* WatchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WatchViewController.swift; sourceTree = ""; }; 89 | 80E00A632477213B000D4627 /* JoinViewController+Views.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "JoinViewController+Views.swift"; sourceTree = ""; }; 90 | 80E00A652477218F000D4627 /* JoinViewController+Constraints.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "JoinViewController+Constraints.swift"; sourceTree = ""; }; 91 | 80E00A67247721D8000D4627 /* JoinViewController+Handlers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "JoinViewController+Handlers.swift"; sourceTree = ""; }; 92 | 80E00A6A24772596000D4627 /* WatchViewController+Views.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WatchViewController+Views.swift"; sourceTree = ""; }; 93 | 80E00A6C24772645000D4627 /* WatchViewController+Constraints.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WatchViewController+Constraints.swift"; sourceTree = ""; }; 94 | 849933D164F6C200849F4445 /* Pods_Smitch.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Smitch.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 95 | 946F7029FB00014E04303061 /* Pods-Smitch.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Smitch.debug.xcconfig"; path = "Target Support Files/Pods-Smitch/Pods-Smitch.debug.xcconfig"; sourceTree = ""; }; 96 | AB5269755A8F617DE6C25450 /* Pods-Smitch.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Smitch.release.xcconfig"; path = "Target Support Files/Pods-Smitch/Pods-Smitch.release.xcconfig"; sourceTree = ""; }; 97 | /* End PBXFileReference section */ 98 | 99 | /* Begin PBXFrameworksBuildPhase section */ 100 | 80941C25247B318300170C61 /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | 80941C34247B319400170C61 /* VoxeetScreenShareKit.framework in Frameworks */, 105 | 80941C29247B318300170C61 /* ReplayKit.framework in Frameworks */, 106 | ); 107 | runOnlyForDeploymentPostprocessing = 0; 108 | }; 109 | 80A0B1A22461D449003ACDFD /* Frameworks */ = { 110 | isa = PBXFrameworksBuildPhase; 111 | buildActionMask = 2147483647; 112 | files = ( 113 | 11820D623B52D339D3248A67 /* Pods_Smitch.framework in Frameworks */, 114 | ); 115 | runOnlyForDeploymentPostprocessing = 0; 116 | }; 117 | /* End PBXFrameworksBuildPhase section */ 118 | 119 | /* Begin PBXGroup section */ 120 | 5143BF8E740D798E0F281AC8 /* Pods */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | 946F7029FB00014E04303061 /* Pods-Smitch.debug.xcconfig */, 124 | AB5269755A8F617DE6C25450 /* Pods-Smitch.release.xcconfig */, 125 | ); 126 | path = Pods; 127 | sourceTree = ""; 128 | }; 129 | 7F96FA8878C7DF02E7D42256 /* Frameworks */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 849933D164F6C200849F4445 /* Pods_Smitch.framework */, 133 | 80941C1E247B004000170C61 /* VoxeetScreenShareKit.framework */, 134 | 80941BFE247AFD7000170C61 /* ReplayKit.framework */, 135 | 80941C0A247AFD7100170C61 /* UIKit.framework */, 136 | ); 137 | name = Frameworks; 138 | sourceTree = ""; 139 | }; 140 | 80941C2A247B318300170C61 /* Broadcast */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 80941C37247B323B00170C61 /* Broadcast.entitlements */, 144 | 80941C2B247B318300170C61 /* SampleHandler.swift */, 145 | 80941C2D247B318300170C61 /* Info.plist */, 146 | ); 147 | path = Broadcast; 148 | sourceTree = ""; 149 | }; 150 | 80A0B19C2461D448003ACDFD = { 151 | isa = PBXGroup; 152 | children = ( 153 | 80A0B1A72461D449003ACDFD /* Smitch */, 154 | 80941C2A247B318300170C61 /* Broadcast */, 155 | 80A0B1A62461D449003ACDFD /* Products */, 156 | 5143BF8E740D798E0F281AC8 /* Pods */, 157 | 7F96FA8878C7DF02E7D42256 /* Frameworks */, 158 | ); 159 | sourceTree = ""; 160 | }; 161 | 80A0B1A62461D449003ACDFD /* Products */ = { 162 | isa = PBXGroup; 163 | children = ( 164 | 80A0B1A52461D449003ACDFD /* Smitch.app */, 165 | 80941C28247B318300170C61 /* Broadcast.appex */, 166 | ); 167 | name = Products; 168 | sourceTree = ""; 169 | }; 170 | 80A0B1A72461D449003ACDFD /* Smitch */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 80941BF8247AFD0100170C61 /* Smitch.entitlements */, 174 | 80A0B1A82461D449003ACDFD /* AppDelegate.swift */, 175 | 80E00A6224772108000D4627 /* Join */, 176 | 8026C11024634ABB00F7F143 /* generateUserId.swift */, 177 | 80E00A6924772580000D4627 /* Watch */, 178 | 80A0B1AE2461D449003ACDFD /* Main.storyboard */, 179 | 80A0B1B12461D44E003ACDFD /* Assets.xcassets */, 180 | 80A0B1B32461D44E003ACDFD /* LaunchScreen.storyboard */, 181 | 80A0B1B62461D44E003ACDFD /* Info.plist */, 182 | ); 183 | path = Smitch; 184 | sourceTree = ""; 185 | }; 186 | 80E00A6224772108000D4627 /* Join */ = { 187 | isa = PBXGroup; 188 | children = ( 189 | 80A0B1AC2461D449003ACDFD /* JoinViewController.swift */, 190 | 80E00A632477213B000D4627 /* JoinViewController+Views.swift */, 191 | 80E00A652477218F000D4627 /* JoinViewController+Constraints.swift */, 192 | 80E00A67247721D8000D4627 /* JoinViewController+Handlers.swift */, 193 | ); 194 | path = Join; 195 | sourceTree = ""; 196 | }; 197 | 80E00A6924772580000D4627 /* Watch */ = { 198 | isa = PBXGroup; 199 | children = ( 200 | 80A0B1BE2461E80B003ACDFD /* WatchViewController.swift */, 201 | 80E00A6A24772596000D4627 /* WatchViewController+Views.swift */, 202 | 80E00A6C24772645000D4627 /* WatchViewController+Constraints.swift */, 203 | 80941BF62477561F00170C61 /* WatchViewController+Chat.swift */, 204 | 80941C20247B04B400170C61 /* WatchViewController+Stream.swift */, 205 | 80941C22247B051B00170C61 /* WatchViewController+StreamDelegate.swift */, 206 | ); 207 | path = Watch; 208 | sourceTree = ""; 209 | }; 210 | /* End PBXGroup section */ 211 | 212 | /* Begin PBXNativeTarget section */ 213 | 80941C27247B318300170C61 /* Broadcast */ = { 214 | isa = PBXNativeTarget; 215 | buildConfigurationList = 80941C31247B318300170C61 /* Build configuration list for PBXNativeTarget "Broadcast" */; 216 | buildPhases = ( 217 | 80941C24247B318300170C61 /* Sources */, 218 | 80941C25247B318300170C61 /* Frameworks */, 219 | 80941C26247B318300170C61 /* Resources */, 220 | 80941C36247B319500170C61 /* Embed Frameworks */, 221 | ); 222 | buildRules = ( 223 | ); 224 | dependencies = ( 225 | ); 226 | name = Broadcast; 227 | productName = Broadcast; 228 | productReference = 80941C28247B318300170C61 /* Broadcast.appex */; 229 | productType = "com.apple.product-type.app-extension"; 230 | }; 231 | 80A0B1A42461D449003ACDFD /* Smitch */ = { 232 | isa = PBXNativeTarget; 233 | buildConfigurationList = 80A0B1B92461D44E003ACDFD /* Build configuration list for PBXNativeTarget "Smitch" */; 234 | buildPhases = ( 235 | B92D2FBC30B15FF5BE754224 /* [CP] Check Pods Manifest.lock */, 236 | 80A0B1A12461D449003ACDFD /* Sources */, 237 | 80A0B1A22461D449003ACDFD /* Frameworks */, 238 | 80A0B1A32461D449003ACDFD /* Resources */, 239 | 3FC5A263C158FC077915DC93 /* [CP] Embed Pods Frameworks */, 240 | 80941C1C247AFD7100170C61 /* Embed App Extensions */, 241 | ); 242 | buildRules = ( 243 | ); 244 | dependencies = ( 245 | 80941C2F247B318300170C61 /* PBXTargetDependency */, 246 | ); 247 | name = Smitch; 248 | productName = Smitch; 249 | productReference = 80A0B1A52461D449003ACDFD /* Smitch.app */; 250 | productType = "com.apple.product-type.application"; 251 | }; 252 | /* End PBXNativeTarget section */ 253 | 254 | /* Begin PBXProject section */ 255 | 80A0B19D2461D448003ACDFD /* Project object */ = { 256 | isa = PBXProject; 257 | attributes = { 258 | LastSwiftUpdateCheck = 1140; 259 | LastUpgradeCheck = 1140; 260 | ORGANIZATIONNAME = "Matheus Cardoso"; 261 | TargetAttributes = { 262 | 80941C27247B318300170C61 = { 263 | CreatedOnToolsVersion = 11.4; 264 | }; 265 | 80A0B1A42461D449003ACDFD = { 266 | CreatedOnToolsVersion = 11.4; 267 | }; 268 | }; 269 | }; 270 | buildConfigurationList = 80A0B1A02461D448003ACDFD /* Build configuration list for PBXProject "Smitch" */; 271 | compatibilityVersion = "Xcode 9.3"; 272 | developmentRegion = en; 273 | hasScannedForEncodings = 0; 274 | knownRegions = ( 275 | en, 276 | Base, 277 | ); 278 | mainGroup = 80A0B19C2461D448003ACDFD; 279 | productRefGroup = 80A0B1A62461D449003ACDFD /* Products */; 280 | projectDirPath = ""; 281 | projectRoot = ""; 282 | targets = ( 283 | 80A0B1A42461D449003ACDFD /* Smitch */, 284 | 80941C27247B318300170C61 /* Broadcast */, 285 | ); 286 | }; 287 | /* End PBXProject section */ 288 | 289 | /* Begin PBXResourcesBuildPhase section */ 290 | 80941C26247B318300170C61 /* Resources */ = { 291 | isa = PBXResourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | 80A0B1A32461D449003ACDFD /* Resources */ = { 298 | isa = PBXResourcesBuildPhase; 299 | buildActionMask = 2147483647; 300 | files = ( 301 | 80A0B1B52461D44E003ACDFD /* LaunchScreen.storyboard in Resources */, 302 | 80A0B1B22461D44E003ACDFD /* Assets.xcassets in Resources */, 303 | 80A0B1B02461D449003ACDFD /* Main.storyboard in Resources */, 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | }; 307 | /* End PBXResourcesBuildPhase section */ 308 | 309 | /* Begin PBXShellScriptBuildPhase section */ 310 | 3FC5A263C158FC077915DC93 /* [CP] Embed Pods Frameworks */ = { 311 | isa = PBXShellScriptBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | ); 315 | inputFileListPaths = ( 316 | "${PODS_ROOT}/Target Support Files/Pods-Smitch/Pods-Smitch-frameworks-${CONFIGURATION}-input-files.xcfilelist", 317 | ); 318 | name = "[CP] Embed Pods Frameworks"; 319 | outputFileListPaths = ( 320 | "${PODS_ROOT}/Target Support Files/Pods-Smitch/Pods-Smitch-frameworks-${CONFIGURATION}-output-files.xcfilelist", 321 | ); 322 | runOnlyForDeploymentPostprocessing = 0; 323 | shellPath = /bin/sh; 324 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Smitch/Pods-Smitch-frameworks.sh\"\n"; 325 | showEnvVarsInLog = 0; 326 | }; 327 | B92D2FBC30B15FF5BE754224 /* [CP] Check Pods Manifest.lock */ = { 328 | isa = PBXShellScriptBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | ); 332 | inputFileListPaths = ( 333 | ); 334 | inputPaths = ( 335 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 336 | "${PODS_ROOT}/Manifest.lock", 337 | ); 338 | name = "[CP] Check Pods Manifest.lock"; 339 | outputFileListPaths = ( 340 | ); 341 | outputPaths = ( 342 | "$(DERIVED_FILE_DIR)/Pods-Smitch-checkManifestLockResult.txt", 343 | ); 344 | runOnlyForDeploymentPostprocessing = 0; 345 | shellPath = /bin/sh; 346 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 347 | showEnvVarsInLog = 0; 348 | }; 349 | /* End PBXShellScriptBuildPhase section */ 350 | 351 | /* Begin PBXSourcesBuildPhase section */ 352 | 80941C24247B318300170C61 /* Sources */ = { 353 | isa = PBXSourcesBuildPhase; 354 | buildActionMask = 2147483647; 355 | files = ( 356 | 80941C2C247B318300170C61 /* SampleHandler.swift in Sources */, 357 | ); 358 | runOnlyForDeploymentPostprocessing = 0; 359 | }; 360 | 80A0B1A12461D449003ACDFD /* Sources */ = { 361 | isa = PBXSourcesBuildPhase; 362 | buildActionMask = 2147483647; 363 | files = ( 364 | 80A0B1BF2461E80B003ACDFD /* WatchViewController.swift in Sources */, 365 | 80E00A642477213B000D4627 /* JoinViewController+Views.swift in Sources */, 366 | 8026C11124634ABB00F7F143 /* generateUserId.swift in Sources */, 367 | 80E00A6B24772596000D4627 /* WatchViewController+Views.swift in Sources */, 368 | 80941C21247B04B400170C61 /* WatchViewController+Stream.swift in Sources */, 369 | 80E00A662477218F000D4627 /* JoinViewController+Constraints.swift in Sources */, 370 | 80E00A6D24772645000D4627 /* WatchViewController+Constraints.swift in Sources */, 371 | 80A0B1AD2461D449003ACDFD /* JoinViewController.swift in Sources */, 372 | 80941C23247B051B00170C61 /* WatchViewController+StreamDelegate.swift in Sources */, 373 | 80E00A68247721D8000D4627 /* JoinViewController+Handlers.swift in Sources */, 374 | 80941BF72477561F00170C61 /* WatchViewController+Chat.swift in Sources */, 375 | 80A0B1A92461D449003ACDFD /* AppDelegate.swift in Sources */, 376 | ); 377 | runOnlyForDeploymentPostprocessing = 0; 378 | }; 379 | /* End PBXSourcesBuildPhase section */ 380 | 381 | /* Begin PBXTargetDependency section */ 382 | 80941C2F247B318300170C61 /* PBXTargetDependency */ = { 383 | isa = PBXTargetDependency; 384 | target = 80941C27247B318300170C61 /* Broadcast */; 385 | targetProxy = 80941C2E247B318300170C61 /* PBXContainerItemProxy */; 386 | }; 387 | /* End PBXTargetDependency section */ 388 | 389 | /* Begin PBXVariantGroup section */ 390 | 80A0B1AE2461D449003ACDFD /* Main.storyboard */ = { 391 | isa = PBXVariantGroup; 392 | children = ( 393 | 80A0B1AF2461D449003ACDFD /* Base */, 394 | ); 395 | name = Main.storyboard; 396 | sourceTree = ""; 397 | }; 398 | 80A0B1B32461D44E003ACDFD /* LaunchScreen.storyboard */ = { 399 | isa = PBXVariantGroup; 400 | children = ( 401 | 80A0B1B42461D44E003ACDFD /* Base */, 402 | ); 403 | name = LaunchScreen.storyboard; 404 | sourceTree = ""; 405 | }; 406 | /* End PBXVariantGroup section */ 407 | 408 | /* Begin XCBuildConfiguration section */ 409 | 80941C32247B318300170C61 /* Debug */ = { 410 | isa = XCBuildConfiguration; 411 | buildSettings = { 412 | CODE_SIGN_ENTITLEMENTS = Broadcast/Broadcast.entitlements; 413 | CODE_SIGN_STYLE = Automatic; 414 | DEVELOPMENT_TEAM = FWD9V5VYJ2; 415 | FRAMEWORK_SEARCH_PATHS = ( 416 | "$(inherited)", 417 | "$(PROJECT_DIR)/Pods/VoxeetScreenShareKit", 418 | ); 419 | INFOPLIST_FILE = Broadcast/Info.plist; 420 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 421 | LD_RUNPATH_SEARCH_PATHS = ( 422 | "$(inherited)", 423 | "@executable_path/Frameworks", 424 | "@executable_path/../../Frameworks", 425 | ); 426 | PRODUCT_BUNDLE_IDENTIFIER = so.cardo.Smitch.Broadcast; 427 | PRODUCT_NAME = "$(TARGET_NAME)"; 428 | SKIP_INSTALL = YES; 429 | SWIFT_VERSION = 5.0; 430 | TARGETED_DEVICE_FAMILY = "1,2"; 431 | }; 432 | name = Debug; 433 | }; 434 | 80941C33247B318300170C61 /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | CODE_SIGN_ENTITLEMENTS = Broadcast/Broadcast.entitlements; 438 | CODE_SIGN_STYLE = Automatic; 439 | DEVELOPMENT_TEAM = FWD9V5VYJ2; 440 | FRAMEWORK_SEARCH_PATHS = ( 441 | "$(inherited)", 442 | "$(PROJECT_DIR)/Pods/VoxeetScreenShareKit", 443 | ); 444 | INFOPLIST_FILE = Broadcast/Info.plist; 445 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 446 | LD_RUNPATH_SEARCH_PATHS = ( 447 | "$(inherited)", 448 | "@executable_path/Frameworks", 449 | "@executable_path/../../Frameworks", 450 | ); 451 | PRODUCT_BUNDLE_IDENTIFIER = so.cardo.Smitch.Broadcast; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | SKIP_INSTALL = YES; 454 | SWIFT_VERSION = 5.0; 455 | TARGETED_DEVICE_FAMILY = "1,2"; 456 | }; 457 | name = Release; 458 | }; 459 | 80A0B1B72461D44E003ACDFD /* Debug */ = { 460 | isa = XCBuildConfiguration; 461 | buildSettings = { 462 | ALWAYS_SEARCH_USER_PATHS = NO; 463 | CLANG_ANALYZER_NONNULL = YES; 464 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 465 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 466 | CLANG_CXX_LIBRARY = "libc++"; 467 | CLANG_ENABLE_MODULES = YES; 468 | CLANG_ENABLE_OBJC_ARC = YES; 469 | CLANG_ENABLE_OBJC_WEAK = YES; 470 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 471 | CLANG_WARN_BOOL_CONVERSION = YES; 472 | CLANG_WARN_COMMA = YES; 473 | CLANG_WARN_CONSTANT_CONVERSION = YES; 474 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 475 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 476 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 477 | CLANG_WARN_EMPTY_BODY = YES; 478 | CLANG_WARN_ENUM_CONVERSION = YES; 479 | CLANG_WARN_INFINITE_RECURSION = YES; 480 | CLANG_WARN_INT_CONVERSION = YES; 481 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 482 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 483 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 484 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 485 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 486 | CLANG_WARN_STRICT_PROTOTYPES = YES; 487 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 488 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 489 | CLANG_WARN_UNREACHABLE_CODE = YES; 490 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 491 | COPY_PHASE_STRIP = NO; 492 | DEBUG_INFORMATION_FORMAT = dwarf; 493 | ENABLE_STRICT_OBJC_MSGSEND = YES; 494 | ENABLE_TESTABILITY = YES; 495 | GCC_C_LANGUAGE_STANDARD = gnu11; 496 | GCC_DYNAMIC_NO_PIC = NO; 497 | GCC_NO_COMMON_BLOCKS = YES; 498 | GCC_OPTIMIZATION_LEVEL = 0; 499 | GCC_PREPROCESSOR_DEFINITIONS = ( 500 | "DEBUG=1", 501 | "$(inherited)", 502 | ); 503 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 504 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 505 | GCC_WARN_UNDECLARED_SELECTOR = YES; 506 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 507 | GCC_WARN_UNUSED_FUNCTION = YES; 508 | GCC_WARN_UNUSED_VARIABLE = YES; 509 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 510 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 511 | MTL_FAST_MATH = YES; 512 | ONLY_ACTIVE_ARCH = YES; 513 | SDKROOT = iphoneos; 514 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 515 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 516 | }; 517 | name = Debug; 518 | }; 519 | 80A0B1B82461D44E003ACDFD /* Release */ = { 520 | isa = XCBuildConfiguration; 521 | buildSettings = { 522 | ALWAYS_SEARCH_USER_PATHS = NO; 523 | CLANG_ANALYZER_NONNULL = YES; 524 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 525 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 526 | CLANG_CXX_LIBRARY = "libc++"; 527 | CLANG_ENABLE_MODULES = YES; 528 | CLANG_ENABLE_OBJC_ARC = YES; 529 | CLANG_ENABLE_OBJC_WEAK = YES; 530 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 531 | CLANG_WARN_BOOL_CONVERSION = YES; 532 | CLANG_WARN_COMMA = YES; 533 | CLANG_WARN_CONSTANT_CONVERSION = YES; 534 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 535 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 536 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 537 | CLANG_WARN_EMPTY_BODY = YES; 538 | CLANG_WARN_ENUM_CONVERSION = YES; 539 | CLANG_WARN_INFINITE_RECURSION = YES; 540 | CLANG_WARN_INT_CONVERSION = YES; 541 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 542 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 543 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 544 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 545 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 546 | CLANG_WARN_STRICT_PROTOTYPES = YES; 547 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 548 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 549 | CLANG_WARN_UNREACHABLE_CODE = YES; 550 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 551 | COPY_PHASE_STRIP = NO; 552 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 553 | ENABLE_NS_ASSERTIONS = NO; 554 | ENABLE_STRICT_OBJC_MSGSEND = YES; 555 | GCC_C_LANGUAGE_STANDARD = gnu11; 556 | GCC_NO_COMMON_BLOCKS = YES; 557 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 558 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 559 | GCC_WARN_UNDECLARED_SELECTOR = YES; 560 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 561 | GCC_WARN_UNUSED_FUNCTION = YES; 562 | GCC_WARN_UNUSED_VARIABLE = YES; 563 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 564 | MTL_ENABLE_DEBUG_INFO = NO; 565 | MTL_FAST_MATH = YES; 566 | SDKROOT = iphoneos; 567 | SWIFT_COMPILATION_MODE = wholemodule; 568 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 569 | VALIDATE_PRODUCT = YES; 570 | }; 571 | name = Release; 572 | }; 573 | 80A0B1BA2461D44E003ACDFD /* Debug */ = { 574 | isa = XCBuildConfiguration; 575 | baseConfigurationReference = 946F7029FB00014E04303061 /* Pods-Smitch.debug.xcconfig */; 576 | buildSettings = { 577 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 578 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 579 | CODE_SIGN_ENTITLEMENTS = Smitch/Smitch.entitlements; 580 | CODE_SIGN_STYLE = Automatic; 581 | DEVELOPMENT_TEAM = FWD9V5VYJ2; 582 | INFOPLIST_FILE = Smitch/Info.plist; 583 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 584 | LD_RUNPATH_SEARCH_PATHS = ( 585 | "$(inherited)", 586 | "@executable_path/Frameworks", 587 | ); 588 | PRODUCT_BUNDLE_IDENTIFIER = so.cardo.Smitch; 589 | PRODUCT_NAME = "$(TARGET_NAME)"; 590 | SWIFT_VERSION = 5.0; 591 | TARGETED_DEVICE_FAMILY = "1,2"; 592 | }; 593 | name = Debug; 594 | }; 595 | 80A0B1BB2461D44E003ACDFD /* Release */ = { 596 | isa = XCBuildConfiguration; 597 | baseConfigurationReference = AB5269755A8F617DE6C25450 /* Pods-Smitch.release.xcconfig */; 598 | buildSettings = { 599 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 600 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 601 | CODE_SIGN_ENTITLEMENTS = Smitch/Smitch.entitlements; 602 | CODE_SIGN_STYLE = Automatic; 603 | DEVELOPMENT_TEAM = FWD9V5VYJ2; 604 | INFOPLIST_FILE = Smitch/Info.plist; 605 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 606 | LD_RUNPATH_SEARCH_PATHS = ( 607 | "$(inherited)", 608 | "@executable_path/Frameworks", 609 | ); 610 | PRODUCT_BUNDLE_IDENTIFIER = so.cardo.Smitch; 611 | PRODUCT_NAME = "$(TARGET_NAME)"; 612 | SWIFT_VERSION = 5.0; 613 | TARGETED_DEVICE_FAMILY = "1,2"; 614 | }; 615 | name = Release; 616 | }; 617 | /* End XCBuildConfiguration section */ 618 | 619 | /* Begin XCConfigurationList section */ 620 | 80941C31247B318300170C61 /* Build configuration list for PBXNativeTarget "Broadcast" */ = { 621 | isa = XCConfigurationList; 622 | buildConfigurations = ( 623 | 80941C32247B318300170C61 /* Debug */, 624 | 80941C33247B318300170C61 /* Release */, 625 | ); 626 | defaultConfigurationIsVisible = 0; 627 | defaultConfigurationName = Release; 628 | }; 629 | 80A0B1A02461D448003ACDFD /* Build configuration list for PBXProject "Smitch" */ = { 630 | isa = XCConfigurationList; 631 | buildConfigurations = ( 632 | 80A0B1B72461D44E003ACDFD /* Debug */, 633 | 80A0B1B82461D44E003ACDFD /* Release */, 634 | ); 635 | defaultConfigurationIsVisible = 0; 636 | defaultConfigurationName = Release; 637 | }; 638 | 80A0B1B92461D44E003ACDFD /* Build configuration list for PBXNativeTarget "Smitch" */ = { 639 | isa = XCConfigurationList; 640 | buildConfigurations = ( 641 | 80A0B1BA2461D44E003ACDFD /* Debug */, 642 | 80A0B1BB2461D44E003ACDFD /* Release */, 643 | ); 644 | defaultConfigurationIsVisible = 0; 645 | defaultConfigurationName = Release; 646 | }; 647 | /* End XCConfigurationList section */ 648 | }; 649 | rootObject = 80A0B19D2461D448003ACDFD /* Project object */; 650 | } 651 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcodeproj/project.xcworkspace/xcuserdata/cardoso.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GetStream/twitch-example-ios/4770b8e941df0c5835e3301f6ecd1dc87031cd16/Smitch/Smitch.xcodeproj/project.xcworkspace/xcuserdata/cardoso.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Smitch/Smitch.xcodeproj/xcshareddata/xcschemes/Broadcast.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 16 | 22 | 23 | 24 | 30 | 36 | 37 | 38 | 39 | 40 | 45 | 46 | 47 | 48 | 60 | 64 | 65 | 66 | 72 | 73 | 74 | 75 | 82 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcodeproj/xcshareddata/xcschemes/BroadcastSetupUI.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 6 | 9 | 10 | 16 | 22 | 23 | 24 | 30 | 36 | 37 | 38 | 39 | 40 | 45 | 46 | 47 | 48 | 60 | 62 | 68 | 69 | 70 | 71 | 78 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcodeproj/xcshareddata/xcschemes/Smitch.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcodeproj/xcuserdata/cardoso.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Broadcast.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 16 11 | 12 | BroadcastSetupUI.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 15 16 | 17 | Smitch.xcscheme_^#shared#^_ 18 | 19 | orderHint 20 | 14 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 80941BFC247AFD7000170C61 26 | 27 | primary 28 | 29 | 30 | 80941C07247AFD7100170C61 31 | 32 | primary 33 | 34 | 35 | 80A0B1A42461D449003ACDFD 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcworkspace/xcuserdata/cardoso.xcuserdatad/IDEFindNavigatorScopes.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Smitch/Smitch.xcworkspace/xcuserdata/cardoso.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GetStream/twitch-example-ios/4770b8e941df0c5835e3301f6ecd1dc87031cd16/Smitch/Smitch.xcworkspace/xcuserdata/cardoso.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Smitch/Smitch.xcworkspace/xcuserdata/cardoso.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 21 | 22 | 23 | 25 | 37 | 38 | 39 | 41 | 53 | 54 | 55 | 57 | 69 | 70 | 71 | 73 | 85 | 86 | 87 | 89 | 101 | 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /Smitch/Smitch/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/5/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import VoxeetSDK 11 | import StreamChatClient 12 | 13 | @UIApplicationMain 14 | class AppDelegate: UIResponder, UIApplicationDelegate { 15 | var window: UIWindow? 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | VoxeetSDK.shared.initialize(consumerKey: "ZTBib3I5IaNzmmt0aA==", consumerSecret: "NDUyM2kzjaHRucNvZWxjaHRucG41dmpidnE=") 19 | VoxeetSDK.shared.appGroup = "group.so.cardo.Smitch.Group" 20 | VoxeetSDK.shared.preferredExtension = "so.cardo.Smitch.Broadcast" 21 | 22 | Client.configureShared(.init(apiKey: "74e5enp34e52", logOptions: .info)) 23 | Client.shared.set(user: .init(id: generateUserId()), token: .development) 24 | 25 | return true 26 | } 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Smitch/Smitch/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "scale" : "1x", 46 | "size" : "20x20" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "scale" : "2x", 51 | "size" : "20x20" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "scale" : "1x", 56 | "size" : "29x29" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "scale" : "1x", 66 | "size" : "40x40" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "scale" : "2x", 71 | "size" : "40x40" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "scale" : "1x", 76 | "size" : "76x76" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "scale" : "2x", 81 | "size" : "76x76" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "scale" : "2x", 86 | "size" : "83.5x83.5" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "scale" : "1x", 91 | "size" : "1024x1024" 92 | } 93 | ], 94 | "info" : { 95 | "author" : "xcode", 96 | "version" : 1 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Smitch/Smitch/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Smitch/Smitch/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Smitch/Smitch/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Smitch/Smitch/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSMainStoryboardFile 6 | Main 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSCameraUsageDescription 26 | Camera is needed to broadcast your video to the viewers 27 | NSMicrophoneUsageDescription 28 | Voice recording is needed to broadcast your voice to the viewers 29 | Application Scene Manifest_bkp 30 | 31 | UIApplicationSupportsMultipleScenes 32 | 33 | UISceneConfigurations 34 | 35 | UIWindowSceneSessionRoleApplication 36 | 37 | 38 | UISceneConfigurationName 39 | Default Configuration 40 | UISceneDelegateClassName 41 | $(PRODUCT_MODULE_NAME).SceneDelegate 42 | UISceneStoryboardFile 43 | Main 44 | 45 | 46 | 47 | 48 | UIBackgroundModes 49 | 50 | audio 51 | voip 52 | 53 | UILaunchStoryboardName 54 | LaunchScreen 55 | UIMainStoryboardFile 56 | Main 57 | UIRequiredDeviceCapabilities 58 | 59 | armv7 60 | 61 | UISupportedInterfaceOrientations 62 | 63 | UIInterfaceOrientationPortrait 64 | UIInterfaceOrientationLandscapeLeft 65 | UIInterfaceOrientationLandscapeRight 66 | 67 | UISupportedInterfaceOrientations~ipad 68 | 69 | UIInterfaceOrientationPortrait 70 | UIInterfaceOrientationPortraitUpsideDown 71 | UIInterfaceOrientationLandscapeLeft 72 | UIInterfaceOrientationLandscapeRight 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Smitch/Smitch/Join/JoinViewController+Constraints.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JoinViewController+Constraints.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/21/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | extension JoinViewController { 10 | func setupConstraints() { 11 | view.addConstraints([ 12 | channelTextField.widthAnchor.constraint(equalToConstant: 100), 13 | channelTextField.centerXAnchor.constraint(equalTo: view.centerXAnchor), 14 | channelTextField.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10), 15 | joinButton.centerXAnchor.constraint(equalTo: view.centerXAnchor), 16 | joinButton.topAnchor.constraint(equalTo: channelTextField.bottomAnchor) 17 | ]) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Smitch/Smitch/Join/JoinViewController+Handlers.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JoinViewController+Handlers.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/21/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension JoinViewController { 12 | func setupHandlers() { 13 | joinButton.addTarget(self, action: #selector(handleButtonPress), for: .touchUpInside) 14 | } 15 | 16 | @objc func handleButtonPress() { 17 | let watchVC = WatchViewController() 18 | watchVC.channelName = channelTextField.text! 19 | navigationController?.pushViewController(watchVC, animated: true) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Smitch/Smitch/Join/JoinViewController+Views.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JoinViewController+Views.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/21/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | extension JoinViewController { 10 | func setupViews() { 11 | setupChannelTextField() 12 | setupJoinButton() 13 | } 14 | 15 | func setupChannelTextField() { 16 | channelTextField.translatesAutoresizingMaskIntoConstraints = false 17 | channelTextField.becomeFirstResponder() 18 | 19 | view.addSubview(channelTextField) 20 | } 21 | 22 | func setupJoinButton() { 23 | joinButton.translatesAutoresizingMaskIntoConstraints = false 24 | joinButton.setTitleColor(.systemBlue, for: .normal) 25 | joinButton.setTitle("Join/Create", for: .normal) 26 | 27 | view.addSubview(joinButton) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Smitch/Smitch/Join/JoinViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/5/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class JoinViewController: UIViewController { 12 | let channelTextField = UITextField() 13 | let joinButton = UIButton() 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | 18 | title = "Join Channel" 19 | 20 | setupViews() 21 | setupConstraints() 22 | setupHandlers() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Smitch/Smitch/Smitch.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.application-groups 6 | 7 | group.so.cardo.Smitch.Group 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Smitch/Smitch/Watch/WatchViewController+Chat.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WatchViewController+Chat.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/21/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | import StreamChatClient 10 | import StreamChatCore 11 | 12 | extension WatchViewController { 13 | func setupChat() { 14 | let channel = Client.shared.channel(type: .livestream, id: channelName) 15 | chatViewController.presenter = ChannelPresenter(channel: channel) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Smitch/Smitch/Watch/WatchViewController+Constraints.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WatchViewController+Constraints.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/21/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension WatchViewController { 12 | func setupConstraints() { 13 | setupVideoConstraints() 14 | setupChatConstraints() 15 | } 16 | 17 | func setupVideoConstraints() { 18 | videoView.translatesAutoresizingMaskIntoConstraints = false 19 | view.addConstraints([ 20 | videoView.topAnchor.constraint(equalTo: view.topAnchor), 21 | videoView.rightAnchor.constraint(equalTo: view.rightAnchor), 22 | videoView.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: 1/3), 23 | videoView.leftAnchor.constraint(equalTo: view.leftAnchor) 24 | ]) 25 | } 26 | 27 | func setupChatConstraints() { 28 | view.addConstraints([ 29 | chatViewController.view.topAnchor.constraint(equalTo: videoView.bottomAnchor), 30 | chatViewController.view.rightAnchor.constraint(equalTo: view.rightAnchor), 31 | chatViewController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), 32 | chatViewController.view.leftAnchor.constraint(equalTo: view.leftAnchor) 33 | ]) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Smitch/Smitch/Watch/WatchViewController+Stream.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WatchViewController+Stream.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/24/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | import VoxeetSDK 10 | import ReplayKit 11 | 12 | extension WatchViewController { 13 | func setupStream() { 14 | let info = VTParticipantInfo(externalID: userId, name: userId, avatarURL: nil) 15 | 16 | voxeet.conference.delegate = self 17 | voxeet.session.open(info: info) { error in 18 | self.joinOrCreateConference() 19 | } 20 | } 21 | 22 | func joinOrCreateConference() { 23 | let options = VTConferenceOptions() 24 | options.alias = channelName 25 | 26 | voxeet.conference.create(options: options, success: { conf in 27 | if conf.isNew { 28 | self.shareScreen(conf: conf) 29 | } else { 30 | self.watch(conf: conf) 31 | } 32 | }, fail: { error in 33 | // TODO: Handle errors 34 | }) 35 | } 36 | 37 | func shareScreen(conf: VTConference) { 38 | self.voxeet.conference.join(conference: conf, success: { conf in 39 | DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) { 40 | self.voxeet.conference.startScreenShare(broadcast: true) { error in 41 | // TODO: Handle errors 42 | } 43 | } 44 | }, fail: { error in 45 | // TODO: Handle errors 46 | }) 47 | } 48 | 49 | func watch(conf: VTConference) { 50 | self.voxeet.conference.listen(conference: conf, success: { conf in 51 | 52 | }, fail: { error in 53 | // TODO: Handle errors 54 | }) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Smitch/Smitch/Watch/WatchViewController+StreamDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WatchViewContoller+StreamDelegate.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/24/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | import VoxeetSDK 10 | 11 | extension WatchViewController: VTConferenceDelegate { 12 | func streamAdded(participant: VTParticipant, stream: MediaStream) { 13 | switch stream.type { 14 | case .ScreenShare: 15 | videoView.alpha = 1 16 | videoView.attach(participant: participant, stream: stream) 17 | default: 18 | break 19 | } 20 | } 21 | 22 | func streamUpdated(participant: VTParticipant, stream: MediaStream) { 23 | 24 | } 25 | 26 | func streamRemoved(participant: VTParticipant, stream: MediaStream) { 27 | switch stream.type { 28 | case .ScreenShare: 29 | videoView.alpha = 0 30 | default: 31 | break 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Smitch/Smitch/Watch/WatchViewController+Views.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WatchViewController+Views.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/21/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | extension WatchViewController { 10 | func setupViews() { 11 | setupVideoView() 12 | setupChatView() 13 | } 14 | 15 | func setupVideoView() { 16 | view.addSubview(videoView) 17 | } 18 | 19 | func setupChatView() { 20 | addChild(chatViewController) 21 | view.addSubview(chatViewController.view) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Smitch/Smitch/Watch/WatchViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WatchViewController.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/5/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import VoxeetSDK 11 | import StreamChat 12 | 13 | class WatchViewController: UIViewController { 14 | var channelName: String = "default" 15 | 16 | let voxeet = VoxeetSDK.shared 17 | let userId = generateUserId() 18 | let videoView = VTVideoView() 19 | let chatViewController = ChatViewController() 20 | 21 | override var prefersStatusBarHidden: Bool { true } 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | setupChat() 27 | setupStream() 28 | setupViews() 29 | setupConstraints() 30 | } 31 | 32 | override func viewDidAppear(_ animated: Bool) { 33 | super.viewDidAppear(animated) 34 | DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { 35 | self.navigationController?.navigationBar.isHidden = true 36 | } 37 | } 38 | 39 | deinit { 40 | voxeet.conference.leave() 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Smitch/Smitch/generateUserId.swift: -------------------------------------------------------------------------------- 1 | // 2 | // generateUserId.swift 3 | // Smitch 4 | // 5 | // Created by Matheus Cardoso on 5/6/20. 6 | // Copyright © 2020 Matheus Cardoso. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | func generateUserId(length: Int = 10) -> String { 12 | let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" 13 | return String((0..