├── Podfile ├── README.md ├── SocketIO_Starter.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── abhi.makadiya.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── abhi.makadiya.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── SocketIO_Starter.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── abhi.makadiya.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── SocketIO_Starter ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Debug.xcconfig ├── Extensions │ ├── Dictionary+Extension.swift │ ├── NotificationName+Extension.swift │ ├── QueueExtension.swift │ ├── String+Extension.swift │ ├── UIApplication+Extension.swift │ └── UIViewController+Extension.swift ├── Info.plist ├── Modules │ ├── View │ │ └── ViewController.swift │ └── ViewModel │ │ └── ViewModel.swift ├── Network Layer │ ├── APIError.swift │ ├── Environment.swift │ └── SocketManager │ │ ├── APIManager+Error.swift │ │ ├── SocketIO+Request.swift │ │ └── SocketIOManager.swift ├── Release.xcconfig ├── Requests │ └── ReqGameInfo.swift ├── Response │ └── HomeModel.swift └── SceneDelegate.swift ├── SocketIO_StarterTests ├── Info.plist └── SocketIO_StarterTests.swift └── SocketIO_StarterUITests ├── Info.plist └── SocketIO_StarterUITests.swift /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'SocketIO_Starter' do 5 | # Comment the next line if you don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | pod 'Socket.IO-Client-Swift', '~> 15.2.0' 9 | pod 'SVProgressHUD', '~> 2.2.5' 10 | 11 | end 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SocketIO Starter 2 | 3 | 4 | 5 | [![Swift 5.0](https://img.shields.io/badge/Swift-5.0-orange.svg?style=flat)](https://swift.org) 6 | 7 | 8 | 9 | This repository is an example project of [Socket.IO](https://github.com/socketio/socket.io-client-swift) configuration in IOS using Swift. 10 | 11 | 12 | 13 | ### Included Points 14 | 15 | - Socket.io shared class that helps to establish socket in project. 16 | 17 | - Socket configuration (establish, connect, disconnect, etc...) 18 | 19 | - Handle socket connection. 20 | 21 | 22 | 23 | 24 | ### SocketIo Basic Functions Description 25 | 26 | 27 | 28 | ##### 1. How to create Socket instance and connect to the end server? 29 | 30 | 1. Initialize `SocketManager:` 31 | 32 | ``` 33 | 34 | let manager = SocketManager(socketURL: URL(string: AppConstant.socketURL)!, config: [.log(false), .reconnects(true), .forcePolling(true)]) 35 | 36 | ``` 37 | 38 | - In config parameter, client can add multiple properties with type SocketIOClientConfiguration. 39 | 40 | .log(Bool) -> If passed `true`, the client will log debug information. This should be turned off in production code. 41 | 42 | .reconnects(Bool) -> If passed `false`, the client will not reconnect when it loses connection. Useful if you want full control over when reconnects happen. 43 | 44 | .forcePolling(Bool) -> If passed `true`, the only transport that will be used will be HTTP long-polling. 45 | 46 | 47 | 48 | 2. get socket instance from `SocketManager:` 49 | 50 | ``` 51 | 52 | manager?.defaultSocket 53 | 54 | ``` 55 | 56 | - Client also can add `nsp` while fetching socket instance: 57 | 58 | nsp(nameSpace) -> Use to add subDomain for the socket connection. 59 | 60 | For example, for the server https://www.xyz.com has another subdomain "/user_socket" for socket connection. 61 | 62 | To connect with the subDomain, create socket with nameSpace. 63 | 64 | ``` 65 | 66 | manager?.socket(forNamespace: "user_socket") 67 | 68 | ``` 69 | 70 | 3. Client can connect socket instance with `.connect()` default method. 71 | 72 | ``` 73 | 74 | socket?.connect() 75 | 76 | ``` 77 | 78 | 79 | 80 | ##### 2. How to add Header in socket? 81 | 82 | Client can add header through `manager.config` variable with `.extraHeaders` param. 83 | 84 | ``` 85 | 86 | var dictHeader = [String: String]() 87 | 88 | dictHeader["Authorization"] = "Bearer <---Connection Token--->" 89 | 90 | manager?.config = SocketIOClientConfiguration(arrayLiteral: .compress, .extraHeaders(dictHeader)) 91 | 92 | ``` 93 | 94 | `Important:` 95 | 96 | Client can only add header before connection established. After socket connection, client can not change header object. For that, client need to create new instance of socket and reconnect to the server. 97 | 98 | 99 | 100 | ##### 3. How to emit event with socket? 101 | 102 | `.emit` method is use to pass the dictionary object to the server with eventName. 103 | 104 | ``` 105 | 106 | SocketIOManager.shared.socket?.emitWithAck("eventName", reqObj.toDictionary()).timingOut(after: 20) { data in 107 | 108 | } 109 | 110 | ``` 111 | 112 | 113 | 114 | ##### 4. How to receive response from the server? 115 | 116 | Call this `.on` method to observe the events. client gets notified when response has come. 117 | 118 | ``` 119 | 120 | SocketIOManager.shared.socket?.on("eventName") { data, ack in 121 | 122 | guard let dictResp = data[0] as? [String: Any] else { 123 | 124 | return 125 | 126 | } 127 | 128 | } 129 | 130 | ``` 131 | 132 | Here, response has come in first index of Array type in `.on` closure. 133 | 134 | 135 | 136 | ##### 5. How to disable socket listener? 137 | 138 | socket.off will remove socket listener. Where id is unique UUID. Better to release listener before deinitialization. 139 | 140 | It will help to release memory from ARC. 141 | 142 | ``` 143 | 144 | SocketIOManager.shared.socket?.off(id: listenerVariable) 145 | 146 | ``` 147 | 148 | 149 | 150 | ### Important Note 151 | 152 | - IOS Doesn't allow socket to connect in the background. For better usecase, disconnect socket when goes to background and connect it in foreground. -------------------------------------------------------------------------------- /SocketIO_Starter.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 51; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CDC886D824EF890F009A669A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC886D724EF890F009A669A /* AppDelegate.swift */; }; 11 | CDC886DA24EF890F009A669A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC886D924EF890F009A669A /* SceneDelegate.swift */; }; 12 | CDC886DC24EF890F009A669A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC886DB24EF890F009A669A /* ViewController.swift */; }; 13 | CDC886DF24EF890F009A669A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CDC886DD24EF890F009A669A /* Main.storyboard */; }; 14 | CDC886E124EF8910009A669A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CDC886E024EF8910009A669A /* Assets.xcassets */; }; 15 | CDC886E424EF8910009A669A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CDC886E224EF8910009A669A /* LaunchScreen.storyboard */; }; 16 | CDC886EF24EF8911009A669A /* SocketIO_StarterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC886EE24EF8911009A669A /* SocketIO_StarterTests.swift */; }; 17 | CDC886FA24EF8911009A669A /* SocketIO_StarterUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC886F924EF8911009A669A /* SocketIO_StarterUITests.swift */; }; 18 | CDC8870824EF8C6B009A669A /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = CDC8870724EF8C6B009A669A /* Debug.xcconfig */; }; 19 | CDC8870A24EF8CEB009A669A /* Release.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = CDC8870924EF8CEB009A669A /* Release.xcconfig */; }; 20 | CDC8870E24EF8FC3009A669A /* Environment.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8870D24EF8FC3009A669A /* Environment.swift */; }; 21 | CDC8871124EFA29A009A669A /* SocketIO+Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8871024EFA29A009A669A /* SocketIO+Request.swift */; }; 22 | CDC8871324EFA2FA009A669A /* SocketIOManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8871224EFA2FA009A669A /* SocketIOManager.swift */; }; 23 | CDC8871624EFB03E009A669A /* NotificationName+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8871524EFB03E009A669A /* NotificationName+Extension.swift */; }; 24 | CDC8871824EFB08D009A669A /* QueueExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8871724EFB08D009A669A /* QueueExtension.swift */; }; 25 | CDC8871A24EFB13A009A669A /* UIApplication+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8871924EFB13A009A669A /* UIApplication+Extension.swift */; }; 26 | CDC8871C24EFB486009A669A /* APIManager+Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8871B24EFB486009A669A /* APIManager+Error.swift */; }; 27 | CDC8871E24EFB4E9009A669A /* APIError.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8871D24EFB4E9009A669A /* APIError.swift */; }; 28 | CDC8872024EFB525009A669A /* Dictionary+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8871F24EFB525009A669A /* Dictionary+Extension.swift */; }; 29 | CDC8872224EFB585009A669A /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8872124EFB585009A669A /* String+Extension.swift */; }; 30 | CDC8872424EFBD99009A669A /* UIViewController+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8872324EFBD99009A669A /* UIViewController+Extension.swift */; }; 31 | CDC8872724EFC918009A669A /* ReqGameInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8872624EFC918009A669A /* ReqGameInfo.swift */; }; 32 | CDC8872C24EFC9B6009A669A /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8872B24EFC9B6009A669A /* ViewModel.swift */; }; 33 | CDC8872F24EFCAE3009A669A /* HomeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = CDC8872E24EFCAE3009A669A /* HomeModel.swift */; }; 34 | F9A18582D3C110E66E26E72B /* Pods_SocketIO_Starter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 470C2730B33CE40547CEEA54 /* Pods_SocketIO_Starter.framework */; }; 35 | /* End PBXBuildFile section */ 36 | 37 | /* Begin PBXContainerItemProxy section */ 38 | CDC886EB24EF8911009A669A /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = CDC886CC24EF890F009A669A /* Project object */; 41 | proxyType = 1; 42 | remoteGlobalIDString = CDC886D324EF890F009A669A; 43 | remoteInfo = SocketIO_Starter; 44 | }; 45 | CDC886F624EF8911009A669A /* PBXContainerItemProxy */ = { 46 | isa = PBXContainerItemProxy; 47 | containerPortal = CDC886CC24EF890F009A669A /* Project object */; 48 | proxyType = 1; 49 | remoteGlobalIDString = CDC886D324EF890F009A669A; 50 | remoteInfo = SocketIO_Starter; 51 | }; 52 | /* End PBXContainerItemProxy section */ 53 | 54 | /* Begin PBXFileReference section */ 55 | 470C2730B33CE40547CEEA54 /* Pods_SocketIO_Starter.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SocketIO_Starter.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | CDC886D424EF890F009A669A /* SocketIO_Starter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SocketIO_Starter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | CDC886D724EF890F009A669A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 58 | CDC886D924EF890F009A669A /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; 59 | CDC886DB24EF890F009A669A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 60 | CDC886DE24EF890F009A669A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 61 | CDC886E024EF8910009A669A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 62 | CDC886E324EF8910009A669A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 63 | CDC886E524EF8910009A669A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 64 | CDC886EA24EF8911009A669A /* SocketIO_StarterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SocketIO_StarterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 65 | CDC886EE24EF8911009A669A /* SocketIO_StarterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketIO_StarterTests.swift; sourceTree = ""; }; 66 | CDC886F024EF8911009A669A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 67 | CDC886F524EF8911009A669A /* SocketIO_StarterUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SocketIO_StarterUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | CDC886F924EF8911009A669A /* SocketIO_StarterUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketIO_StarterUITests.swift; sourceTree = ""; }; 69 | CDC886FB24EF8911009A669A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 70 | CDC8870724EF8C6B009A669A /* Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; 71 | CDC8870924EF8CEB009A669A /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; 72 | CDC8870D24EF8FC3009A669A /* Environment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Environment.swift; sourceTree = ""; }; 73 | CDC8871024EFA29A009A669A /* SocketIO+Request.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "SocketIO+Request.swift"; sourceTree = ""; }; 74 | CDC8871224EFA2FA009A669A /* SocketIOManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SocketIOManager.swift; sourceTree = ""; }; 75 | CDC8871524EFB03E009A669A /* NotificationName+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NotificationName+Extension.swift"; sourceTree = ""; }; 76 | CDC8871724EFB08D009A669A /* QueueExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueueExtension.swift; sourceTree = ""; }; 77 | CDC8871924EFB13A009A669A /* UIApplication+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIApplication+Extension.swift"; sourceTree = ""; }; 78 | CDC8871B24EFB486009A669A /* APIManager+Error.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "APIManager+Error.swift"; sourceTree = ""; }; 79 | CDC8871D24EFB4E9009A669A /* APIError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIError.swift; sourceTree = ""; }; 80 | CDC8871F24EFB525009A669A /* Dictionary+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Dictionary+Extension.swift"; sourceTree = ""; }; 81 | CDC8872124EFB585009A669A /* String+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = ""; }; 82 | CDC8872324EFBD99009A669A /* UIViewController+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Extension.swift"; sourceTree = ""; }; 83 | CDC8872624EFC918009A669A /* ReqGameInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReqGameInfo.swift; sourceTree = ""; }; 84 | CDC8872B24EFC9B6009A669A /* ViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewModel.swift; sourceTree = ""; }; 85 | CDC8872E24EFCAE3009A669A /* HomeModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeModel.swift; sourceTree = ""; }; 86 | D1B814C1B219544BB1E9EF5D /* Pods-SocketIO_Starter.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SocketIO_Starter.debug.xcconfig"; path = "Target Support Files/Pods-SocketIO_Starter/Pods-SocketIO_Starter.debug.xcconfig"; sourceTree = ""; }; 87 | ED8599386A193DF59ED7789A /* Pods-SocketIO_Starter.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SocketIO_Starter.release.xcconfig"; path = "Target Support Files/Pods-SocketIO_Starter/Pods-SocketIO_Starter.release.xcconfig"; sourceTree = ""; }; 88 | /* End PBXFileReference section */ 89 | 90 | /* Begin PBXFrameworksBuildPhase section */ 91 | CDC886D124EF890F009A669A /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | F9A18582D3C110E66E26E72B /* Pods_SocketIO_Starter.framework in Frameworks */, 96 | ); 97 | runOnlyForDeploymentPostprocessing = 0; 98 | }; 99 | CDC886E724EF8911009A669A /* Frameworks */ = { 100 | isa = PBXFrameworksBuildPhase; 101 | buildActionMask = 2147483647; 102 | files = ( 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | CDC886F224EF8911009A669A /* Frameworks */ = { 107 | isa = PBXFrameworksBuildPhase; 108 | buildActionMask = 2147483647; 109 | files = ( 110 | ); 111 | runOnlyForDeploymentPostprocessing = 0; 112 | }; 113 | /* End PBXFrameworksBuildPhase section */ 114 | 115 | /* Begin PBXGroup section */ 116 | B023878ED9435E8248A4D8D9 /* Pods */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | D1B814C1B219544BB1E9EF5D /* Pods-SocketIO_Starter.debug.xcconfig */, 120 | ED8599386A193DF59ED7789A /* Pods-SocketIO_Starter.release.xcconfig */, 121 | ); 122 | path = Pods; 123 | sourceTree = ""; 124 | }; 125 | CDC886CB24EF890F009A669A = { 126 | isa = PBXGroup; 127 | children = ( 128 | CDC886D624EF890F009A669A /* SocketIO_Starter */, 129 | CDC886ED24EF8911009A669A /* SocketIO_StarterTests */, 130 | CDC886F824EF8911009A669A /* SocketIO_StarterUITests */, 131 | CDC886D524EF890F009A669A /* Products */, 132 | B023878ED9435E8248A4D8D9 /* Pods */, 133 | FA8C4C727D9CBC1495470223 /* Frameworks */, 134 | ); 135 | sourceTree = ""; 136 | }; 137 | CDC886D524EF890F009A669A /* Products */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | CDC886D424EF890F009A669A /* SocketIO_Starter.app */, 141 | CDC886EA24EF8911009A669A /* SocketIO_StarterTests.xctest */, 142 | CDC886F524EF8911009A669A /* SocketIO_StarterUITests.xctest */, 143 | ); 144 | name = Products; 145 | sourceTree = ""; 146 | }; 147 | CDC886D624EF890F009A669A /* SocketIO_Starter */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | CDC8872D24EFCAD2009A669A /* Response */, 151 | CDC8872824EFC985009A669A /* Modules */, 152 | CDC8872524EFC90E009A669A /* Requests */, 153 | CDC8871424EFB036009A669A /* Extensions */, 154 | CDC886D724EF890F009A669A /* AppDelegate.swift */, 155 | CDC886D924EF890F009A669A /* SceneDelegate.swift */, 156 | CDC886DD24EF890F009A669A /* Main.storyboard */, 157 | CDC886E024EF8910009A669A /* Assets.xcassets */, 158 | CDC886E224EF8910009A669A /* LaunchScreen.storyboard */, 159 | CDC886E524EF8910009A669A /* Info.plist */, 160 | CDC8870C24EF8FA7009A669A /* Network Layer */, 161 | CDC8870724EF8C6B009A669A /* Debug.xcconfig */, 162 | CDC8870924EF8CEB009A669A /* Release.xcconfig */, 163 | ); 164 | path = SocketIO_Starter; 165 | sourceTree = ""; 166 | }; 167 | CDC886ED24EF8911009A669A /* SocketIO_StarterTests */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | CDC886EE24EF8911009A669A /* SocketIO_StarterTests.swift */, 171 | CDC886F024EF8911009A669A /* Info.plist */, 172 | ); 173 | path = SocketIO_StarterTests; 174 | sourceTree = ""; 175 | }; 176 | CDC886F824EF8911009A669A /* SocketIO_StarterUITests */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | CDC886F924EF8911009A669A /* SocketIO_StarterUITests.swift */, 180 | CDC886FB24EF8911009A669A /* Info.plist */, 181 | ); 182 | path = SocketIO_StarterUITests; 183 | sourceTree = ""; 184 | }; 185 | CDC8870C24EF8FA7009A669A /* Network Layer */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | CDC8870F24EFA279009A669A /* SocketManager */, 189 | CDC8870D24EF8FC3009A669A /* Environment.swift */, 190 | CDC8871D24EFB4E9009A669A /* APIError.swift */, 191 | ); 192 | path = "Network Layer"; 193 | sourceTree = ""; 194 | }; 195 | CDC8870F24EFA279009A669A /* SocketManager */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | CDC8871B24EFB486009A669A /* APIManager+Error.swift */, 199 | CDC8871024EFA29A009A669A /* SocketIO+Request.swift */, 200 | CDC8871224EFA2FA009A669A /* SocketIOManager.swift */, 201 | ); 202 | path = SocketManager; 203 | sourceTree = ""; 204 | }; 205 | CDC8871424EFB036009A669A /* Extensions */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | CDC8871F24EFB525009A669A /* Dictionary+Extension.swift */, 209 | CDC8871924EFB13A009A669A /* UIApplication+Extension.swift */, 210 | CDC8871724EFB08D009A669A /* QueueExtension.swift */, 211 | CDC8871524EFB03E009A669A /* NotificationName+Extension.swift */, 212 | CDC8872124EFB585009A669A /* String+Extension.swift */, 213 | CDC8872324EFBD99009A669A /* UIViewController+Extension.swift */, 214 | ); 215 | path = Extensions; 216 | sourceTree = ""; 217 | }; 218 | CDC8872524EFC90E009A669A /* Requests */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | CDC8872624EFC918009A669A /* ReqGameInfo.swift */, 222 | ); 223 | path = Requests; 224 | sourceTree = ""; 225 | }; 226 | CDC8872824EFC985009A669A /* Modules */ = { 227 | isa = PBXGroup; 228 | children = ( 229 | CDC8872A24EFC992009A669A /* ViewModel */, 230 | CDC8872924EFC98C009A669A /* View */, 231 | ); 232 | path = Modules; 233 | sourceTree = ""; 234 | }; 235 | CDC8872924EFC98C009A669A /* View */ = { 236 | isa = PBXGroup; 237 | children = ( 238 | CDC886DB24EF890F009A669A /* ViewController.swift */, 239 | ); 240 | path = View; 241 | sourceTree = ""; 242 | }; 243 | CDC8872A24EFC992009A669A /* ViewModel */ = { 244 | isa = PBXGroup; 245 | children = ( 246 | CDC8872B24EFC9B6009A669A /* ViewModel.swift */, 247 | ); 248 | path = ViewModel; 249 | sourceTree = ""; 250 | }; 251 | CDC8872D24EFCAD2009A669A /* Response */ = { 252 | isa = PBXGroup; 253 | children = ( 254 | CDC8872E24EFCAE3009A669A /* HomeModel.swift */, 255 | ); 256 | path = Response; 257 | sourceTree = ""; 258 | }; 259 | FA8C4C727D9CBC1495470223 /* Frameworks */ = { 260 | isa = PBXGroup; 261 | children = ( 262 | 470C2730B33CE40547CEEA54 /* Pods_SocketIO_Starter.framework */, 263 | ); 264 | name = Frameworks; 265 | sourceTree = ""; 266 | }; 267 | /* End PBXGroup section */ 268 | 269 | /* Begin PBXNativeTarget section */ 270 | CDC886D324EF890F009A669A /* SocketIO_Starter */ = { 271 | isa = PBXNativeTarget; 272 | buildConfigurationList = CDC886FE24EF8911009A669A /* Build configuration list for PBXNativeTarget "SocketIO_Starter" */; 273 | buildPhases = ( 274 | 06B0826D930F0CC3113C186B /* [CP] Check Pods Manifest.lock */, 275 | CDC886D024EF890F009A669A /* Sources */, 276 | CDC886D124EF890F009A669A /* Frameworks */, 277 | CDC886D224EF890F009A669A /* Resources */, 278 | F1C86C9265F364EAE550C5C5 /* [CP] Embed Pods Frameworks */, 279 | ); 280 | buildRules = ( 281 | ); 282 | dependencies = ( 283 | ); 284 | name = SocketIO_Starter; 285 | productName = SocketIO_Starter; 286 | productReference = CDC886D424EF890F009A669A /* SocketIO_Starter.app */; 287 | productType = "com.apple.product-type.application"; 288 | }; 289 | CDC886E924EF8911009A669A /* SocketIO_StarterTests */ = { 290 | isa = PBXNativeTarget; 291 | buildConfigurationList = CDC8870124EF8911009A669A /* Build configuration list for PBXNativeTarget "SocketIO_StarterTests" */; 292 | buildPhases = ( 293 | CDC886E624EF8911009A669A /* Sources */, 294 | CDC886E724EF8911009A669A /* Frameworks */, 295 | CDC886E824EF8911009A669A /* Resources */, 296 | ); 297 | buildRules = ( 298 | ); 299 | dependencies = ( 300 | CDC886EC24EF8911009A669A /* PBXTargetDependency */, 301 | ); 302 | name = SocketIO_StarterTests; 303 | productName = SocketIO_StarterTests; 304 | productReference = CDC886EA24EF8911009A669A /* SocketIO_StarterTests.xctest */; 305 | productType = "com.apple.product-type.bundle.unit-test"; 306 | }; 307 | CDC886F424EF8911009A669A /* SocketIO_StarterUITests */ = { 308 | isa = PBXNativeTarget; 309 | buildConfigurationList = CDC8870424EF8911009A669A /* Build configuration list for PBXNativeTarget "SocketIO_StarterUITests" */; 310 | buildPhases = ( 311 | CDC886F124EF8911009A669A /* Sources */, 312 | CDC886F224EF8911009A669A /* Frameworks */, 313 | CDC886F324EF8911009A669A /* Resources */, 314 | ); 315 | buildRules = ( 316 | ); 317 | dependencies = ( 318 | CDC886F724EF8911009A669A /* PBXTargetDependency */, 319 | ); 320 | name = SocketIO_StarterUITests; 321 | productName = SocketIO_StarterUITests; 322 | productReference = CDC886F524EF8911009A669A /* SocketIO_StarterUITests.xctest */; 323 | productType = "com.apple.product-type.bundle.ui-testing"; 324 | }; 325 | /* End PBXNativeTarget section */ 326 | 327 | /* Begin PBXProject section */ 328 | CDC886CC24EF890F009A669A /* Project object */ = { 329 | isa = PBXProject; 330 | attributes = { 331 | LastSwiftUpdateCheck = 1160; 332 | LastUpgradeCheck = 1160; 333 | ORGANIZATIONNAME = "Abhi Makadiya"; 334 | TargetAttributes = { 335 | CDC886D324EF890F009A669A = { 336 | CreatedOnToolsVersion = 11.6; 337 | }; 338 | CDC886E924EF8911009A669A = { 339 | CreatedOnToolsVersion = 11.6; 340 | TestTargetID = CDC886D324EF890F009A669A; 341 | }; 342 | CDC886F424EF8911009A669A = { 343 | CreatedOnToolsVersion = 11.6; 344 | TestTargetID = CDC886D324EF890F009A669A; 345 | }; 346 | }; 347 | }; 348 | buildConfigurationList = CDC886CF24EF890F009A669A /* Build configuration list for PBXProject "SocketIO_Starter" */; 349 | compatibilityVersion = "Xcode 9.3"; 350 | developmentRegion = en; 351 | hasScannedForEncodings = 0; 352 | knownRegions = ( 353 | en, 354 | Base, 355 | ); 356 | mainGroup = CDC886CB24EF890F009A669A; 357 | productRefGroup = CDC886D524EF890F009A669A /* Products */; 358 | projectDirPath = ""; 359 | projectRoot = ""; 360 | targets = ( 361 | CDC886D324EF890F009A669A /* SocketIO_Starter */, 362 | CDC886E924EF8911009A669A /* SocketIO_StarterTests */, 363 | CDC886F424EF8911009A669A /* SocketIO_StarterUITests */, 364 | ); 365 | }; 366 | /* End PBXProject section */ 367 | 368 | /* Begin PBXResourcesBuildPhase section */ 369 | CDC886D224EF890F009A669A /* Resources */ = { 370 | isa = PBXResourcesBuildPhase; 371 | buildActionMask = 2147483647; 372 | files = ( 373 | CDC8870824EF8C6B009A669A /* Debug.xcconfig in Resources */, 374 | CDC886E424EF8910009A669A /* LaunchScreen.storyboard in Resources */, 375 | CDC886E124EF8910009A669A /* Assets.xcassets in Resources */, 376 | CDC886DF24EF890F009A669A /* Main.storyboard in Resources */, 377 | CDC8870A24EF8CEB009A669A /* Release.xcconfig in Resources */, 378 | ); 379 | runOnlyForDeploymentPostprocessing = 0; 380 | }; 381 | CDC886E824EF8911009A669A /* Resources */ = { 382 | isa = PBXResourcesBuildPhase; 383 | buildActionMask = 2147483647; 384 | files = ( 385 | ); 386 | runOnlyForDeploymentPostprocessing = 0; 387 | }; 388 | CDC886F324EF8911009A669A /* Resources */ = { 389 | isa = PBXResourcesBuildPhase; 390 | buildActionMask = 2147483647; 391 | files = ( 392 | ); 393 | runOnlyForDeploymentPostprocessing = 0; 394 | }; 395 | /* End PBXResourcesBuildPhase section */ 396 | 397 | /* Begin PBXShellScriptBuildPhase section */ 398 | 06B0826D930F0CC3113C186B /* [CP] Check Pods Manifest.lock */ = { 399 | isa = PBXShellScriptBuildPhase; 400 | buildActionMask = 2147483647; 401 | files = ( 402 | ); 403 | inputFileListPaths = ( 404 | ); 405 | inputPaths = ( 406 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 407 | "${PODS_ROOT}/Manifest.lock", 408 | ); 409 | name = "[CP] Check Pods Manifest.lock"; 410 | outputFileListPaths = ( 411 | ); 412 | outputPaths = ( 413 | "$(DERIVED_FILE_DIR)/Pods-SocketIO_Starter-checkManifestLockResult.txt", 414 | ); 415 | runOnlyForDeploymentPostprocessing = 0; 416 | shellPath = /bin/sh; 417 | 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"; 418 | showEnvVarsInLog = 0; 419 | }; 420 | F1C86C9265F364EAE550C5C5 /* [CP] Embed Pods Frameworks */ = { 421 | isa = PBXShellScriptBuildPhase; 422 | buildActionMask = 2147483647; 423 | files = ( 424 | ); 425 | inputFileListPaths = ( 426 | "${PODS_ROOT}/Target Support Files/Pods-SocketIO_Starter/Pods-SocketIO_Starter-frameworks-${CONFIGURATION}-input-files.xcfilelist", 427 | ); 428 | name = "[CP] Embed Pods Frameworks"; 429 | outputFileListPaths = ( 430 | "${PODS_ROOT}/Target Support Files/Pods-SocketIO_Starter/Pods-SocketIO_Starter-frameworks-${CONFIGURATION}-output-files.xcfilelist", 431 | ); 432 | runOnlyForDeploymentPostprocessing = 0; 433 | shellPath = /bin/sh; 434 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SocketIO_Starter/Pods-SocketIO_Starter-frameworks.sh\"\n"; 435 | showEnvVarsInLog = 0; 436 | }; 437 | /* End PBXShellScriptBuildPhase section */ 438 | 439 | /* Begin PBXSourcesBuildPhase section */ 440 | CDC886D024EF890F009A669A /* Sources */ = { 441 | isa = PBXSourcesBuildPhase; 442 | buildActionMask = 2147483647; 443 | files = ( 444 | CDC886DC24EF890F009A669A /* ViewController.swift in Sources */, 445 | CDC8871824EFB08D009A669A /* QueueExtension.swift in Sources */, 446 | CDC8871624EFB03E009A669A /* NotificationName+Extension.swift in Sources */, 447 | CDC8870E24EF8FC3009A669A /* Environment.swift in Sources */, 448 | CDC8872424EFBD99009A669A /* UIViewController+Extension.swift in Sources */, 449 | CDC8871A24EFB13A009A669A /* UIApplication+Extension.swift in Sources */, 450 | CDC8872C24EFC9B6009A669A /* ViewModel.swift in Sources */, 451 | CDC886D824EF890F009A669A /* AppDelegate.swift in Sources */, 452 | CDC8872724EFC918009A669A /* ReqGameInfo.swift in Sources */, 453 | CDC8872F24EFCAE3009A669A /* HomeModel.swift in Sources */, 454 | CDC8872224EFB585009A669A /* String+Extension.swift in Sources */, 455 | CDC8871124EFA29A009A669A /* SocketIO+Request.swift in Sources */, 456 | CDC8871C24EFB486009A669A /* APIManager+Error.swift in Sources */, 457 | CDC8871324EFA2FA009A669A /* SocketIOManager.swift in Sources */, 458 | CDC886DA24EF890F009A669A /* SceneDelegate.swift in Sources */, 459 | CDC8871E24EFB4E9009A669A /* APIError.swift in Sources */, 460 | CDC8872024EFB525009A669A /* Dictionary+Extension.swift in Sources */, 461 | ); 462 | runOnlyForDeploymentPostprocessing = 0; 463 | }; 464 | CDC886E624EF8911009A669A /* Sources */ = { 465 | isa = PBXSourcesBuildPhase; 466 | buildActionMask = 2147483647; 467 | files = ( 468 | CDC886EF24EF8911009A669A /* SocketIO_StarterTests.swift in Sources */, 469 | ); 470 | runOnlyForDeploymentPostprocessing = 0; 471 | }; 472 | CDC886F124EF8911009A669A /* Sources */ = { 473 | isa = PBXSourcesBuildPhase; 474 | buildActionMask = 2147483647; 475 | files = ( 476 | CDC886FA24EF8911009A669A /* SocketIO_StarterUITests.swift in Sources */, 477 | ); 478 | runOnlyForDeploymentPostprocessing = 0; 479 | }; 480 | /* End PBXSourcesBuildPhase section */ 481 | 482 | /* Begin PBXTargetDependency section */ 483 | CDC886EC24EF8911009A669A /* PBXTargetDependency */ = { 484 | isa = PBXTargetDependency; 485 | target = CDC886D324EF890F009A669A /* SocketIO_Starter */; 486 | targetProxy = CDC886EB24EF8911009A669A /* PBXContainerItemProxy */; 487 | }; 488 | CDC886F724EF8911009A669A /* PBXTargetDependency */ = { 489 | isa = PBXTargetDependency; 490 | target = CDC886D324EF890F009A669A /* SocketIO_Starter */; 491 | targetProxy = CDC886F624EF8911009A669A /* PBXContainerItemProxy */; 492 | }; 493 | /* End PBXTargetDependency section */ 494 | 495 | /* Begin PBXVariantGroup section */ 496 | CDC886DD24EF890F009A669A /* Main.storyboard */ = { 497 | isa = PBXVariantGroup; 498 | children = ( 499 | CDC886DE24EF890F009A669A /* Base */, 500 | ); 501 | name = Main.storyboard; 502 | sourceTree = ""; 503 | }; 504 | CDC886E224EF8910009A669A /* LaunchScreen.storyboard */ = { 505 | isa = PBXVariantGroup; 506 | children = ( 507 | CDC886E324EF8910009A669A /* Base */, 508 | ); 509 | name = LaunchScreen.storyboard; 510 | sourceTree = ""; 511 | }; 512 | /* End PBXVariantGroup section */ 513 | 514 | /* Begin XCBuildConfiguration section */ 515 | CDC886FC24EF8911009A669A /* Debug */ = { 516 | isa = XCBuildConfiguration; 517 | baseConfigurationReference = CDC8870724EF8C6B009A669A /* Debug.xcconfig */; 518 | buildSettings = { 519 | ALWAYS_SEARCH_USER_PATHS = NO; 520 | CLANG_ANALYZER_NONNULL = YES; 521 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 522 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 523 | CLANG_CXX_LIBRARY = "libc++"; 524 | CLANG_ENABLE_MODULES = YES; 525 | CLANG_ENABLE_OBJC_ARC = YES; 526 | CLANG_ENABLE_OBJC_WEAK = YES; 527 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 528 | CLANG_WARN_BOOL_CONVERSION = YES; 529 | CLANG_WARN_COMMA = YES; 530 | CLANG_WARN_CONSTANT_CONVERSION = YES; 531 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 532 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 533 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 534 | CLANG_WARN_EMPTY_BODY = YES; 535 | CLANG_WARN_ENUM_CONVERSION = YES; 536 | CLANG_WARN_INFINITE_RECURSION = YES; 537 | CLANG_WARN_INT_CONVERSION = YES; 538 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 539 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 540 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 541 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 542 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 543 | CLANG_WARN_STRICT_PROTOTYPES = YES; 544 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 545 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 546 | CLANG_WARN_UNREACHABLE_CODE = YES; 547 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 548 | COPY_PHASE_STRIP = NO; 549 | DEBUG_INFORMATION_FORMAT = dwarf; 550 | ENABLE_STRICT_OBJC_MSGSEND = YES; 551 | ENABLE_TESTABILITY = YES; 552 | GCC_C_LANGUAGE_STANDARD = gnu11; 553 | GCC_DYNAMIC_NO_PIC = NO; 554 | GCC_NO_COMMON_BLOCKS = YES; 555 | GCC_OPTIMIZATION_LEVEL = 0; 556 | GCC_PREPROCESSOR_DEFINITIONS = ( 557 | "DEBUG=1", 558 | "$(inherited)", 559 | ); 560 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 561 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 562 | GCC_WARN_UNDECLARED_SELECTOR = YES; 563 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 564 | GCC_WARN_UNUSED_FUNCTION = YES; 565 | GCC_WARN_UNUSED_VARIABLE = YES; 566 | IPHONEOS_DEPLOYMENT_TARGET = 13.6; 567 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 568 | MTL_FAST_MATH = YES; 569 | ONLY_ACTIVE_ARCH = YES; 570 | SDKROOT = iphoneos; 571 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 572 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 573 | }; 574 | name = Debug; 575 | }; 576 | CDC886FD24EF8911009A669A /* Release */ = { 577 | isa = XCBuildConfiguration; 578 | baseConfigurationReference = CDC8870924EF8CEB009A669A /* Release.xcconfig */; 579 | buildSettings = { 580 | ALWAYS_SEARCH_USER_PATHS = NO; 581 | CLANG_ANALYZER_NONNULL = YES; 582 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 583 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 584 | CLANG_CXX_LIBRARY = "libc++"; 585 | CLANG_ENABLE_MODULES = YES; 586 | CLANG_ENABLE_OBJC_ARC = YES; 587 | CLANG_ENABLE_OBJC_WEAK = YES; 588 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 589 | CLANG_WARN_BOOL_CONVERSION = YES; 590 | CLANG_WARN_COMMA = YES; 591 | CLANG_WARN_CONSTANT_CONVERSION = YES; 592 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 593 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 594 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 595 | CLANG_WARN_EMPTY_BODY = YES; 596 | CLANG_WARN_ENUM_CONVERSION = YES; 597 | CLANG_WARN_INFINITE_RECURSION = YES; 598 | CLANG_WARN_INT_CONVERSION = YES; 599 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 600 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 601 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 602 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 603 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 604 | CLANG_WARN_STRICT_PROTOTYPES = YES; 605 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 606 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 607 | CLANG_WARN_UNREACHABLE_CODE = YES; 608 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 609 | COPY_PHASE_STRIP = NO; 610 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 611 | ENABLE_NS_ASSERTIONS = NO; 612 | ENABLE_STRICT_OBJC_MSGSEND = YES; 613 | GCC_C_LANGUAGE_STANDARD = gnu11; 614 | GCC_NO_COMMON_BLOCKS = YES; 615 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 616 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 617 | GCC_WARN_UNDECLARED_SELECTOR = YES; 618 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 619 | GCC_WARN_UNUSED_FUNCTION = YES; 620 | GCC_WARN_UNUSED_VARIABLE = YES; 621 | IPHONEOS_DEPLOYMENT_TARGET = 13.6; 622 | MTL_ENABLE_DEBUG_INFO = NO; 623 | MTL_FAST_MATH = YES; 624 | SDKROOT = iphoneos; 625 | SWIFT_COMPILATION_MODE = wholemodule; 626 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 627 | VALIDATE_PRODUCT = YES; 628 | }; 629 | name = Release; 630 | }; 631 | CDC886FF24EF8911009A669A /* Debug */ = { 632 | isa = XCBuildConfiguration; 633 | baseConfigurationReference = D1B814C1B219544BB1E9EF5D /* Pods-SocketIO_Starter.debug.xcconfig */; 634 | buildSettings = { 635 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 636 | CODE_SIGN_STYLE = Automatic; 637 | DEVELOPMENT_TEAM = Y98X8JAPH6; 638 | INFOPLIST_FILE = SocketIO_Starter/Info.plist; 639 | LD_RUNPATH_SEARCH_PATHS = ( 640 | "$(inherited)", 641 | "@executable_path/Frameworks", 642 | ); 643 | PRODUCT_BUNDLE_IDENTIFIER = "com.simform.SocketIO-Starter.SocketIO-Starter"; 644 | PRODUCT_NAME = "$(TARGET_NAME)"; 645 | SWIFT_VERSION = 5.0; 646 | TARGETED_DEVICE_FAMILY = "1,2"; 647 | }; 648 | name = Debug; 649 | }; 650 | CDC8870024EF8911009A669A /* Release */ = { 651 | isa = XCBuildConfiguration; 652 | baseConfigurationReference = ED8599386A193DF59ED7789A /* Pods-SocketIO_Starter.release.xcconfig */; 653 | buildSettings = { 654 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 655 | CODE_SIGN_STYLE = Automatic; 656 | DEVELOPMENT_TEAM = Y98X8JAPH6; 657 | INFOPLIST_FILE = SocketIO_Starter/Info.plist; 658 | LD_RUNPATH_SEARCH_PATHS = ( 659 | "$(inherited)", 660 | "@executable_path/Frameworks", 661 | ); 662 | PRODUCT_BUNDLE_IDENTIFIER = "com.simform.SocketIO-Starter.SocketIO-Starter"; 663 | PRODUCT_NAME = "$(TARGET_NAME)"; 664 | SWIFT_VERSION = 5.0; 665 | TARGETED_DEVICE_FAMILY = "1,2"; 666 | }; 667 | name = Release; 668 | }; 669 | CDC8870224EF8911009A669A /* Debug */ = { 670 | isa = XCBuildConfiguration; 671 | buildSettings = { 672 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 673 | BUNDLE_LOADER = "$(TEST_HOST)"; 674 | CODE_SIGN_STYLE = Automatic; 675 | DEVELOPMENT_TEAM = Y98X8JAPH6; 676 | INFOPLIST_FILE = SocketIO_StarterTests/Info.plist; 677 | IPHONEOS_DEPLOYMENT_TARGET = 13.6; 678 | LD_RUNPATH_SEARCH_PATHS = ( 679 | "$(inherited)", 680 | "@executable_path/Frameworks", 681 | "@loader_path/Frameworks", 682 | ); 683 | PRODUCT_BUNDLE_IDENTIFIER = "com.simform.SocketIO-Starter.SocketIO-StarterTests"; 684 | PRODUCT_NAME = "$(TARGET_NAME)"; 685 | SWIFT_VERSION = 5.0; 686 | TARGETED_DEVICE_FAMILY = "1,2"; 687 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SocketIO_Starter.app/SocketIO_Starter"; 688 | }; 689 | name = Debug; 690 | }; 691 | CDC8870324EF8911009A669A /* Release */ = { 692 | isa = XCBuildConfiguration; 693 | buildSettings = { 694 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 695 | BUNDLE_LOADER = "$(TEST_HOST)"; 696 | CODE_SIGN_STYLE = Automatic; 697 | DEVELOPMENT_TEAM = Y98X8JAPH6; 698 | INFOPLIST_FILE = SocketIO_StarterTests/Info.plist; 699 | IPHONEOS_DEPLOYMENT_TARGET = 13.6; 700 | LD_RUNPATH_SEARCH_PATHS = ( 701 | "$(inherited)", 702 | "@executable_path/Frameworks", 703 | "@loader_path/Frameworks", 704 | ); 705 | PRODUCT_BUNDLE_IDENTIFIER = "com.simform.SocketIO-Starter.SocketIO-StarterTests"; 706 | PRODUCT_NAME = "$(TARGET_NAME)"; 707 | SWIFT_VERSION = 5.0; 708 | TARGETED_DEVICE_FAMILY = "1,2"; 709 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SocketIO_Starter.app/SocketIO_Starter"; 710 | }; 711 | name = Release; 712 | }; 713 | CDC8870524EF8911009A669A /* Debug */ = { 714 | isa = XCBuildConfiguration; 715 | buildSettings = { 716 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 717 | CODE_SIGN_STYLE = Automatic; 718 | DEVELOPMENT_TEAM = Y98X8JAPH6; 719 | INFOPLIST_FILE = SocketIO_StarterUITests/Info.plist; 720 | LD_RUNPATH_SEARCH_PATHS = ( 721 | "$(inherited)", 722 | "@executable_path/Frameworks", 723 | "@loader_path/Frameworks", 724 | ); 725 | PRODUCT_BUNDLE_IDENTIFIER = "com.simform.SocketIO-Starter.SocketIO-StarterUITests"; 726 | PRODUCT_NAME = "$(TARGET_NAME)"; 727 | SWIFT_VERSION = 5.0; 728 | TARGETED_DEVICE_FAMILY = "1,2"; 729 | TEST_TARGET_NAME = SocketIO_Starter; 730 | }; 731 | name = Debug; 732 | }; 733 | CDC8870624EF8911009A669A /* Release */ = { 734 | isa = XCBuildConfiguration; 735 | buildSettings = { 736 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 737 | CODE_SIGN_STYLE = Automatic; 738 | DEVELOPMENT_TEAM = Y98X8JAPH6; 739 | INFOPLIST_FILE = SocketIO_StarterUITests/Info.plist; 740 | LD_RUNPATH_SEARCH_PATHS = ( 741 | "$(inherited)", 742 | "@executable_path/Frameworks", 743 | "@loader_path/Frameworks", 744 | ); 745 | PRODUCT_BUNDLE_IDENTIFIER = "com.simform.SocketIO-Starter.SocketIO-StarterUITests"; 746 | PRODUCT_NAME = "$(TARGET_NAME)"; 747 | SWIFT_VERSION = 5.0; 748 | TARGETED_DEVICE_FAMILY = "1,2"; 749 | TEST_TARGET_NAME = SocketIO_Starter; 750 | }; 751 | name = Release; 752 | }; 753 | /* End XCBuildConfiguration section */ 754 | 755 | /* Begin XCConfigurationList section */ 756 | CDC886CF24EF890F009A669A /* Build configuration list for PBXProject "SocketIO_Starter" */ = { 757 | isa = XCConfigurationList; 758 | buildConfigurations = ( 759 | CDC886FC24EF8911009A669A /* Debug */, 760 | CDC886FD24EF8911009A669A /* Release */, 761 | ); 762 | defaultConfigurationIsVisible = 0; 763 | defaultConfigurationName = Release; 764 | }; 765 | CDC886FE24EF8911009A669A /* Build configuration list for PBXNativeTarget "SocketIO_Starter" */ = { 766 | isa = XCConfigurationList; 767 | buildConfigurations = ( 768 | CDC886FF24EF8911009A669A /* Debug */, 769 | CDC8870024EF8911009A669A /* Release */, 770 | ); 771 | defaultConfigurationIsVisible = 0; 772 | defaultConfigurationName = Release; 773 | }; 774 | CDC8870124EF8911009A669A /* Build configuration list for PBXNativeTarget "SocketIO_StarterTests" */ = { 775 | isa = XCConfigurationList; 776 | buildConfigurations = ( 777 | CDC8870224EF8911009A669A /* Debug */, 778 | CDC8870324EF8911009A669A /* Release */, 779 | ); 780 | defaultConfigurationIsVisible = 0; 781 | defaultConfigurationName = Release; 782 | }; 783 | CDC8870424EF8911009A669A /* Build configuration list for PBXNativeTarget "SocketIO_StarterUITests" */ = { 784 | isa = XCConfigurationList; 785 | buildConfigurations = ( 786 | CDC8870524EF8911009A669A /* Debug */, 787 | CDC8870624EF8911009A669A /* Release */, 788 | ); 789 | defaultConfigurationIsVisible = 0; 790 | defaultConfigurationName = Release; 791 | }; 792 | /* End XCConfigurationList section */ 793 | }; 794 | rootObject = CDC886CC24EF890F009A669A /* Project object */; 795 | } 796 | -------------------------------------------------------------------------------- /SocketIO_Starter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SocketIO_Starter.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SocketIO_Starter.xcodeproj/project.xcworkspace/xcuserdata/abhi.makadiya.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-simformsolutions/SocketIO_Starter/cff7706a41cdefc3343cbaea6df20f9e08c17ed9/SocketIO_Starter.xcodeproj/project.xcworkspace/xcuserdata/abhi.makadiya.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SocketIO_Starter.xcodeproj/xcuserdata/abhi.makadiya.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | SocketIO_Starter.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 4 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SocketIO_Starter.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SocketIO_Starter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SocketIO_Starter.xcworkspace/xcuserdata/abhi.makadiya.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mobile-simformsolutions/SocketIO_Starter/cff7706a41cdefc3343cbaea6df20f9e08c17ed9/SocketIO_Starter.xcworkspace/xcuserdata/abhi.makadiya.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /SocketIO_Starter.xcworkspace/xcuserdata/abhi.makadiya.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /SocketIO_Starter/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | var appDelegate = UIApplication.shared.delegate as? AppDelegate 12 | 13 | @UIApplicationMain 14 | class AppDelegate: UIResponder, UIApplicationDelegate { 15 | 16 | var window: UIWindow? 17 | 18 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 19 | // Override point for customization after application launch. 20 | if #available(iOS 13.0, *) {} else { 21 | //for IOS 12 or lower 22 | SocketIOManager.shared.establishConnection() 23 | } 24 | setupInitialNavigation(nil) 25 | return true 26 | } 27 | 28 | func applicationDidEnterBackground(_ application: UIApplication) { 29 | // Not called under iOS 13 - See SceneDelegate sceneDidEnterBackground 30 | SocketIOManager.shared.closeConnection() 31 | } 32 | 33 | func applicationWillEnterForeground(_ application: UIApplication) { 34 | // Not called under iOS 13 - See SceneDelegate sceneWillEnterForeground 35 | SocketIOManager.shared.establishConnection() 36 | } 37 | 38 | // MARK: UISceneSession Lifecycle 39 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { 40 | // Called when a new scene session is being created. 41 | // Use this method to select a configuration to create the new scene with. 42 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) 43 | } 44 | 45 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { 46 | // Called when the user discards a scene session. 47 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. 48 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return. 49 | } 50 | 51 | 52 | } 53 | 54 | //MARK: - Other Stuffs 55 | extension AppDelegate { 56 | 57 | func setupInitialNavigation(_ win: UIWindow?) { 58 | if #available(iOS 13.0, *) { 59 | self.window = UIWindow(frame: UIScreen.main.bounds) 60 | let navigationController = UINavigationController() 61 | navigationController.navigationBar.isHidden = true 62 | win?.rootViewController = navigationController 63 | win?.makeKeyAndVisible() 64 | } else { 65 | window = UIWindow(frame: UIScreen.main.bounds) 66 | let navigationController = UINavigationController() 67 | navigationController.navigationBar.isHidden = true 68 | window?.rootViewController = navigationController 69 | window?.makeKeyAndVisible() 70 | } 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /SocketIO_Starter/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 | -------------------------------------------------------------------------------- /SocketIO_Starter/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /SocketIO_Starter/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 | -------------------------------------------------------------------------------- /SocketIO_Starter/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 | -------------------------------------------------------------------------------- /SocketIO_Starter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Debug.xcconfig 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | // Configuration settings file format documentation can be found at: 10 | // https://help.apple.com/xcode/#/dev745c5c974 11 | 12 | SocketURL = your_socket_url 13 | SocketNameSpace = /your_socket_subDomain 14 | -------------------------------------------------------------------------------- /SocketIO_Starter/Extensions/Dictionary+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Dictionary+Extension.swift 3 | // Curveball 4 | // 5 | // Created by Abhi Makadiya on 09/07/20. 6 | // Copyright © 2020 Simform Solutions Pvt. Ltd. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension Dictionary { 12 | 13 | var json: String { 14 | let invalidJson = "" 15 | do { 16 | let jsonData = try JSONSerialization.data(withJSONObject: self, options: .prettyPrinted) 17 | return String(bytes: jsonData, encoding: String.Encoding.utf8) ?? invalidJson 18 | } catch { 19 | return invalidJson 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /SocketIO_Starter/Extensions/NotificationName+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NotificationName+Extension.swift 3 | // Curveball 4 | // 5 | // Created by Abhi Makadia on 23/06/20. 6 | // Copyright © 2020 Simform Solutions Pvt. Ltd. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension Notification.Name { 12 | //Socket 13 | static let socketEstablished = Notification.Name("socketEstablished") 14 | static let socketConnectNotify = Notification.Name("socketConnectNotify") 15 | static let socketConnectionErrorNotify = Notification.Name("socketErrorConnectionNotify") 16 | static let socketDisconnectNotify = Notification.Name("socketDisconnectNotify") 17 | } 18 | -------------------------------------------------------------------------------- /SocketIO_Starter/Extensions/QueueExtension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // QueueExtenstion.swift 3 | // Curveball 4 | // 5 | // Created by Simform Solutions on 16/06/20. 6 | // Copyright © 2020 Simform Solutions Pvt. Ltd.. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /// DispatchLevel manages the execution of work items. Each work item submitted to a queue is processed on a pool of threads managed by the system 12 | public enum DispatchLevel { 13 | 14 | case main, userInteractive, userInitiated, utility, background 15 | var dispatchQueue: DispatchQueue { 16 | switch self { 17 | case .main: return DispatchQueue.main 18 | case .userInteractive: return DispatchQueue.global(qos: .userInteractive) 19 | case .userInitiated: return DispatchQueue.global(qos: .userInitiated) 20 | case .utility: return DispatchQueue.global(qos: .utility) 21 | case .background: return DispatchQueue.global(qos: .background) 22 | } 23 | } 24 | } 25 | 26 | extension DispatchQueue { 27 | 28 | /// Provide to call any process after some delay 29 | /// 30 | /// - Parameters: 31 | /// - seconds: after it will called 32 | /// - dispatchLevel: The quality of service class 33 | /// - closure: after call the exicution block 34 | public static func delay(bySeconds seconds: Double, dispatchLevel: DispatchLevel = .main, closure: @escaping () -> Void) { 35 | let dispatchTime = DispatchTime.now() + seconds 36 | dispatchLevel.dispatchQueue.asyncAfter(deadline: dispatchTime, execute: closure) 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /SocketIO_Starter/Extensions/String+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+Extension.swift 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension String { 12 | var jsonToData: Data? { 13 | 14 | if let jsonData = self.data(using: String.Encoding.utf8) { 15 | return jsonData 16 | } else { 17 | return nil 18 | } 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SocketIO_Starter/Extensions/UIApplication+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+Extension.swift 3 | // Curveball 4 | // 5 | // Created by Abhi Makadiya on 13/07/20. 6 | // Copyright © 2020 Simform Solutions Pvt. Ltd. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIApplication { 12 | class func topViewController(controller: UIViewController? = UIApplication.shared.keyWindow?.rootViewController) -> UIViewController? { 13 | if let navigationController = controller as? UINavigationController { 14 | return topViewController(controller: navigationController.visibleViewController) 15 | } 16 | if let tabController = controller as? UITabBarController { 17 | if let selected = tabController.selectedViewController { 18 | return topViewController(controller: selected) 19 | } 20 | } 21 | if let presented = controller?.presentedViewController { 22 | return topViewController(controller: presented) 23 | } 24 | return controller 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SocketIO_Starter/Extensions/UIViewController+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+Extension.swift 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /// Storyboards 12 | enum Storyboard: String { 13 | case main = "Main" 14 | } 15 | 16 | ///Instantiate View Controller 17 | extension UIViewController { 18 | 19 | class func instantiate(appStoryboard: Storyboard) -> T? { 20 | let storyboard = UIStoryboard(name: appStoryboard.rawValue, bundle: nil) 21 | let identifier = String(describing: self) 22 | return storyboard.instantiateViewController(withIdentifier: identifier) as? T 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /SocketIO_Starter/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UIApplicationSceneManifest 24 | 25 | UIApplicationSupportsMultipleScenes 26 | 27 | UISceneConfigurations 28 | 29 | UIWindowSceneSessionRoleApplication 30 | 31 | 32 | UISceneConfigurationName 33 | Default Configuration 34 | UISceneDelegateClassName 35 | $(PRODUCT_MODULE_NAME).SceneDelegate 36 | UISceneStoryboardFile 37 | Main 38 | 39 | 40 | 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIMainStoryboardFile 45 | Main 46 | UIRequiredDeviceCapabilities 47 | 48 | armv7 49 | 50 | UISupportedInterfaceOrientations 51 | 52 | UIInterfaceOrientationPortrait 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | UISupportedInterfaceOrientations~ipad 57 | 58 | UIInterfaceOrientationPortrait 59 | UIInterfaceOrientationPortraitUpsideDown 60 | UIInterfaceOrientationLandscapeLeft 61 | UIInterfaceOrientationLandscapeRight 62 | 63 | SocketNameSpace 64 | $(SocketNameSpace) 65 | SocketURL 66 | https://$(SocketURL) 67 | NSAppTransportSecurity 68 | 69 | NSAllowsArbitraryLoads 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /SocketIO_Starter/Modules/View/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | // MARK: - 14 | // MARK: - Variables 15 | var viewModel: ViewModel! 16 | 17 | // MARK: - 18 | // MARK: - View LifeCycle 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | setupUI() 22 | } 23 | 24 | // MARK: - 25 | // MARK: - Function Declaration 26 | func setupUI() { 27 | viewModel = ViewModel(del: self) 28 | } 29 | } 30 | 31 | // MARK: - 32 | // MARK: - API Response Delegates 33 | extension ViewController: APIResponseDelegate { 34 | func startFetchingData(apiName: String) { 35 | //You will get notify on start fetching Data 36 | } 37 | 38 | func endFetchingData(error: CustomError?, apiName: String) { 39 | //You will get notify on end fetching Data 40 | } 41 | 42 | func endFetchingDataNoAck(apiName: String) { 43 | //You will get notify on DataNoAcknowledgement 44 | //It help us to hide spinner after some time when response doesn't come. 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /SocketIO_Starter/Modules/ViewModel/ViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewModel.swift 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | protocol APIResponseDelegate: class { 12 | func startFetchingData(apiName: String) 13 | func endFetchingData(error: CustomError?, apiName: String) 14 | func endFetchingDataNoAck(apiName: String) 15 | } 16 | 17 | class ViewModel: NSObject { 18 | 19 | // MARK: - 20 | // MARK: - Variables 21 | weak var delegate: APIResponseDelegate? 22 | var homeModel: HomeModel = HomeModel() 23 | //Socket Listener 24 | var gameInfoListener: UUID? 25 | 26 | // MARK: - Initializer 27 | override init() { 28 | super.init() 29 | } 30 | 31 | init(del: APIResponseDelegate) { 32 | super.init() 33 | delegate = del 34 | self.setupUI() 35 | } 36 | 37 | deinit { 38 | removeSocketHandlers() 39 | NotificationCenter.default.removeObserver(self) 40 | } 41 | 42 | func setupUI() { 43 | socketHandlers() 44 | NotificationCenter.default.addObserver(self, selector: #selector(self.hitGameinfo), name: .socketConnectNotify, object: nil) 45 | } 46 | } 47 | 48 | // MARK: - 49 | // MARK: - API's 50 | extension ViewModel { 51 | 52 | func socketHandlers() { 53 | removeSocketHandlers() 54 | onGameInfo() 55 | } 56 | 57 | func removeSocketHandlers() { 58 | //For remove socket listeners 59 | if let gameInfoList = gameInfoListener { 60 | SocketIOManager.shared.socket?.off(id: gameInfoList) 61 | } 62 | } 63 | 64 | // MARK: - 65 | // MARK: - Socket Handler Functions 66 | func onGameInfo() { //set game-info observer 67 | 68 | gameInfoListener = SocketIOManager.shared.socket?.on(SocketEmits.gameInfo) { [weak self] data, ack in 69 | 70 | guard let dictResp = data[0] as? [String: Any] else { 71 | return 72 | } 73 | SocketIOManager.shared.bindModel(response: dictResp) { [weak self] (result: Swift.Result) in 74 | 75 | guard let uSelf = self else { 76 | return 77 | } 78 | 79 | switch result { 80 | case .success(let homeModel): 81 | uSelf.homeModel = homeModel 82 | uSelf.delegate?.endFetchingData(error: nil, apiName: SocketEmits.gameInfo) 83 | case .failure(let error): 84 | uSelf.delegate?.endFetchingData(error: error, apiName: SocketEmits.gameInfo) 85 | } 86 | 87 | } 88 | } 89 | } 90 | 91 | // MARK: - 92 | // MARK: - Socket Emit Functions 93 | @objc func hitGameinfo() { //Socket emit function 94 | guard SocketIOManager.shared.socket?.status == .connected else { 95 | return 96 | } 97 | 98 | let reqObj = ReqGameInfo() 99 | reqObj.region = TimeZone.current.identifier 100 | delegate?.startFetchingData(apiName: SocketEmits.gameInfo) 101 | SocketIOManager.shared.socket?.emitWithAck(SocketEmits.gameInfo, reqObj.toDictionary()).timingOut(after: 20) { [weak self] data in 102 | guard let this = self else { 103 | return 104 | } 105 | this.delegate?.endFetchingDataNoAck(apiName: SocketEmits.gameInfo) 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /SocketIO_Starter/Network Layer/APIError.swift: -------------------------------------------------------------------------------- 1 | // 2 | // APIError.swift 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | struct APIError { 12 | 13 | // MARK: Alerts 14 | static let defaultAlertTitle = "warning" 15 | static let errorAlertTitle = "error" 16 | static let genericErrorMessage = "Something went wrong, please try again." 17 | static let unprocessableEntity = "Unprocessable Entity" 18 | static let notFound = "Not Found" 19 | static let parameterMissing = "Missing Param" 20 | static let unAuthorizeUser = "Authorisation Error" 21 | static let noInternet = "No Internet Connection" 22 | static let noData = "No data" 23 | static let multipleLogin = "Multiple device authentication found" 24 | } 25 | -------------------------------------------------------------------------------- /SocketIO_Starter/Network Layer/Environment.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Environment.swift 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// AppConstant 12 | public struct AppConstant { 13 | static let environment = Environment() 14 | static let socketURL = environment.configuration(PlistKey.socketURL) as? String ?? "" 15 | static let socketNameSpace = environment.configuration(PlistKey.SocketNameSpace) as? String ?? "" 16 | } 17 | 18 | /// PlistKey 19 | public enum PlistKey { 20 | case socketURL 21 | case SocketNameSpace 22 | 23 | func value() -> String { 24 | switch self { 25 | case .socketURL: 26 | return "SocketURL" 27 | case .SocketNameSpace: 28 | return "SocketNameSpace" 29 | } 30 | } 31 | 32 | } 33 | 34 | /// Environment 35 | public struct Environment { 36 | 37 | /// fetch data from info.plist 38 | fileprivate var infoDict: [String: Any] { 39 | get { 40 | if let dict = Bundle.main.infoDictionary { 41 | return dict 42 | } else { 43 | fatalError("Plist file not found") 44 | } 45 | } 46 | } 47 | 48 | /// Provide value from info.plist file 49 | /// 50 | /// - Parameter key: Needed key 51 | /// - Returns: Get value in define datatype(Any you type cast later) 52 | func configuration(_ key: PlistKey) -> Any { 53 | switch key { 54 | case .socketURL: 55 | return infoDict[PlistKey.socketURL.value()] as? String ?? "" 56 | case .SocketNameSpace: 57 | return infoDict[PlistKey.SocketNameSpace.value()] as? String ?? "" 58 | } 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /SocketIO_Starter/Network Layer/SocketManager/APIManager+Error.swift: -------------------------------------------------------------------------------- 1 | // 2 | // APIManager+Error.swift 3 | // Curveball 4 | // 5 | // Created by Simform Solutions on 16/06/20. 6 | // Copyright © 2020 Simform Solutions Pvt. Ltd.. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class CustomError: Error { 12 | 13 | // MARK: Vars & Lets 14 | var title = "" 15 | var body = "" 16 | 17 | // MARK: Intialization 18 | init(title: String, body: String) { 19 | self.title = title 20 | self.body = body 21 | } 22 | 23 | } 24 | 25 | class NetworkError: Codable { 26 | 27 | let message: String 28 | let code: Int? 29 | 30 | } 31 | -------------------------------------------------------------------------------- /SocketIO_Starter/Network Layer/SocketManager/SocketIO+Request.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Environment.swift 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | struct SocketEmits { 10 | static let gameInfo = "game-info" 11 | } 12 | -------------------------------------------------------------------------------- /SocketIO_Starter/Network Layer/SocketManager/SocketIOManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SocketIOManager.swift 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SocketIO 11 | import SVProgressHUD 12 | 13 | class SocketIOManager: NSObject { 14 | 15 | // MARK: - 16 | // MARK: - Variable Declaration 17 | static let shared = SocketIOManager() //shared Instance 18 | var manager: SocketManager? 19 | var socket: SocketIOClient? 20 | 21 | // MARK: - 22 | // MARK: - Initializer 23 | override init() { 24 | super.init() 25 | } 26 | 27 | // MARK: - 28 | // MARK: - Connection Handlers 29 | func establishConnection() { 30 | if socket == nil { 31 | createNewSocket() 32 | handler() 33 | } else { 34 | if socket?.status != .connected { 35 | SVProgressHUD.show() 36 | if let topVC = UIApplication.topViewController() { 37 | topVC.view.isUserInteractionEnabled = false 38 | } 39 | socket?.connect() 40 | } 41 | } 42 | } 43 | 44 | func createNewSocket() { 45 | manager = SocketManager(socketURL: URL(string: AppConstant.socketURL)!, config: [.log(false), .reconnects(true), .forcePolling(true)]) 46 | //If we want to add header in socket. 47 | renewSocketHeader() 48 | //Optional -> to add subDomain in socket connection url. 49 | socket = manager?.socket(forNamespace: AppConstant.socketNameSpace) 50 | SVProgressHUD.show() 51 | if let topVC = UIApplication.topViewController() { 52 | topVC.view.isUserInteractionEnabled = false 53 | } 54 | DispatchQueue.delay(bySeconds: 0.0) { 55 | NotificationCenter.default.post(name: .socketEstablished, object: nil) 56 | } 57 | socket?.connect() 58 | } 59 | 60 | func renewSocketHeader() { 61 | var dictHeader = [String: String]() 62 | dictHeader["Authorization"] = "Bearer <---Connection Token--->" 63 | manager?.config = SocketIOClientConfiguration(arrayLiteral: .compress, .extraHeaders(dictHeader)) 64 | } 65 | 66 | func handler() { 67 | socket?.on(clientEvent: .connect) {data, ack in 68 | print("socket connected") 69 | SVProgressHUD.dismiss() 70 | if let topVC = UIApplication.topViewController() { 71 | topVC.view.isUserInteractionEnabled = true 72 | } 73 | 74 | NotificationCenter.default.post(name: .socketConnectNotify, object: nil) 75 | } 76 | 77 | socket?.on(clientEvent: .disconnect) {data, ack in 78 | print("socket Disconnected") 79 | NotificationCenter.default.post(name: .socketDisconnectNotify, object: nil) 80 | } 81 | 82 | socket?.on(clientEvent: .error) {data, ack in 83 | print("socket Error") 84 | SVProgressHUD.show() 85 | if let topVC = UIApplication.topViewController() { 86 | topVC.view.isUserInteractionEnabled = false 87 | } 88 | NotificationCenter.default.post(name: .socketConnectionErrorNotify, object: nil) 89 | } 90 | 91 | socket?.on(clientEvent: .statusChange) {data, ack in 92 | print("socket Status Change") 93 | } 94 | 95 | socket?.on(clientEvent: .reconnect) { [weak self] data, ack in 96 | guard let this = self else { 97 | return 98 | } 99 | print("Socket reconnect") 100 | this.closeConnection() 101 | this.establishConnection() 102 | } 103 | 104 | socket?.on(clientEvent: .reconnectAttempt) {data, ack in 105 | print("Socket reconnect Attemp") 106 | } 107 | 108 | } 109 | 110 | func closeConnection() { 111 | socket?.disconnect() 112 | } 113 | 114 | func eraseSocketData() { 115 | socket?.disconnect() 116 | socket = nil 117 | manager = nil 118 | } 119 | 120 | func bindModel(response: [String: Any], handler: @escaping (Swift.Result) -> Void) where T: Codable { 121 | 122 | if self.handleResponseCode(res: response) { 123 | do { 124 | 125 | guard let dictData = response["data"] as? [String: Any] else { 126 | throw CustomError(title: APIError.defaultAlertTitle, body: APIError.noData) 127 | } 128 | 129 | guard dictData.json.count > 0 else { 130 | throw CustomError(title: APIError.defaultAlertTitle, body: APIError.noData) 131 | } 132 | guard let jsonData = dictData.json.jsonToData else { 133 | throw CustomError(title: APIError.defaultAlertTitle, body: APIError.noData) 134 | } 135 | 136 | let result = try JSONDecoder().decode(T.self, from: jsonData) 137 | handler(.success(result)) 138 | 139 | } catch { 140 | print(error) 141 | if let error = error as? CustomError { 142 | return handler(.failure(error)) 143 | } 144 | } 145 | } else { 146 | handler(.failure(CustomError(title: APIError.errorAlertTitle, body: response["message"] as? String ?? ""))) 147 | } 148 | } 149 | 150 | func handleResponseCode(res: [String: Any]) -> Bool { 151 | var isSuccess: Bool = false 152 | guard let statusCode = res["status"] as? Int else {return isSuccess} 153 | 154 | switch statusCode { 155 | case 200...300: 156 | isSuccess = true 157 | default: break 158 | } 159 | 160 | return isSuccess 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /SocketIO_Starter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Release.xcconfig 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | // Configuration settings file format documentation can be found at: 10 | // https://help.apple.com/xcode/#/dev745c5c974 11 | 12 | SocketURL = your_socket_url 13 | SocketNameSpace = /your_socket_subDomain 14 | -------------------------------------------------------------------------------- /SocketIO_Starter/Requests/ReqGameInfo.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ReqGameInfo.swift 3 | // Curveball 4 | // 5 | // Created by Abhi Makadiya on 07/07/20. 6 | // Copyright © 2020 Simform Solutions Pvt. Ltd. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ReqGameInfo: NSObject, NSCoding { 12 | 13 | var region: String? 14 | 15 | override init() { 16 | super.init() 17 | } 18 | 19 | func toDictionary() -> [String: Any] { 20 | var dictnary = [String: Any]() 21 | if region != nil { 22 | dictnary["region"] = region 23 | } 24 | 25 | return dictnary 26 | } 27 | 28 | @objc required init(coder aDecoder: NSCoder) { 29 | region = aDecoder.decodeObject(forKey: "region") as? String 30 | } 31 | 32 | func encode(with aCoder: NSCoder) { 33 | if region != nil { 34 | aCoder.encode(region, forKey: "region") 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /SocketIO_Starter/Response/HomeModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseClass.swift 3 | // 4 | // Created by Abhi Makadiya on 21/08/20. 5 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | 10 | struct HomeModel: Codable { 11 | 12 | enum CodingKeys: String, CodingKey { 13 | case game 14 | } 15 | 16 | var game: Game? 17 | 18 | init() { 19 | } 20 | 21 | init(from decoder: Decoder) throws { 22 | let container = try decoder.container(keyedBy: CodingKeys.self) 23 | game = try container.decodeIfPresent(Game.self, forKey: .game) 24 | } 25 | 26 | } 27 | 28 | // MARK: - 29 | // MARK: - Game Object 30 | struct Game: Codable { 31 | 32 | enum CodingKeys: String, CodingKey { 33 | case preview 34 | case streamUrl = "stream_url" 35 | case channel 36 | case title 37 | case date 38 | } 39 | 40 | var preview: String? 41 | var streamUrl: String? 42 | var channel: Int? 43 | var title: String? 44 | var date: String? 45 | 46 | init(from decoder: Decoder) throws { 47 | let container = try decoder.container(keyedBy: CodingKeys.self) 48 | preview = try container.decodeIfPresent(String.self, forKey: .preview) 49 | streamUrl = try container.decodeIfPresent(String.self, forKey: .streamUrl) 50 | channel = try container.decodeIfPresent(Int.self, forKey: .channel) 51 | title = try container.decodeIfPresent(String.self, forKey: .title) 52 | date = try container.decodeIfPresent(String.self, forKey: .date) 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /SocketIO_Starter/SceneDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneDelegate.swift 3 | // SocketIO_Starter 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class SceneDelegate: UIResponder, UIWindowSceneDelegate { 12 | 13 | var window: UIWindow? 14 | 15 | 16 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { 17 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. 18 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. 19 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). 20 | guard let windowScene = (scene as? UIWindowScene) else { return } 21 | let window = UIWindow(windowScene: windowScene) 22 | self.window = window 23 | appDelegate?.setupInitialNavigation(self.window) 24 | self.window?.makeKeyAndVisible() 25 | } 26 | 27 | func sceneDidDisconnect(_ scene: UIScene) { 28 | // Called as the scene is being released by the system. 29 | // This occurs shortly after the scene enters the background, or when its session is discarded. 30 | // Release any resources associated with this scene that can be re-created the next time the scene connects. 31 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). 32 | } 33 | 34 | func sceneDidBecomeActive(_ scene: UIScene) { 35 | // Called when the scene has moved from an inactive state to an active state. 36 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. 37 | SocketIOManager.shared.establishConnection() 38 | } 39 | 40 | func sceneWillResignActive(_ scene: UIScene) { 41 | // Called when the scene will move from an active state to an inactive state. 42 | // This may occur due to temporary interruptions (ex. an incoming phone call). 43 | } 44 | 45 | func sceneWillEnterForeground(_ scene: UIScene) { 46 | // Called as the scene transitions from the background to the foreground. 47 | // Use this method to undo the changes made on entering the background. 48 | } 49 | 50 | func sceneDidEnterBackground(_ scene: UIScene) { 51 | // Called as the scene transitions from the foreground to the background. 52 | // Use this method to save data, release shared resources, and store enough scene-specific state information 53 | // to restore the scene back to its current state. 54 | SocketIOManager.shared.closeConnection() 55 | } 56 | 57 | 58 | } 59 | 60 | -------------------------------------------------------------------------------- /SocketIO_StarterTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SocketIO_StarterTests/SocketIO_StarterTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SocketIO_StarterTests.swift 3 | // SocketIO_StarterTests 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import SocketIO_Starter 11 | 12 | class SocketIO_StarterTests: XCTestCase { 13 | 14 | override func setUpWithError() throws { 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDownWithError() throws { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | } 21 | 22 | func testExample() throws { 23 | // This is an example of a functional test case. 24 | // Use XCTAssert and related functions to verify your tests produce the correct results. 25 | } 26 | 27 | func testPerformanceExample() throws { 28 | // This is an example of a performance test case. 29 | self.measure { 30 | // Put the code you want to measure the time of here. 31 | } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /SocketIO_StarterUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /SocketIO_StarterUITests/SocketIO_StarterUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SocketIO_StarterUITests.swift 3 | // SocketIO_StarterUITests 4 | // 5 | // Created by Abhi Makadiya on 21/08/20. 6 | // Copyright © 2020 Abhi Makadiya. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class SocketIO_StarterUITests: XCTestCase { 12 | 13 | override func setUpWithError() throws { 14 | // Put setup code here. This method is called before the invocation of each test method in the class. 15 | 16 | // In UI tests it is usually best to stop immediately when a failure occurs. 17 | continueAfterFailure = false 18 | 19 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 20 | } 21 | 22 | override func tearDownWithError() throws { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | } 25 | 26 | func testExample() throws { 27 | // UI tests must launch the application that they test. 28 | let app = XCUIApplication() 29 | app.launch() 30 | 31 | // Use recording to get started writing UI tests. 32 | // Use XCTAssert and related functions to verify your tests produce the correct results. 33 | } 34 | 35 | func testLaunchPerformance() throws { 36 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) { 37 | // This measures how long it takes to launch your application. 38 | measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) { 39 | XCUIApplication().launch() 40 | } 41 | } 42 | } 43 | } 44 | --------------------------------------------------------------------------------