-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b6a498
commit 05042c8
Showing
103 changed files
with
2,371 additions
and
2,132 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
iOS/Example/App/Assets.xcassets/goLive.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "goLive.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
iOS/Example/App/Assets.xcassets/leave_icon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "leave_icon.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
iOS/Example/App/Assets.xcassets/liveList_normal.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "liveList_normal.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+2.01 KB
iOS/Example/App/Assets.xcassets/liveList_normal.imageset/liveList_normal.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
iOS/Example/App/Assets.xcassets/liveList_selected.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "liveList_selected.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+9.16 KB
iOS/Example/App/Assets.xcassets/liveList_selected.imageset/liveList_selected.pdf
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
iOS/Example/App/Assets.xcassets/me_normal.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "me.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
iOS/Example/App/Assets.xcassets/me_selected.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "me_selected.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file not shown.
12 changes: 12 additions & 0 deletions
12
iOS/Example/App/Assets.xcassets/top_background.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "top_background.pdf", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.13 MB
iOS/Example/App/Assets.xcassets/top_background.imageset/top_background.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// | ||
// AlignmentButton.swift | ||
// TUILiveKitApp | ||
// | ||
// Created by krabyu on 2024/6/19. | ||
// | ||
|
||
import UIKit | ||
|
||
class AlignmentButton: UIButton { | ||
enum ImageAlignment: NSInteger { | ||
case left = 0 | ||
case top | ||
case bottom | ||
case right | ||
} | ||
var imageAlignment: ImageAlignment = .left | ||
var spaceBetweenTitleAndImage: CGFloat = 0 | ||
|
||
override func layoutSubviews() { | ||
super.layoutSubviews() | ||
|
||
let space: CGFloat = self.spaceBetweenTitleAndImage | ||
|
||
let titleWidth: CGFloat = self.titleLabel?.bounds.width ?? 0 | ||
let titleHeight: CGFloat = self.titleLabel?.bounds.height ?? 0 | ||
|
||
let imageWidth: CGFloat = self.imageView?.bounds.width ?? 0 | ||
let imageHeight: CGFloat = self.imageView?.bounds.height ?? 0 | ||
|
||
let buttonCenterX: CGFloat = self.bounds.width / 2 | ||
let imageCenterX: CGFloat = buttonCenterX - titleWidth / 2 | ||
let titleCenterX = buttonCenterX + imageWidth / 2 | ||
|
||
switch self.imageAlignment { | ||
case .top: | ||
self.titleEdgeInsets = UIEdgeInsets(top: imageHeight / 2 + space / 2, | ||
left: -(titleCenterX - buttonCenterX), | ||
bottom: -(imageHeight/2 + space/2), | ||
right: titleCenterX-buttonCenterX) | ||
self.imageEdgeInsets = UIEdgeInsets(top: -(titleHeight / 2 + space / 2), | ||
left: buttonCenterX - imageCenterX, | ||
bottom: titleHeight / 2 + space / 2, | ||
right: -(buttonCenterX - imageCenterX)) | ||
case .left: | ||
self.titleEdgeInsets = UIEdgeInsets(top: 0, left: space / 2, bottom: 0, right: -space / 2) | ||
self.imageEdgeInsets = UIEdgeInsets(top: 0, left: -space / 2, bottom: 0, right: space) | ||
case .bottom: | ||
self.titleEdgeInsets = UIEdgeInsets(top: -(imageHeight / 2 + space / 2), | ||
left: -(titleCenterX - buttonCenterX), | ||
bottom: imageHeight / 2 + space / 2, | ||
right: titleCenterX - buttonCenterX) | ||
self.imageEdgeInsets = UIEdgeInsets(top: titleHeight / 2 + space / 2, | ||
left: buttonCenterX - imageCenterX, | ||
bottom: -(titleHeight / 2 + space / 2), | ||
right: -(buttonCenterX - imageCenterX)) | ||
case .right: | ||
self.titleEdgeInsets = UIEdgeInsets(top: 0, left: -(imageWidth + space / 2), | ||
bottom: 0, right: imageWidth + space / 2) | ||
self.imageEdgeInsets = UIEdgeInsets(top: 0, left: titleWidth + space / 2, | ||
bottom: 0, right: -(titleWidth + space / 2)) | ||
} | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// IMManager.swift | ||
// TUILiveKitApp | ||
// | ||
// Created by krabyu on 2024/6/19. | ||
// | ||
|
||
import Foundation | ||
import ImSDK_Plus | ||
|
||
typealias onSuccess = () -> Void | ||
typealias onError = (Int,String) -> Void | ||
class IMManager { | ||
func getUserFollowInfo(userId: String, onSuccess: onSuccess? = nil, onError: onError? = nil) { | ||
V2TIMManager.sharedInstance().getUserFollowInfo([userId], succ: { followInfo in | ||
guard let followInfo = followInfo?.first else { return} | ||
SettingsConfig.share.fansCount = Int(followInfo.followersCount) | ||
SettingsConfig.share.followCount = Int(followInfo.followingCount) | ||
onSuccess?() | ||
}, fail: { code, message in | ||
debugPrint("getUserFollowInfo onError, code:\(code), message:\(String(describing: message))") | ||
onError?(Int(code), message ?? "") | ||
}) | ||
} | ||
|
||
func changeUserName(newName name: String, onSuccess: onSuccess? = nil, onError: onError? = nil) { | ||
let userFullInfo = V2TIMUserFullInfo() | ||
userFullInfo.nickName = name | ||
V2TIMManager.sharedInstance().setSelfInfo(userFullInfo, succ: { [weak self] in | ||
guard let self = self else { return } | ||
SettingsConfig.share.name = name | ||
onSuccess?() | ||
}, fail: { code, message in | ||
debugPrint("changeUserName onError, code:\(code), message:\(String(describing: message))") | ||
onError?(Int(code), message ?? "") | ||
}) | ||
} | ||
} |
Oops, something went wrong.