Skip to content

Commit f2b5009

Browse files
authored
Merge pull request #14 from zjc19891106/dev
fix conflict with ChatUIkit
2 parents 6665a6e + 9ce80a7 commit f2b5009

File tree

6 files changed

+38
-32
lines changed

6 files changed

+38
-32
lines changed

README.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -252,63 +252,64 @@ class AppDelegate:UIResponder,UIApplicationDelegate {
252252

253253
``` XML
254254
<?xml version="1.0" encoding="UTF-8"?>
255-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
256-
<device id="retina4_7" orientation="portrait" appearance="light"/>
255+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22181" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="vXZ-lx-hvc">
256+
<device id="retina6_1" orientation="portrait" appearance="light"/>
257257
<dependencies>
258258
<deployment identifier="iOS"/>
259-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
259+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22182"/>
260260
<capability name="System colors in document resources" minToolsVersion="11.0"/>
261261
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
262262
</dependencies>
263263
<scenes>
264264
<!--View Controller-->
265265
<scene sceneID="ufC-wZ-h7g">
266266
<objects>
267-
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="EaseCallUIKitQuickStart"customModuleProvider="target" sceneMemberID="viewController">
267+
<viewController id="vXZ-lx-hvc" customClass="ViewController" customModule="EaseCallUIKitQuickStart" customModuleProvider="target" sceneMemberID="viewController">
268268
<layoutGuides>
269269
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
270270
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
271271
</layoutGuides>
272272
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
273-
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
274-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
273+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
274+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
275275
<subviews>
276276
<textField opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="248" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="call user or group with id" textAlignment="center" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="laE-OW-CWK">
277-
<rect key="frame" x="75" y="191" width="225" height="40"/>
277+
<rect key="frame" x="94.5" y="171" width="225" height="40"/>
278278
<color key="backgroundColor" systemColor="systemGray5Color"/>
279279
<constraints>
280280
<constraint firstAttribute="height" constant="40" id="kOp-K7-HeC"/>
281+
<constraint firstAttribute="width" constant="225" id="width-laE-OW-CWK"/>
281282
</constraints>
282-
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
283+
<color key="textColor" systemColor="labelColor"/>
283284
<fontDescription key="fontDescription" type="system" pointSize="18"/>
284285
<textInputTraits key="textInputTraits"/>
285286
</textField>
286287
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zid-qi-Z7H">
287-
<rect key="frame" x="161.5" y="254" width="52.5" height="35"/>
288+
<rect key="frame" x="180.5" y="234" width="53" height="35"/>
288289
<constraints>
289290
<constraint firstAttribute="height" constant="35" id="Qdf-ZL-nrv"/>
291+
<constraint firstAttribute="width" constant="53" id="width-zid-qi-Z7H"/>
290292
</constraints>
291-
<state key="normal" title="Button"/>
292293
<buttonConfiguration key="configuration" style="filled" title="Call"/>
293294
<connections>
294295
<action selector="callAction:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="21A-e9-7bB"/>
295296
</connections>
296297
</button>
297298
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1TW-7c-QOv">
298-
<rect key="frame" x="154" y="316" width="66" height="35"/>
299+
<rect key="frame" x="174" y="284" width="66" height="35"/>
299300
<constraints>
300301
<constraint firstAttribute="height" constant="35" id="X5z-2c-9KQ"/>
302+
<constraint firstAttribute="width" constant="66" id="width-1TW-7c-QOv"/>
301303
</constraints>
302-
<state key="normal" title="Button"/>
303304
<buttonConfiguration key="configuration" style="filled" title="Login"/>
304305
<connections>
305306
<action selector="loginAction:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="D5E-pO-2Jw"/>
306307
</connections>
307308
</button>
308309
<segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="KgU-kb-zgq">
309-
<rect key="frame" x="89" y="129" width="197" height="32"/>
310+
<rect key="frame" x="108.5" y="109" width="197" height="32"/>
310311
<constraints>
311-
<constraint firstAttribute="height" constant="31" id="49T-gN-YNX"/>
312+
<constraint firstAttribute="height" constant="32" id="49T-gN-YNX"/>
312313
<constraint firstAttribute="width" constant="197" id="64h-61-hN9"/>
313314
</constraints>
314315
<segments>
@@ -321,19 +322,18 @@ class AppDelegate:UIResponder,UIApplicationDelegate {
321322
</connections>
322323
</segmentedControl>
323324
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0Qd-2k-2aV">
324-
<rect key="frame" x="161" y="370" width="53" height="35"/>
325+
<rect key="frame" x="180.5" y="334" width="53" height="35"/>
325326
<constraints>
326327
<constraint firstAttribute="height" constant="35" id="fuc-9c-KcU"/>
327328
<constraint firstAttribute="width" constant="53" id="u4m-wu-cwy"/>
328329
</constraints>
329-
<state key="normal" title="Button"/>
330330
<buttonConfiguration key="configuration" style="filled" title="Log"/>
331331
<connections>
332332
<action selector="logAction:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="QkB-ye-mNH"/>
333333
</connections>
334334
</button>
335335
</subviews>
336-
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
336+
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
337337
<constraints>
338338
<constraint firstItem="zid-qi-Z7H" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="3PV-gJ-xUs"/>
339339
<constraint firstItem="zid-qi-Z7H" firstAttribute="top" secondItem="laE-OW-CWK" secondAttribute="bottom" constant="23" id="3d9-xN-rVV"/>
@@ -343,7 +343,7 @@ class AppDelegate:UIResponder,UIApplicationDelegate {
343343
<constraint firstItem="0Qd-2k-2aV" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="Ptx-cV-DpW"/>
344344
<constraint firstItem="laE-OW-CWK" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="ZDm-c5-ZIK"/>
345345
<constraint firstItem="1TW-7c-QOv" firstAttribute="centerY" secondItem="kh9-bI-dsS" secondAttribute="centerY" id="a05-e3-vQV"/>
346-
<constraint firstItem="0Qd-2k-2aV" firstAttribute="top" secondItem="1TW-7c-QOv" secondAttribute="bottom" constant="19" id="r8t-en-w10"/>
346+
<constraint firstItem="0Qd-2k-2aV" firstAttribute="top" secondItem="1TW-7c-QOv" secondAttribute="bottom" constant="15" id="r8t-en-w10"/>
347347
<constraint firstItem="laE-OW-CWK" firstAttribute="top" secondItem="jyV-Pf-zRb" secondAttribute="bottom" constant="171" id="vBn-aQ-3Q3"/>
348348
</constraints>
349349
</view>
@@ -361,12 +361,18 @@ class AppDelegate:UIResponder,UIApplicationDelegate {
361361
</scene>
362362
</scenes>
363363
<resources>
364+
<systemColor name="systemBackgroundColor">
365+
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
366+
</systemColor>
364367
<systemColor name="systemBlueColor">
365368
<color red="0.0" green="0.47843137254901963" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
366369
</systemColor>
367370
<systemColor name="systemGray5Color">
368371
<color red="0.89803921568627454" green="0.89803921568627454" blue="0.91764705882352937" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
369372
</systemColor>
373+
<systemColor name="labelColor">
374+
<color white="0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
375+
</systemColor>
370376
</resources>
371377
</document>
372378

Sources/EaseCallUIKit/Classes/Commons/Extension/ArrayExtension.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ public extension Array {
2828
}
2929

3030
///数组越界防护
31-
subscript(safe idx: Index) -> Element? {
31+
subscript(safely idx: Index) -> Element? {
3232
if idx < 0 { return nil }
3333
return idx < self.endIndex ? self[idx] : nil
3434
}
3535

36-
subscript(safe range: Range<Int>) -> ArraySlice<Element>? {
36+
subscript(safely range: Range<Int>) -> ArraySlice<Element>? {
3737
if range.startIndex < 0 { return nil }
3838
return range.endIndex <= self.endIndex ? self[range.startIndex...range.endIndex]:nil
3939
}

Sources/EaseCallUIKit/Classes/Commons/Theme/ColorTheme.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,22 +140,22 @@ public extension UIColor {
140140
@objcMembers class ColorTheme: NSObject {
141141

142142
internal static func switchHues(hues: [CGFloat]) {
143-
if let primaryHue = hues[safe: 0] {
143+
if let primaryHue = hues[safely: 0] {
144144
self.primaryHue = primaryHue
145145
}
146-
if let secondaryHue = hues[safe: 1] {
146+
if let secondaryHue = hues[safely: 1] {
147147
self.secondaryHue = secondaryHue
148148
}
149-
if let errorHue = hues[safe: 2] {
149+
if let errorHue = hues[safely: 2] {
150150
self.errorHue = errorHue
151151
}
152-
if let neutralHue = hues[safe: 3] {
152+
if let neutralHue = hues[safely: 3] {
153153
self.neutralHue = neutralHue
154154
}
155-
if let neutralSpecialHue = hues[safe: 4] {
155+
if let neutralSpecialHue = hues[safely: 4] {
156156
self.neutralSpecialHue = neutralSpecialHue
157157
}
158-
if let gradientEndHue = hues[safe: 5] {
158+
if let gradientEndHue = hues[safely: 5] {
159159
self.gradientEndHue = gradientEndHue
160160
}
161161
}

Sources/EaseCallUIKit/Classes/Commons/Utils/CallNavigationBar.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ extension CallNavigationBar: UICollectionViewDataSource,UICollectionViewDelegate
300300
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
301301
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "EaseChatNavigationBarRightCell", for: indexPath) as? EaseChatNavigationBarRightCell
302302
if self.originalRenderRightImage {
303-
cell?.imageView.image = self.rightImages[safe: indexPath.row]
303+
cell?.imageView.image = self.rightImages[safely: indexPath.row]
304304
} else {
305-
cell?.imageView.image = self.rightImages[safe: indexPath.row]?.withTintColor(Theme.style == .dark ? UIColor.callTheme.neutralColor98:UIColor.callTheme.neutralColor3)
305+
cell?.imageView.image = self.rightImages[safely: indexPath.row]?.withTintColor(Theme.style == .dark ? UIColor.callTheme.neutralColor98:UIColor.callTheme.neutralColor3)
306306
}
307307
return cell ?? UICollectionViewCell()
308308
}

Sources/EaseCallUIKit/Classes/CoreService/Implements/CallKitManager+RTC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ extension CallKitManager: AgoraRtcEngineDelegate {
125125
consoleLogInfo("rtcEngine networkQuality uid: \(uid) txQuality: \(txQuality.rawValue) rxQuality: \(rxQuality.rawValue) is unknown, skipping update", type: .debug)
126126
return
127127
}
128-
let uids = [NSNumber(value: uid)]
128+
let uids = [NSNumber(value: uid == 0 ? UInt32(uid):self.currentUserRTCUID)]
129129
// Get userId by RTC uid
130130
ChatClient.shared().getUserId(byRTCUIds: uids) { [weak self] relations, error in
131131
guard let `self` = self else { return }

Sources/EaseCallUIKit/Classes/UI/Controllers/MultiCallParticipantsController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ extension MultiCallParticipantsController: UITableViewDelegate,UITableViewDataSo
187187
if cell == nil {
188188
cell = GroupParticipantsCell(style: .default, reuseIdentifier: "GroupParticipantsCell")
189189
}
190-
if let profile = self.participants[safe: indexPath.row] {
190+
if let profile = self.participants[safely: indexPath.row] {
191191
cell?.refresh(profile: profile, keyword: "")
192192
cell?.nickName.textColor = .white
193193
}
@@ -201,7 +201,7 @@ extension MultiCallParticipantsController: UITableViewDelegate,UITableViewDataSo
201201
}
202202

203203
@objc open func didSelectRowAt(indexPath: IndexPath) {
204-
if let profile = self.participants[safe: indexPath.row] {
204+
if let profile = self.participants[safely: indexPath.row] {
205205
profile.selected = !profile.selected
206206
self.participantsList.reloadData()
207207
}
@@ -225,7 +225,7 @@ extension MultiCallParticipantsController: UITableViewDelegate,UITableViewDataSo
225225
self.fetchParticipants()
226226
}
227227
var unknownInfoIds = [String]()
228-
if let profile = self.participants[safe: indexPath.row] {
228+
if let profile = self.participants[safely: indexPath.row] {
229229
if profile.nickname.isEmpty || profile.avatarURL.isEmpty {
230230
unknownInfoIds.append(profile.id)
231231
}

0 commit comments

Comments
 (0)