diff --git a/Examples.xcworkspace/contents.xcworkspacedata b/Examples.xcworkspace/contents.xcworkspacedata index 51f7c72..e1c7fd5 100644 --- a/Examples.xcworkspace/contents.xcworkspacedata +++ b/Examples.xcworkspace/contents.xcworkspacedata @@ -1,6 +1,9 @@ + + diff --git a/live-event-app/.gitignore b/live-event-app/.gitignore new file mode 100644 index 0000000..f4f4799 --- /dev/null +++ b/live-event-app/.gitignore @@ -0,0 +1,2 @@ +tomato/node_modules +tomato/package-lock.json \ No newline at end of file diff --git a/live-event-app/live-event-app.xcodeproj/project.pbxproj b/live-event-app/live-event-app.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c64a6b1 --- /dev/null +++ b/live-event-app/live-event-app.xcodeproj/project.pbxproj @@ -0,0 +1,629 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 3D9881B0293755BD0084C2F5 /* MessageListTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9881AF293755BD0084C2F5 /* MessageListTheme.swift */; }; + 3D9881C7293757A80084C2F5 /* Poppins-ExtraLight.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881B4293757A80084C2F5 /* Poppins-ExtraLight.ttf */; }; + 3D9881C8293757A80084C2F5 /* Poppins-ThinItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881B5293757A80084C2F5 /* Poppins-ThinItalic.ttf */; }; + 3D9881C9293757A80084C2F5 /* Poppins-ExtraLightItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881B6293757A80084C2F5 /* Poppins-ExtraLightItalic.ttf */; }; + 3D9881CA293757A80084C2F5 /* Poppins-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881B7293757A80084C2F5 /* Poppins-BoldItalic.ttf */; }; + 3D9881CB293757A80084C2F5 /* Poppins-Light.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881B8293757A80084C2F5 /* Poppins-Light.ttf */; }; + 3D9881CC293757A80084C2F5 /* Poppins-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881B9293757A80084C2F5 /* Poppins-Medium.ttf */; }; + 3D9881CD293757A80084C2F5 /* Poppins-SemiBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881BA293757A80084C2F5 /* Poppins-SemiBoldItalic.ttf */; }; + 3D9881CE293757A80084C2F5 /* Poppins-ExtraBoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881BB293757A80084C2F5 /* Poppins-ExtraBoldItalic.ttf */; }; + 3D9881CF293757A80084C2F5 /* Poppins-ExtraBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881BC293757A80084C2F5 /* Poppins-ExtraBold.ttf */; }; + 3D9881D0293757A80084C2F5 /* Poppins-BlackItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881BD293757A80084C2F5 /* Poppins-BlackItalic.ttf */; }; + 3D9881D1293757A80084C2F5 /* OFL.txt in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881BE293757A80084C2F5 /* OFL.txt */; }; + 3D9881D2293757A80084C2F5 /* Poppins-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881BF293757A80084C2F5 /* Poppins-Regular.ttf */; }; + 3D9881D3293757A80084C2F5 /* Poppins-LightItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881C0293757A80084C2F5 /* Poppins-LightItalic.ttf */; }; + 3D9881D4293757A80084C2F5 /* Poppins-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881C1293757A80084C2F5 /* Poppins-Bold.ttf */; }; + 3D9881D5293757A80084C2F5 /* Poppins-Black.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881C2293757A80084C2F5 /* Poppins-Black.ttf */; }; + 3D9881D6293757A80084C2F5 /* Poppins-Thin.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881C3293757A80084C2F5 /* Poppins-Thin.ttf */; }; + 3D9881D7293757A80084C2F5 /* Poppins-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881C4293757A80084C2F5 /* Poppins-SemiBold.ttf */; }; + 3D9881D8293757A80084C2F5 /* Poppins-Italic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881C5293757A80084C2F5 /* Poppins-Italic.ttf */; }; + 3D9881D9293757A80084C2F5 /* Poppins-MediumItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881C6293757A80084C2F5 /* Poppins-MediumItalic.ttf */; }; + 3D9881DB293758630084C2F5 /* MessageInputTheme.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9881DA293758630084C2F5 /* MessageInputTheme.swift */; }; + 3D9881DD293758990084C2F5 /* Colors.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3D9881DC293758990084C2F5 /* Colors.xcassets */; }; + 3D9881E0293DE8B50084C2F5 /* RootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9881DF293DE8B50084C2F5 /* RootViewController.swift */; }; + 3DE5AC7F293F3B2A00683DCF /* LiveStreamViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DE5AC7E293F3B2A00683DCF /* LiveStreamViewController.swift */; }; + 3DE75808292B876C0083EAB0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DE75807292B876C0083EAB0 /* AppDelegate.swift */; }; + 3DE7580A292B876C0083EAB0 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DE75809292B876C0083EAB0 /* SceneDelegate.swift */; }; + 3DE7580F292B876C0083EAB0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3DE7580D292B876C0083EAB0 /* Main.storyboard */; }; + 3DE75811292B876D0083EAB0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3DE75810292B876D0083EAB0 /* Assets.xcassets */; }; + 3DE75814292B876D0083EAB0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3DE75812292B876D0083EAB0 /* LaunchScreen.storyboard */; }; + 3DE7581D292B88020083EAB0 /* PubNubChat in Frameworks */ = {isa = PBXBuildFile; productRef = 3DE7581C292B88020083EAB0 /* PubNubChat */; }; + 3DE7581F292B88020083EAB0 /* PubNubChatComponents in Frameworks */ = {isa = PBXBuildFile; productRef = 3DE7581E292B88020083EAB0 /* PubNubChatComponents */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 3DE7582A292F723C0083EAB0 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3DE757FC292B876C0083EAB0 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3DE75803292B876C0083EAB0; + remoteInfo = "live-event-app"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 3D9881AF293755BD0084C2F5 /* MessageListTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageListTheme.swift; sourceTree = ""; }; + 3D9881B4293757A80084C2F5 /* Poppins-ExtraLight.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-ExtraLight.ttf"; sourceTree = ""; }; + 3D9881B5293757A80084C2F5 /* Poppins-ThinItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-ThinItalic.ttf"; sourceTree = ""; }; + 3D9881B6293757A80084C2F5 /* Poppins-ExtraLightItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-ExtraLightItalic.ttf"; sourceTree = ""; }; + 3D9881B7293757A80084C2F5 /* Poppins-BoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-BoldItalic.ttf"; sourceTree = ""; }; + 3D9881B8293757A80084C2F5 /* Poppins-Light.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-Light.ttf"; sourceTree = ""; }; + 3D9881B9293757A80084C2F5 /* Poppins-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-Medium.ttf"; sourceTree = ""; }; + 3D9881BA293757A80084C2F5 /* Poppins-SemiBoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-SemiBoldItalic.ttf"; sourceTree = ""; }; + 3D9881BB293757A80084C2F5 /* Poppins-ExtraBoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-ExtraBoldItalic.ttf"; sourceTree = ""; }; + 3D9881BC293757A80084C2F5 /* Poppins-ExtraBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-ExtraBold.ttf"; sourceTree = ""; }; + 3D9881BD293757A80084C2F5 /* Poppins-BlackItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-BlackItalic.ttf"; sourceTree = ""; }; + 3D9881BE293757A80084C2F5 /* OFL.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OFL.txt; sourceTree = ""; }; + 3D9881BF293757A80084C2F5 /* Poppins-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-Regular.ttf"; sourceTree = ""; }; + 3D9881C0293757A80084C2F5 /* Poppins-LightItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-LightItalic.ttf"; sourceTree = ""; }; + 3D9881C1293757A80084C2F5 /* Poppins-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-Bold.ttf"; sourceTree = ""; }; + 3D9881C2293757A80084C2F5 /* Poppins-Black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-Black.ttf"; sourceTree = ""; }; + 3D9881C3293757A80084C2F5 /* Poppins-Thin.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-Thin.ttf"; sourceTree = ""; }; + 3D9881C4293757A80084C2F5 /* Poppins-SemiBold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-SemiBold.ttf"; sourceTree = ""; }; + 3D9881C5293757A80084C2F5 /* Poppins-Italic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-Italic.ttf"; sourceTree = ""; }; + 3D9881C6293757A80084C2F5 /* Poppins-MediumItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-MediumItalic.ttf"; sourceTree = ""; }; + 3D9881DA293758630084C2F5 /* MessageInputTheme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageInputTheme.swift; sourceTree = ""; }; + 3D9881DC293758990084C2F5 /* Colors.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Colors.xcassets; sourceTree = ""; }; + 3D9881DF293DE8B50084C2F5 /* RootViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootViewController.swift; sourceTree = ""; }; + 3DE5AC7E293F3B2A00683DCF /* LiveStreamViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveStreamViewController.swift; sourceTree = ""; }; + 3DE75804292B876C0083EAB0 /* live-event-app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "live-event-app.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 3DE75807292B876C0083EAB0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 3DE75809292B876C0083EAB0 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 3DE7580E292B876C0083EAB0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 3DE75810292B876D0083EAB0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 3DE75813292B876D0083EAB0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 3DE75815292B876D0083EAB0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 3DE75824292F723C0083EAB0 /* live-event-app-UITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "live-event-app-UITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 3DE75801292B876C0083EAB0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3DE7581F292B88020083EAB0 /* PubNubChatComponents in Frameworks */, + 3DE7581D292B88020083EAB0 /* PubNubChat in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3DE75821292F723C0083EAB0 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3D9881AE293755A70084C2F5 /* Theming */ = { + isa = PBXGroup; + children = ( + 3D9881AF293755BD0084C2F5 /* MessageListTheme.swift */, + 3D9881DA293758630084C2F5 /* MessageInputTheme.swift */, + ); + path = Theming; + sourceTree = ""; + }; + 3D9881B1293757A80084C2F5 /* Resources */ = { + isa = PBXGroup; + children = ( + 3D9881B2293757A80084C2F5 /* Fonts */, + ); + path = Resources; + sourceTree = ""; + }; + 3D9881B2293757A80084C2F5 /* Fonts */ = { + isa = PBXGroup; + children = ( + 3D9881B3293757A80084C2F5 /* Poppins */, + ); + path = Fonts; + sourceTree = ""; + }; + 3D9881B3293757A80084C2F5 /* Poppins */ = { + isa = PBXGroup; + children = ( + 3D9881B4293757A80084C2F5 /* Poppins-ExtraLight.ttf */, + 3D9881B5293757A80084C2F5 /* Poppins-ThinItalic.ttf */, + 3D9881B6293757A80084C2F5 /* Poppins-ExtraLightItalic.ttf */, + 3D9881B7293757A80084C2F5 /* Poppins-BoldItalic.ttf */, + 3D9881B8293757A80084C2F5 /* Poppins-Light.ttf */, + 3D9881B9293757A80084C2F5 /* Poppins-Medium.ttf */, + 3D9881BA293757A80084C2F5 /* Poppins-SemiBoldItalic.ttf */, + 3D9881BB293757A80084C2F5 /* Poppins-ExtraBoldItalic.ttf */, + 3D9881BC293757A80084C2F5 /* Poppins-ExtraBold.ttf */, + 3D9881BD293757A80084C2F5 /* Poppins-BlackItalic.ttf */, + 3D9881BE293757A80084C2F5 /* OFL.txt */, + 3D9881BF293757A80084C2F5 /* Poppins-Regular.ttf */, + 3D9881C0293757A80084C2F5 /* Poppins-LightItalic.ttf */, + 3D9881C1293757A80084C2F5 /* Poppins-Bold.ttf */, + 3D9881C2293757A80084C2F5 /* Poppins-Black.ttf */, + 3D9881C3293757A80084C2F5 /* Poppins-Thin.ttf */, + 3D9881C4293757A80084C2F5 /* Poppins-SemiBold.ttf */, + 3D9881C5293757A80084C2F5 /* Poppins-Italic.ttf */, + 3D9881C6293757A80084C2F5 /* Poppins-MediumItalic.ttf */, + ); + path = Poppins; + sourceTree = ""; + }; + 3DE757FB292B876C0083EAB0 = { + isa = PBXGroup; + children = ( + 3DE75806292B876C0083EAB0 /* live-event-app */, + 3DE75805292B876C0083EAB0 /* Products */, + ); + sourceTree = ""; + }; + 3DE75805292B876C0083EAB0 /* Products */ = { + isa = PBXGroup; + children = ( + 3DE75804292B876C0083EAB0 /* live-event-app.app */, + 3DE75824292F723C0083EAB0 /* live-event-app-UITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 3DE75806292B876C0083EAB0 /* live-event-app */ = { + isa = PBXGroup; + children = ( + 3D9881B1293757A80084C2F5 /* Resources */, + 3D9881AE293755A70084C2F5 /* Theming */, + 3DE75807292B876C0083EAB0 /* AppDelegate.swift */, + 3DE75809292B876C0083EAB0 /* SceneDelegate.swift */, + 3D9881DF293DE8B50084C2F5 /* RootViewController.swift */, + 3DE5AC7E293F3B2A00683DCF /* LiveStreamViewController.swift */, + 3DE75810292B876D0083EAB0 /* Assets.xcassets */, + 3D9881DC293758990084C2F5 /* Colors.xcassets */, + 3DE7580D292B876C0083EAB0 /* Main.storyboard */, + 3DE75812292B876D0083EAB0 /* LaunchScreen.storyboard */, + 3DE75815292B876D0083EAB0 /* Info.plist */, + ); + path = "live-event-app"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 3DE75803292B876C0083EAB0 /* live-event-app */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3DE75818292B876D0083EAB0 /* Build configuration list for PBXNativeTarget "live-event-app" */; + buildPhases = ( + 3DE75800292B876C0083EAB0 /* Sources */, + 3DE75801292B876C0083EAB0 /* Frameworks */, + 3DE75802292B876C0083EAB0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "live-event-app"; + packageProductDependencies = ( + 3DE7581C292B88020083EAB0 /* PubNubChat */, + 3DE7581E292B88020083EAB0 /* PubNubChatComponents */, + ); + productName = "live-event-app"; + productReference = 3DE75804292B876C0083EAB0 /* live-event-app.app */; + productType = "com.apple.product-type.application"; + }; + 3DE75823292F723C0083EAB0 /* live-event-app-UITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3DE7582C292F723C0083EAB0 /* Build configuration list for PBXNativeTarget "live-event-app-UITests" */; + buildPhases = ( + 3DE75820292F723C0083EAB0 /* Sources */, + 3DE75821292F723C0083EAB0 /* Frameworks */, + 3DE75822292F723C0083EAB0 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 3DE7582B292F723C0083EAB0 /* PBXTargetDependency */, + ); + name = "live-event-app-UITests"; + productName = "live-event-app-UITests"; + productReference = 3DE75824292F723C0083EAB0 /* live-event-app-UITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 3DE757FC292B876C0083EAB0 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1410; + LastUpgradeCheck = 1410; + TargetAttributes = { + 3DE75803292B876C0083EAB0 = { + CreatedOnToolsVersion = 14.1; + }; + 3DE75823292F723C0083EAB0 = { + CreatedOnToolsVersion = 14.1; + TestTargetID = 3DE75803292B876C0083EAB0; + }; + }; + }; + buildConfigurationList = 3DE757FF292B876C0083EAB0 /* Build configuration list for PBXProject "live-event-app" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 3DE757FB292B876C0083EAB0; + packageReferences = ( + 3DE7581B292B88020083EAB0 /* XCRemoteSwiftPackageReference "chat-components-ios" */, + ); + productRefGroup = 3DE75805292B876C0083EAB0 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3DE75803292B876C0083EAB0 /* live-event-app */, + 3DE75823292F723C0083EAB0 /* live-event-app-UITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 3DE75802292B876C0083EAB0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3D9881D6293757A80084C2F5 /* Poppins-Thin.ttf in Resources */, + 3D9881D9293757A80084C2F5 /* Poppins-MediumItalic.ttf in Resources */, + 3D9881D1293757A80084C2F5 /* OFL.txt in Resources */, + 3D9881C9293757A80084C2F5 /* Poppins-ExtraLightItalic.ttf in Resources */, + 3D9881D0293757A80084C2F5 /* Poppins-BlackItalic.ttf in Resources */, + 3D9881C7293757A80084C2F5 /* Poppins-ExtraLight.ttf in Resources */, + 3D9881D7293757A80084C2F5 /* Poppins-SemiBold.ttf in Resources */, + 3D9881CA293757A80084C2F5 /* Poppins-BoldItalic.ttf in Resources */, + 3D9881CB293757A80084C2F5 /* Poppins-Light.ttf in Resources */, + 3D9881D5293757A80084C2F5 /* Poppins-Black.ttf in Resources */, + 3D9881D8293757A80084C2F5 /* Poppins-Italic.ttf in Resources */, + 3D9881CF293757A80084C2F5 /* Poppins-ExtraBold.ttf in Resources */, + 3D9881D3293757A80084C2F5 /* Poppins-LightItalic.ttf in Resources */, + 3DE75814292B876D0083EAB0 /* LaunchScreen.storyboard in Resources */, + 3D9881DD293758990084C2F5 /* Colors.xcassets in Resources */, + 3D9881CD293757A80084C2F5 /* Poppins-SemiBoldItalic.ttf in Resources */, + 3D9881D2293757A80084C2F5 /* Poppins-Regular.ttf in Resources */, + 3D9881CE293757A80084C2F5 /* Poppins-ExtraBoldItalic.ttf in Resources */, + 3D9881D4293757A80084C2F5 /* Poppins-Bold.ttf in Resources */, + 3D9881C8293757A80084C2F5 /* Poppins-ThinItalic.ttf in Resources */, + 3D9881CC293757A80084C2F5 /* Poppins-Medium.ttf in Resources */, + 3DE75811292B876D0083EAB0 /* Assets.xcassets in Resources */, + 3DE7580F292B876C0083EAB0 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3DE75822292F723C0083EAB0 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 3DE75800292B876C0083EAB0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 3DE75808292B876C0083EAB0 /* AppDelegate.swift in Sources */, + 3D9881DB293758630084C2F5 /* MessageInputTheme.swift in Sources */, + 3DE7580A292B876C0083EAB0 /* SceneDelegate.swift in Sources */, + 3D9881E0293DE8B50084C2F5 /* RootViewController.swift in Sources */, + 3DE5AC7F293F3B2A00683DCF /* LiveStreamViewController.swift in Sources */, + 3D9881B0293755BD0084C2F5 /* MessageListTheme.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3DE75820292F723C0083EAB0 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 3DE7582B292F723C0083EAB0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 3DE75803292B876C0083EAB0 /* live-event-app */; + targetProxy = 3DE7582A292F723C0083EAB0 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 3DE7580D292B876C0083EAB0 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 3DE7580E292B876C0083EAB0 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 3DE75812292B876D0083EAB0 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 3DE75813292B876D0083EAB0 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 3DE75816292B876D0083EAB0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 3DE75817292B876D0083EAB0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 3DE75819292B876D0083EAB0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 6GYF44HVGW; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "live-event-app/Info.plist"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.jguz.live-event-app"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 3DE7581A292B876D0083EAB0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 6GYF44HVGW; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = "live-event-app/Info.plist"; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; + INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.jguz.live-event-app"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 3DE7582D292F723C0083EAB0 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.1; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.pubnub.live-event-app-UITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "live-event-app"; + }; + name = Debug; + }; + 3DE7582E292F723C0083EAB0 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 16.1; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = "com.pubnub.live-event-app-UITests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = "live-event-app"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 3DE757FF292B876C0083EAB0 /* Build configuration list for PBXProject "live-event-app" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3DE75816292B876D0083EAB0 /* Debug */, + 3DE75817292B876D0083EAB0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3DE75818292B876D0083EAB0 /* Build configuration list for PBXNativeTarget "live-event-app" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3DE75819292B876D0083EAB0 /* Debug */, + 3DE7581A292B876D0083EAB0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3DE7582C292F723C0083EAB0 /* Build configuration list for PBXNativeTarget "live-event-app-UITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 3DE7582D292F723C0083EAB0 /* Debug */, + 3DE7582E292F723C0083EAB0 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 3DE7581B292B88020083EAB0 /* XCRemoteSwiftPackageReference "chat-components-ios" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/pubnub/chat-components-ios"; + requirement = { + kind = exactVersion; + version = 0.2.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 3DE7581C292B88020083EAB0 /* PubNubChat */ = { + isa = XCSwiftPackageProductDependency; + package = 3DE7581B292B88020083EAB0 /* XCRemoteSwiftPackageReference "chat-components-ios" */; + productName = PubNubChat; + }; + 3DE7581E292B88020083EAB0 /* PubNubChatComponents */ = { + isa = XCSwiftPackageProductDependency; + package = 3DE7581B292B88020083EAB0 /* XCRemoteSwiftPackageReference "chat-components-ios" */; + productName = PubNubChatComponents; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 3DE757FC292B876C0083EAB0 /* Project object */; +} diff --git a/live-event-app/live-event-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/live-event-app/live-event-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/live-event-app/live-event-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/live-event-app/live-event-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/live-event-app/live-event-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/live-event-app/live-event-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/live-event-app/live-event-app/AppDelegate.swift b/live-event-app/live-event-app/AppDelegate.swift new file mode 100644 index 0000000..ff95c66 --- /dev/null +++ b/live-event-app/live-event-app/AppDelegate.swift @@ -0,0 +1,53 @@ +// +// AppDelegate.swift +// +// PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks +// Copyright © 2021 PubNub Inc. +// https://www.pubnub.com/ +// https://www.pubnub.com/terms +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import UIKit +import PubNubChat +import PubNubChatComponents + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } +} diff --git a/live-event-app/live-event-app/Assets.xcassets/AccentColor.colorset/Contents.json b/live-event-app/live-event-app/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/live-event-app/live-event-app/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Assets.xcassets/AppIcon.appiconset/Contents.json b/live-event-app/live-event-app/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/live-event-app/live-event-app/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Assets.xcassets/Contents.json b/live-event-app/live-event-app/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/live-event-app/live-event-app/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Assets.xcassets/MessageList.SendIcon.imageset/Contents.json b/live-event-app/live-event-app/Assets.xcassets/MessageList.SendIcon.imageset/Contents.json new file mode 100644 index 0000000..1a5649e --- /dev/null +++ b/live-event-app/live-event-app/Assets.xcassets/MessageList.SendIcon.imageset/Contents.json @@ -0,0 +1,15 @@ +{ + "images" : [ + { + "filename" : "arrow-turn-up.pdf", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "template" + } +} diff --git a/live-event-app/live-event-app/Assets.xcassets/MessageList.SendIcon.imageset/arrow-turn-up.pdf b/live-event-app/live-event-app/Assets.xcassets/MessageList.SendIcon.imageset/arrow-turn-up.pdf new file mode 100644 index 0000000..b3a2883 Binary files /dev/null and b/live-event-app/live-event-app/Assets.xcassets/MessageList.SendIcon.imageset/arrow-turn-up.pdf differ diff --git a/live-event-app/live-event-app/Base.lproj/LaunchScreen.storyboard b/live-event-app/live-event-app/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..ecf7cb3 --- /dev/null +++ b/live-event-app/live-event-app/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/live-event-app/live-event-app/Base.lproj/Main.storyboard b/live-event-app/live-event-app/Base.lproj/Main.storyboard new file mode 100644 index 0000000..5de694a --- /dev/null +++ b/live-event-app/live-event-app/Base.lproj/Main.storyboard @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/live-event-app/live-event-app/Colors.xcassets/Contents.json b/live-event-app/live-event-app/Colors.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageInput.BackgroundColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageInput.BackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..104074c --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageInput.BackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.220", + "green" : "0.165", + "red" : "0.165" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.220", + "green" : "0.165", + "red" : "0.165" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageInput.SendButton.TintColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageInput.SendButton.TintColor.colorset/Contents.json new file mode 100644 index 0000000..bddd919 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageInput.SendButton.TintColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.706", + "green" : "0.706", + "red" : "0.706" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.706", + "green" : "0.706", + "red" : "0.706" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageInput.TextView.BackgroundColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageInput.TextView.BackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..672fb02 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageInput.TextView.BackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.380", + "green" : "0.290", + "red" : "0.290" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.380", + "green" : "0.290", + "red" : "0.290" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageInput.TextView.PlaceholderTextColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageInput.TextView.PlaceholderTextColor.colorset/Contents.json new file mode 100644 index 0000000..c89d76e --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageInput.TextView.PlaceholderTextColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.733", + "green" : "0.733", + "red" : "0.733" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.733", + "green" : "0.733", + "red" : "0.733" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageInput.TextView.TextColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageInput.TextView.TextColor.colorset/Contents.json new file mode 100644 index 0000000..22c4bb0 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageInput.TextView.TextColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageList.BackgroundColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageList.BackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..8079618 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageList.BackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.224", + "green" : "0.165", + "red" : "0.165" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.224", + "green" : "0.165", + "red" : "0.165" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.AuthorBackgroundColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.AuthorBackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..3020219 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.AuthorBackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.988", + "green" : "0.949", + "red" : "0.851" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.482", + "green" : "0.408", + "red" : "0.200" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.AuthorTextColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.AuthorTextColor.colorset/Contents.json new file mode 100644 index 0000000..dc9124b --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.AuthorTextColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.737", + "green" : "0.635", + "red" : "0.537" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.796", + "green" : "0.796", + "red" : "0.796" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.AuthorTextContentColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.AuthorTextContentColor.colorset/Contents.json new file mode 100644 index 0000000..efeb397 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.AuthorTextContentColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.957", + "green" : "0.957", + "red" : "0.957" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.957", + "green" : "0.957", + "red" : "0.957" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.IncomingAuthorTextColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.IncomingAuthorTextColor.colorset/Contents.json new file mode 100644 index 0000000..dc9124b --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.IncomingAuthorTextColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.737", + "green" : "0.635", + "red" : "0.537" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.796", + "green" : "0.796", + "red" : "0.796" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.IncomingBackgroundColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.IncomingBackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..2c40598 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.IncomingBackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.965", + "green" : "0.941", + "red" : "0.918" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.196", + "green" : "0.196", + "red" : "0.196" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.IncomingTextColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.IncomingTextColor.colorset/Contents.json new file mode 100644 index 0000000..efeb397 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageList.Cell.IncomingTextColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.957", + "green" : "0.957", + "red" : "0.957" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.957", + "green" : "0.957", + "red" : "0.957" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageList.NavigationBar.BackgroundColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageList.NavigationBar.BackgroundColor.colorset/Contents.json new file mode 100644 index 0000000..b37ba80 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageList.NavigationBar.BackgroundColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.157", + "green" : "0.110", + "red" : "0.110" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "0.157", + "green" : "0.110", + "red" : "0.110" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Colors.xcassets/MessageList.NavigationBar.TitleTextColor.colorset/Contents.json b/live-event-app/live-event-app/Colors.xcassets/MessageList.NavigationBar.TitleTextColor.colorset/Contents.json new file mode 100644 index 0000000..22c4bb0 --- /dev/null +++ b/live-event-app/live-event-app/Colors.xcassets/MessageList.NavigationBar.TitleTextColor.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors" : [ + { + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "color" : { + "color-space" : "srgb", + "components" : { + "alpha" : "1.000", + "blue" : "1.000", + "green" : "1.000", + "red" : "1.000" + } + }, + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/live-event-app/live-event-app/Info.plist b/live-event-app/live-event-app/Info.plist new file mode 100644 index 0000000..c762baa --- /dev/null +++ b/live-event-app/live-event-app/Info.plist @@ -0,0 +1,33 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIAppFonts + + Poppins-Regular.ttf + Poppins-Light.ttf + Poppins-Medium.ttf + Poppins-SemiBold.ttf + Poppins-Bold.ttf + + + diff --git a/live-event-app/live-event-app/LiveStreamViewController.swift b/live-event-app/live-event-app/LiveStreamViewController.swift new file mode 100644 index 0000000..f22a3a3 --- /dev/null +++ b/live-event-app/live-event-app/LiveStreamViewController.swift @@ -0,0 +1,68 @@ +// +// LiveStremViewController.swift +// +// PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks +// Copyright © 2021 PubNub Inc. +// https://www.pubnub.com/ +// https://www.pubnub.com/terms +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import UIKit + +protocol LiveStreamPlayerView { + func loadVideo() + func play() +} + +final class LiveStreamViewController: UIViewController { + private weak var playerView: (UIView & LiveStreamPlayerView)? + + override func viewDidLoad() { + super.viewDidLoad() + + let playerView = createPlayerView() + playerView.translatesAutoresizingMaskIntoConstraints = false + view.addSubview(playerView) + self.playerView = playerView + + NSLayoutConstraint.activate([ + playerView.leadingAnchor.constraint(equalTo: view.leadingAnchor), + playerView.topAnchor.constraint(equalTo: view.topAnchor), + playerView.widthAnchor.constraint(equalTo: view.widthAnchor), + playerView.heightAnchor.constraint(equalTo: view.heightAnchor) + ]) + + playerView.loadVideo() + } + + private func createPlayerView() -> UIView & LiveStreamPlayerView { + UIView() + } +} + +extension UIView: LiveStreamPlayerView { + public func loadVideo() { + + } + public func play() { + + } +} diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/OFL.txt b/live-event-app/live-event-app/Resources/Fonts/Poppins/OFL.txt new file mode 100644 index 0000000..246c977 --- /dev/null +++ b/live-event-app/live-event-app/Resources/Fonts/Poppins/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2020 The Poppins Project Authors (https://github.com/itfoundry/Poppins) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Black.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Black.ttf new file mode 100644 index 0000000..71c0f99 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Black.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-BlackItalic.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-BlackItalic.ttf new file mode 100644 index 0000000..7aeb58b Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-BlackItalic.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Bold.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Bold.ttf new file mode 100644 index 0000000..00559ee Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Bold.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-BoldItalic.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-BoldItalic.ttf new file mode 100644 index 0000000..e61e8e8 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-BoldItalic.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraBold.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraBold.ttf new file mode 100644 index 0000000..df70936 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraBold.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraBoldItalic.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraBoldItalic.ttf new file mode 100644 index 0000000..14d2b37 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraBoldItalic.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraLight.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraLight.ttf new file mode 100644 index 0000000..e76ec69 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraLight.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraLightItalic.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraLightItalic.ttf new file mode 100644 index 0000000..89513d9 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ExtraLightItalic.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Italic.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Italic.ttf new file mode 100644 index 0000000..12b7b3c Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Italic.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Light.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Light.ttf new file mode 100644 index 0000000..bc36bcc Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Light.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-LightItalic.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-LightItalic.ttf new file mode 100644 index 0000000..9e70be6 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-LightItalic.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Medium.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Medium.ttf new file mode 100644 index 0000000..6bcdcc2 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Medium.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-MediumItalic.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-MediumItalic.ttf new file mode 100644 index 0000000..be67410 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-MediumItalic.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Regular.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Regular.ttf new file mode 100644 index 0000000..9f0c71b Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Regular.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-SemiBold.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-SemiBold.ttf new file mode 100644 index 0000000..74c726e Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-SemiBold.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-SemiBoldItalic.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-SemiBoldItalic.ttf new file mode 100644 index 0000000..3e6c942 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-SemiBoldItalic.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Thin.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Thin.ttf new file mode 100644 index 0000000..03e7366 Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-Thin.ttf differ diff --git a/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ThinItalic.ttf b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ThinItalic.ttf new file mode 100644 index 0000000..e26db5d Binary files /dev/null and b/live-event-app/live-event-app/Resources/Fonts/Poppins/Poppins-ThinItalic.ttf differ diff --git a/live-event-app/live-event-app/RootViewController.swift b/live-event-app/live-event-app/RootViewController.swift new file mode 100644 index 0000000..305a631 --- /dev/null +++ b/live-event-app/live-event-app/RootViewController.swift @@ -0,0 +1,146 @@ +// +// RootViewController.swift +// +// PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks +// Copyright © 2021 PubNub Inc. +// https://www.pubnub.com/ +// https://www.pubnub.com/terms +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import UIKit +import PubNubChat +import PubNubChatComponents + +final class RootViewController: UIViewController { + private let provider: PubNubChatProvider + private let channelId: String + private var portraitConstraints: [NSLayoutConstraint] = [] + private var landscapeConstraints: [NSLayoutConstraint] = [] + private var scene: UIWindowScene + + init( + channelId: String, + provider: PubNubChatProvider, + scene: UIWindowScene + ) { + self.channelId = channelId + self.provider = provider + self.scene = scene + + super.init(nibName: nil, bundle: nil) + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + override func viewDidLoad() { + super.viewDidLoad() + + guard let messageListViewModel = try? provider.messageListComponentViewModel(pubnubChannelId: channelId) else { + preconditionFailure("Missing required data. Make sure the channel object and current user are stored locally") + } + + messageListViewModel.customNavigationTitleString = nil + messageListViewModel.customNavigationTitleView = { viewModel in + let customTitleView = UILabel() + customTitleView.font = UIFont(name: "Poppins-Bold", size: 14) + customTitleView.textColor = UIColor(named: "MessageList.NavigationBar.TitleTextColor") + customTitleView.text = "STREAM CHAT" + customTitleView.sizeToFit() + return customTitleView + } + + let messageListViewController = messageListViewModel.configuredComponentView() + let messageListContainerViewController = UINavigationController(rootViewController: messageListViewController) + let streamViewController = LiveStreamViewController() + + createContainerViewController( + messageListContainerViewController: messageListContainerViewController, + streamViewController: streamViewController + ) + applyConstraints( + streamViewController: streamViewController, + messageListContainerViewController: messageListContainerViewController + ) + } + + private func createContainerViewController( + messageListContainerViewController: UINavigationController, + streamViewController: UIViewController + ) { + self.addChild(messageListContainerViewController) + self.addChild(streamViewController) + self.view.addSubview(messageListContainerViewController.view) + self.view.addSubview(streamViewController.view) + + messageListContainerViewController.didMove(toParent: self) + streamViewController.didMove(toParent: self) + } + + private func applyConstraints( + streamViewController: UIViewController, + messageListContainerViewController: UIViewController + ) { + messageListContainerViewController.view.translatesAutoresizingMaskIntoConstraints = false + streamViewController.view.translatesAutoresizingMaskIntoConstraints = false + + portraitConstraints = [ + messageListContainerViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), + messageListContainerViewController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), + messageListContainerViewController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), + messageListContainerViewController.view.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: 9.0 / 16.0), + streamViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), + streamViewController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), + streamViewController.view.topAnchor.constraint(equalTo: view.topAnchor), + streamViewController.view.bottomAnchor.constraint(equalTo: messageListContainerViewController.view.topAnchor) + ] + landscapeConstraints = [ + streamViewController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), + streamViewController.view.trailingAnchor.constraint(equalTo: messageListContainerViewController.view.leadingAnchor), + streamViewController.view.topAnchor.constraint(equalTo: view.topAnchor), + streamViewController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), + messageListContainerViewController.view.leadingAnchor.constraint(equalTo: streamViewController.view.trailingAnchor), + messageListContainerViewController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), + messageListContainerViewController.view.widthAnchor.constraint(equalTo: view.widthAnchor, multiplier: 7.0 / 16.0), + messageListContainerViewController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor), + messageListContainerViewController.view.topAnchor.constraint(equalTo: view.topAnchor) + ] + + NSLayoutConstraint.activate( + scene.interfaceOrientation.isPortrait ? portraitConstraints : landscapeConstraints + ) + } + + override func willTransition( + to newCollection: UITraitCollection, + with coordinator: UIViewControllerTransitionCoordinator + ) { + super.willTransition( + to: newCollection, + with: coordinator + ) + coordinator.animate { context in + NSLayoutConstraint.deactivate(self.scene.interfaceOrientation.isPortrait ? self.landscapeConstraints : self.portraitConstraints) + NSLayoutConstraint.activate(self.scene.interfaceOrientation.isPortrait ? self.portraitConstraints : self.landscapeConstraints) + } + } +} diff --git a/live-event-app/live-event-app/SceneDelegate.swift b/live-event-app/live-event-app/SceneDelegate.swift new file mode 100644 index 0000000..20f3a28 --- /dev/null +++ b/live-event-app/live-event-app/SceneDelegate.swift @@ -0,0 +1,112 @@ +// +// SceneDelegate.swift +// +// PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks +// Copyright © 2021 PubNub Inc. +// https://www.pubnub.com/ +// https://www.pubnub.com/terms +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import UIKit + +import PubNub +import PubNubChat +import PubNubChatComponents + +let PUBNUB_PUBLISH_KEY = "demo" +let PUBNUB_SUBSCRIBE_KEY = "demo" + +final class SceneDelegate: UIResponder, UIWindowSceneDelegate { + lazy var pubnubConfiguration = { + return PubNubConfiguration( + publishKey: PUBNUB_PUBLISH_KEY, + subscribeKey: PUBNUB_SUBSCRIBE_KEY, + userId: "user_0" + ) + }() + + var window: UIWindow? + var chatProvider: PubNubChatProvider? + var defaultChannelId = "demo" + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + guard let windowScene = (scene as? UIWindowScene) else { + preconditionFailure("Cannot cast to UIWindowScene") + } + + let window = UIWindow(windowScene: windowScene) + + // Enables PubNub logging to the Console + PubNub.log.levels = [.all] + PubNub.log.writers = [ConsoleLogWriter()] + + if chatProvider == nil { + let provider = createChatProviderInstance() + let channelId = defaultChannelId + + provider.themeProvider.template.messageListComponent = messageListComponentTheme + provider.themeProvider.template.messageInputComponent = messageInputComponentTheme + + preloadData(provider) { [weak self] in + window.rootViewController = RootViewController(channelId: channelId, provider: provider, scene: windowScene) + self?.window = window + self?.chatProvider = provider + window.makeKeyAndVisible() + } + } + } + + private func createChatProviderInstance() -> PubNubChatProvider { + PubNubChatProvider( + pubnubProvider: PubNub(configuration: pubnubConfiguration), + datastoreConfiguration: DatastoreConfiguration( + bundle: .pubnubChat, + dataModelFilename: "PubNubChatModel", + storageDirectlyURL: nil, + storageUniqueFilename: "default", + cleanStorageOnLoad: true + ) + ) + } + + private func preloadData(_ chatProvider: PubNubChatProvider, completion: @escaping (() -> Void)) { + let channel = PubNubChatChannel( + id: defaultChannelId, + name: "Default", + type: "direct", + avatarURL: URL(string: "https://picsum.photos/seed/\(defaultChannelId)/200") + ) + + let user = PubNubChatUser( + id: pubnubConfiguration.userId, + name: "user_0", + avatarURL: URL(string: "https://picsum.photos/seed/\(pubnubConfiguration.userId)/200") + ) + + let membership = PubNubChatMember( + channel: channel, + user: user + ) + + chatProvider.pubnubProvider.subscribe(.init(channels: [defaultChannelId], withPresence: false)) + chatProvider.dataProvider.load(members: [membership], completion: completion) + } +} diff --git a/live-event-app/live-event-app/Theming/MessageInputTheme.swift b/live-event-app/live-event-app/Theming/MessageInputTheme.swift new file mode 100644 index 0000000..efde972 --- /dev/null +++ b/live-event-app/live-event-app/Theming/MessageInputTheme.swift @@ -0,0 +1,84 @@ +// +// MessageInputTheme.swift +// +// PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks +// Copyright © 2022 PubNub Inc. +// https://www.pubnub.com/ +// https://www.pubnub.com/terms +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import UIKit +import PubNubChat +import PubNubChatComponents + +final class CustomMessageInputBarComponent: MessageInputBarComponent { + override func setupComponent() { + super.setupComponent() + inputTextView?.layer.cornerRadius = 8 + } +} + +let messageInputComponentTheme = MessageInputComponentTheme( + viewType: CustomMessageInputBarComponent.self, + backgroundColor: UIColor(named: "MessageInput.BackgroundColor")!, + placeholderText: "Type your message", + placeholderTextColor: UIColor(named: "MessageInput.TextView.PlaceholderTextColor")!, + placeholderTextFont: UIFont(name: "Poppins-Regular", size: 15)!, + textInputTheme: InputTextViewComponentTheme( + customType: UITextView.self, + backgroundColor: UIColor(named: "MessageInput.TextView.BackgroundColor")!, + textColor: UIColor(named: "MessageInput.TextView.TextColor")!, + textFont: UIFont(name: "Poppins-Regular", size: 15)!, + usesStandardTextScaling: true, + dataDetectorTypes: .all, + linkTextAttributes: [:], + isEditable: true, + isExclusiveTouch: false, + scrollView: .enabled, + textContainerInset: UIEdgeInsets(top: 6, left: 4, bottom: 0, right: 0), + typingAttributes: [:], + autocapitalizationType: .sentences, + autocorrectionType: .no, + spellCheckingType: .no, + smartQuotesType: .default, + smartDashesType: .default, + smartInsertDeleteType: .default, + keyboardType: .default, + keyboardAppearance: .default, + textContentType: nil + ), + sendButton: ButtonComponentTheme( + backgroundColor: .clear, + buttonType: .custom, + tintColor: UIColor(named: "MessageInput.SendButton.TintColor")!, + title: .empty, + titleHighlighted: .empty, + titleFont: AppearanceTemplate.Font.caption1, + image: ButtonImageStateTheme( + image: UIImage(named: "MessageList.SendIcon")?.withTintColor(UIColor(named: "MessageInput.SendButton.TintColor")!), + backgroundImage: nil + ), + imageHighlighted: .empty + ), + typingIndicatorService: .shared, + publishTypingIndicator: true, + displayTypingIndicator: false +) diff --git a/live-event-app/live-event-app/Theming/MessageListTheme.swift b/live-event-app/live-event-app/Theming/MessageListTheme.swift new file mode 100644 index 0000000..657e281 --- /dev/null +++ b/live-event-app/live-event-app/Theming/MessageListTheme.swift @@ -0,0 +1,230 @@ +// +// MessageListTheme.swift +// +// PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks +// Copyright © 2022 PubNub Inc. +// https://www.pubnub.com/ +// https://www.pubnub.com/terms +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import UIKit +import PubNubChat +import PubNubChatComponents +import Combine +import ChatLayout + +let navigationBarAppearance: UINavigationBarAppearance = { + let appearance = UINavigationBarAppearance() + appearance.configureWithDefaultBackground() + appearance.backgroundColor = UIColor(named: "MessageList.NavigationBar.BackgroundColor")! + return appearance +}() + +let navigationBarTheme = NavigationBarTheme( + largeTitleDisplayMode: .never, + standardAppearance: navigationBarAppearance, + compactAppearance: navigationBarAppearance, + scrollEdgeAppearance: navigationBarAppearance, + customTitleView: .empty, + barButtonThemes: [:] +) + +let messageListCollectionViewTheme = CollectionViewComponentTheme( + viewType: UICollectionView.self, + layoutType: CollectionViewChatLayout.self, + headerType: ReusableLabelViewComponent.self, + footerType: ReusableLabelViewComponent.self, + backgroundColor: UIColor(named: "MessageList.BackgroundColor")!, + scrollViewTheme: .init(isScrollEnabled: true, bounces: true, scrollsToTop: true), + refreshControlTheme: nil, + prefetchIndexThreshold: nil, + isPrefetchingEnabled: false +) + +let autorItemTheme = MessageListCellComponentTheme( + textMessageContentCellType: CustomMessageListItemCell.self, + backgroundColor: .clear, + highlightColor: .clear, + selectedColor: .clear, + alignment: .leading, + maxWidthPercentage: 0.65, + bubbleContainerTheme: BubbleComponentTheme( + alignment: .leading, + containerType: .normal, + backgroundColor: UIColor(named: "MessageList.Cell.AuthorBackgroundColor")!, + tailSize: 0, + layoutMargin: UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16) + ), + contentTextTheme: TextViewComponentTheme( + customType: UITextView.self, + backgroundColor: .clear, + textColor: UIColor(named: "MessageList.Cell.AuthorTextContentColor")!, + textFont: UIFont(name: "Poppins-Regular", size: 14)!, + usesStandardTextScaling: false, + dataDetectorTypes: .all, + linkTextAttributes: [:], + isEditable: false, + isExclusiveTouch: false, + scrollView: .disabled, + textContainerInset: .zero + ), + itemTheme: BasicComponentTheme( + imageView: ImageComponentTheme(customType: UIImageView.self, cornerRadius: 10), + primaryLabel: LabelComponentTheme( + customType: UILabel.self, + textFont: UIFont(name: "Poppins-Regular", size: 12), + textColor: UIColor(named: "MessageList.Cell.AuthorTextColor")!, + adjustsFontForContentSizeCategory: true, + textAlignment: .natural, + textMargin: .zero + ), + secondaryLabel: LabelComponentTheme( + customType: UILabel.self, + textFont: UIFont(name: "Poppins-Regular", size: 11), + textColor: UIColor(named: "MessageList.Cell.AuthorTextColor")!, + adjustsFontForContentSizeCategory: true, + textAlignment: .natural, + textMargin: .zero + ) + ), + dateFormatter: .messageInline +) + +let incomingItemTheme = MessageListCellComponentTheme( + textMessageContentCellType: CustomMessageListItemCell.self, + backgroundColor: .clear, + highlightColor: .clear, + selectedColor: .clear, + alignment: .trailing, + maxWidthPercentage: 0.65, + bubbleContainerTheme: BubbleComponentTheme( + alignment: .trailing, + containerType: .normal, + backgroundColor: UIColor(named: "MessageList.Cell.IncomingBackgroundColor")!, + tailSize: 0, + layoutMargin: UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16) + ), + contentTextTheme: TextViewComponentTheme( + customType: UITextView.self, + backgroundColor: .clear, + textColor: UIColor(named: "MessageList.Cell.IncomingTextColor")!, + textFont: UIFont(name: "Poppins-Regular", size: 15)!, + usesStandardTextScaling: false, + dataDetectorTypes: .all, + linkTextAttributes: [:], + isEditable: false, + isExclusiveTouch: false, + scrollView: .disabled, + textContainerInset: .zero + ), + itemTheme: BasicComponentTheme( + imageView: ImageComponentTheme(customType: UIImageView.self, cornerRadius: 10), + primaryLabel: LabelComponentTheme( + customType: UILabel.self, + textFont: UIFont(name: "Poppins-Regular", size: 12), + textColor: UIColor(named: "MessageList.Cell.IncomingAuthorTextColor")!, + adjustsFontForContentSizeCategory: true, + textAlignment: .natural, + textMargin: .zero + ), + secondaryLabel: LabelComponentTheme( + customType: UILabel.self, + textFont: UIFont(name: "Poppins-Regular", size: 11), + textColor: UIColor(named: "MessageList.Cell.IncomingAuthorTextColor")!, + adjustsFontForContentSizeCategory: true, + textAlignment: .natural, + textMargin: .zero + ) + ), + dateFormatter: .messageInline +) + +let messageListComponentTheme = MessageListComponentTheme( + controllerType: CollectionViewComponent.self, + backgroundColor: .clear, + navigationBarTheme: navigationBarTheme, + collectionViewTheme: messageListCollectionViewTheme, + messageInputComponent: messageInputComponentTheme, + incomingItemTheme: incomingItemTheme, + authorItemTheme: autorItemTheme, + typingIndicatorCellTheme: AnimatedTypingIndicatorCellTheme( + cellType: IMessageTypingIndicatorCell.self, + contentViewType: IMessageTypingBubbleView.self, + backgroundColor: .clear, + highlightColor: .clear, + selectedColor: .clear, + primaryContentColor: .clear, + secondaryContentColor: .clear, + animationEnabled: true, + pulsing: true, + bounces: true, + bounceDelay: 0.33, + bounceOffset: 0.25, + fades: true + ), + enableReactions: false +) + +final class CustomMessageListItemCell: MessageCollectionViewCellComponent { + private var authorAvatarView: PubNubInlineAvatarComponentView! + private var messageContentView: PubNubMessageContentTextView! + + override func setupSubviews() { + super.setupSubviews() + + authorAvatarView = PubNubInlineAvatarComponentView() + messageContentView = PubNubMessageContentTextView() + + authorAvatarView.translatesAutoresizingMaskIntoConstraints = false + messageContentView.translatesAutoresizingMaskIntoConstraints = false + + cellContainer.axis = .horizontal + cellContainer.distribution = .fill + cellContainer.isLayoutMarginsRelativeArrangement = false + cellContainer.alignment = .center + + cellContainer.stackView.addArrangedSubview(authorAvatarView) + cellContainer.stackView.setCustomSpacing(10, after: authorAvatarView) + cellContainer.stackView.addArrangedSubview(messageContentView) + + authorAvatarView.widthAnchor.constraint(equalToConstant: 20).isActive = true + authorAvatarView.heightAnchor.constraint(equalToConstant: 20).isActive = true + + delegate = messageContentView + } + + public override func configure( + _ message: Message, + theme: MessageListCellComponentTheme + ) { + authorAvatarView.imageView + .configure( + message.userViewModel.userAvatarUrlPublisher, + placeholder: theme.itemTheme.imageView.$localImage.eraseToAnyPublisher(), + cancelIn: &contentCancellables + ) + .theming(theme.itemTheme.imageView, cancelIn: &contentCancellables) + + messageContentView.textView + .configure(message.messageTextPublisher, cancelIn: &contentCancellables) + .theming(theme.contentTextTheme, cancelIn: &contentCancellables) + } +}