Skip to content

Commit

Permalink
fix RTCBaseView bug
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsfliu committed Jul 4, 2024
1 parent 51905a4 commit 98da92f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 18 deletions.
4 changes: 2 additions & 2 deletions RTCCommon.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |spec|

spec.name = "RTCCommon"
spec.version = "1.0.1"
spec.version = "1.0.2"
spec.platform = :ios
spec.ios.deployment_target = '12.0'
spec.license = { :type => 'Proprietary',
Expand All @@ -15,7 +15,7 @@ Pod::Spec.new do |spec|
spec.summary = 'RTCCommon'
spec.swift_version = '5.0'

spec.source = { :git => 'https://github.com/Tencent-RTC/uikit-common.git', :tag => 'v1.0.1' }
spec.source = { :git => 'https://github.com/Tencent-RTC/uikit-common.git', :tag => 'v1.0.2' }
spec.source_files = 'Source/**/**/*.*', 'Source/Utils/**/*.*'

spec.dependency 'SnapKit'
Expand Down
16 changes: 7 additions & 9 deletions Source/BaseView/RTCBaseView.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// RTCBaseView.swift
// TUIKitCommon
// RTCCommon
//
// Created by aby on 2024/5/14.
//
Expand All @@ -22,27 +22,25 @@ func warning(_ string: String, fileName: String = #file, methodName: String = #f
}

open class RTCBaseView: UIView {
open var isViewReady = true

public override init(frame: CGRect) {
super.init(frame: frame)
constructViewHierarchy()
}

@available(*, unavailable, message: "Loading this view from a nib is unsupported")
public required init?(coder aDecoder: NSCoder) {
fatalError("Loading this view from a nib is unsupported")
}

override open func didMoveToWindow() {
private var isViewReady = false
open override func didMoveToWindow() {
super.didMoveToWindow()
guard !isViewReady else {
return
}
guard !isViewReady else { return }
constructViewHierarchy()
activateConstraints()
setupViewStyle()
bindInteraction()
isViewReady = false
setupViewStyle()
isViewReady = true
}

// This function must to be override.
Expand Down
2 changes: 1 addition & 1 deletion Source/Extension/CGFloat+scale375.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// CGFloat+scale375.swift
// TUIKitCommon
// RTCCommon
//
// Created by krabyu on 2023/10/16.
// Copyright © 2023 Tencent. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Source/Permission/PermissionManager.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PermissionManager.swift
// TUIKitCommon
// RTCCommon
//
// Created by WesleyLei on 2023/9/27.
// Copyright © 2023 Tencent. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion Source/Utils/LocalizedLanguage.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// LocalizedLanguage.swift
// TUIKitCommon
// RTCCommon
//
// Created by krabyu on 2024/4/16.
//
Expand Down
4 changes: 2 additions & 2 deletions Source/Utils/WindowUtils.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// WindowUtils.swift
// TUIKitCommon
// RTCCommon
//
// Created by krab on 2023/10/16.
//
Expand All @@ -18,7 +18,7 @@ public class WindowUtils {
}
return UIApplication.shared.windows.first
}

public static func getCurrentWindowViewController() -> UIViewController? {
var keyWindow: UIWindow?
for window in UIApplication.shared.windows {
Expand Down
2 changes: 1 addition & 1 deletion Source/View/AlertPanel.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// AlertPanel.swift
// TUIKitCommon
// RTCCommon
//
// Created by krabyu on 2023/11/14.
//
Expand Down
2 changes: 1 addition & 1 deletion Source/View/PopupPanelController.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PopUpPanel.swift
// TUIKitCommon
// RTCCommon
//
// Created by krabyu on 2023/10/12.
// Copyright © 2023 Tencent. All rights reserved.
Expand Down

0 comments on commit 98da92f

Please sign in to comment.