Skip to content

Commit

Permalink
Merge pull request #699 from DimensionDev/ios/fixed_bugs_20250130
Browse files Browse the repository at this point in the history
Ios/fixed bugs 20250130
  • Loading branch information
110 authored Jan 31, 2025
2 parents 3ff0a43 + ed74fd7 commit 8ea1237
Show file tree
Hide file tree
Showing 35 changed files with 1,076 additions and 206 deletions.
4 changes: 2 additions & 2 deletions iosApp/Generated/Sources/Assets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public typealias AssetImageTypeAlias = ImageAsset.Image

// swiftlint:disable superfluous_disable_command file_length implicit_return

// MARK: - Asset Catalogs
// - Asset Catalogs

// swiftlint:disable identifier_name line_length nesting type_body_length type_name
public enum Asset {
Expand Down Expand Up @@ -402,7 +402,7 @@ public enum Asset {

// swiftlint:enable identifier_name line_length nesting type_body_length type_name

// MARK: - Implementation Details
// - Implementation Details

public final class ColorAsset {
public fileprivate(set) var name: String
Expand Down
76 changes: 52 additions & 24 deletions iosApp/iosApp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ open class JXPagingListContainerView: UIView {
}
}

// MARK: - JXSegmentedViewListContainer
// - JXSegmentedViewListContainer

public func contentScrollView() -> UIScrollView {
scrollView
Expand Down Expand Up @@ -302,7 +302,7 @@ open class JXPagingListContainerView: UIView {
listDidAppear(at: currentIndex)
}

// MARK: - Private
// - Private

func initListIfNeeded(at index: Int) {
guard let dataSource else { return }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ open class JXPagingSmoothView: UIView {
}
}

// MARK: - KVO
// - KVO

override open func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey: Any]?, context: UnsafeMutableRawPointer?) {
if keyPath == "contentOffset" {
Expand All @@ -216,7 +216,7 @@ open class JXPagingSmoothView: UIView {
}
}

// MARK: - Private
// - Private

func listHeader(for listScrollView: UIScrollView) -> UIView? {
for (index, list) in listDict {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ open class JXPagingView: UIView {
}
}

// MARK: - Private
// - Private

func refreshTableHeaderView() {
guard let delegate else { return }
Expand Down Expand Up @@ -301,7 +301,7 @@ open class JXPagingView: UIView {
}
}

// MARK: - UITableViewDataSource, UITableViewDelegate
// - UITableViewDataSource, UITableViewDelegate

extension JXPagingView: UITableViewDataSource, UITableViewDelegate {
open func tableView(_: UITableView, numberOfRowsInSection _: Int) -> Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ import UIKit
//
// }
//
//// MARK: - UIScrollViewDelegate
//// - UIScrollViewDelegate
// extension MediaPreviewImageView: UIScrollViewDelegate {
//
// func scrollViewShouldScrollToTop(_ scrollView: UIScrollView) -> Bool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ import WebKit
//
// }
//
//// MARK: - ShareActivityProvider
//// - ShareActivityProvider
// extension MediaPreviewImageViewController: ShareActivityProvider {
// var activities: [Any] {
// return []
Expand All @@ -162,7 +162,7 @@ import WebKit
// }
// }
//
//// MARK: - MediaPreviewTransitionViewController
//// - MediaPreviewTransitionViewController
// extension MediaPreviewImageViewController: MediaPreviewTransitionViewController {
// var mediaPreviewTransitionContext: MediaPreviewTransitionContext? {
// let transitionView = containerView
Expand All @@ -181,7 +181,7 @@ import WebKit
// }
// }
//
//// MARK: - WKNavigationDelegate
//// - WKNavigationDelegate
// extension MediaPreviewImageViewController: WKNavigationDelegate {
// func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
// webView.isOpaque = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ import Kingfisher
//
// }
//
//// MARK: - PageboyViewControllerDelegate
//// - PageboyViewControllerDelegate
// extension MediaPreviewViewController: PageboyViewControllerDelegate {
// func pageboyViewController(
// _ pageboyViewController: PageboyViewController,
Expand Down Expand Up @@ -241,7 +241,7 @@ import Kingfisher
//
// }
//
//// MARK: - MediaPreviewingViewController
//// - MediaPreviewingViewController
// extension MediaPreviewViewController: MediaPreviewingViewController {
//
// func isInteractiveDismissible() -> Bool {
Expand Down Expand Up @@ -273,7 +273,7 @@ import Kingfisher
//
// }
//
//// MARK: - MediaPreviewImageViewControllerDelegate
//// - MediaPreviewImageViewControllerDelegate
// extension MediaPreviewViewController: MediaPreviewImageViewControllerDelegate {
//
// func mediaPreviewImageViewController(_ viewController: MediaPreviewImageViewController, tapGestureRecognizerDidTrigger tapGestureRecognizer: UITapGestureRecognizer) {
Expand All @@ -295,7 +295,7 @@ import Kingfisher
//
// }
//
//// MARK: - ShareActivityProvider
//// - ShareActivityProvider
// extension MediaPreviewViewController: ShareActivityProvider {
// var activities: [Any] {
// if let provider = pageViewController.currentViewController as? ShareActivityProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ import Kingfisher
//
// }
//
//// MARK: - PageboyViewControllerDataSource
//// - PageboyViewControllerDataSource
// extension MediaPreviewViewModel: PageboyViewControllerDataSource {
//
// func numberOfViewControllers(in pageboyViewController: PageboyViewController) -> Int {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ extension MediaPreviewVideoViewController {
}
}

// MARK: - ShareActivityProvider
// - ShareActivityProvider

extension MediaPreviewVideoViewController: ShareActivityProvider {
var activities: [Any] {
Expand All @@ -163,7 +163,7 @@ extension MediaPreviewVideoViewController: ShareActivityProvider {
}
}

// MARK: - MediaPreviewTransitionViewController
// - MediaPreviewTransitionViewController

// extension MediaPreviewVideoViewController: MediaPreviewTransitionViewController {
// var mediaPreviewTransitionContext: MediaPreviewTransitionContext? {
Expand Down Expand Up @@ -202,6 +202,6 @@ extension MediaPreviewVideoViewController: ShareActivityProvider {
// }
// }

// MARK: - AVPlayerViewControllerDelegate
// - AVPlayerViewControllerDelegate

extension MediaPreviewVideoViewController: AVPlayerViewControllerDelegate {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public enum PlaybackState: Int {
case failed = 6
}

// MARK: - CustomStringConvertible
// - CustomStringConvertible

extension PlaybackState: CustomStringConvertible {
public var description: String {
Expand Down
6 changes: 3 additions & 3 deletions iosApp/iosApp/UI/Page/Compose/Components/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import WebKit

public struct WebView: WebViewRepresentable {
// MARK: - Initializers
// - Initializers

public init(
url: URL? = nil,
Expand All @@ -21,13 +21,13 @@
self.webView = webView
}

// MARK: - Properties
// - Properties

private let url: URL?
private let configuration: WKWebViewConfiguration?
private let webView: (WKWebView) -> Void

// MARK: - Functions
// - Functions

#if os(iOS)
public func makeUIView(context _: Context) -> WKWebView {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct CommonTimelineStatusComponent: View {
}
Spacer()
// icon + time
VStack(alignment: .trailing, spacing: 1) {
VStack(alignment: .trailing, spacing: 1) {
// 更多按钮
if !processActions().moreActions.isEmpty {
Menu {
Expand Down Expand Up @@ -338,7 +338,7 @@ struct CommonTimelineStatusComponent: View {
StatusActionLabel(item: item)
})
.frame(maxWidth: .infinity)
.padding(.horizontal, 12) // 添加水平内边距
.padding(.horizontal, 10) // 添加水平内边距
case let .group(group):
Menu {
ForEach(0 ..< group.actions.count, id: \.self) { subActionIndex in
Expand Down Expand Up @@ -382,14 +382,14 @@ struct CommonTimelineStatusComponent: View {
StatusActionLabel(item: group.displayItem)
}
.frame(maxWidth: .infinity)
.padding(.horizontal, 12) // 添加水平内边距
.padding(.horizontal, 10) // 添加水平内边距
}
}

// 使用新的 ShareButton
ShareButton(content: data.content.raw, view: self)
.frame(maxWidth: .infinity)
.padding(.horizontal, 0) // 添加水平内边距
.padding(.horizontal, 0) // 添加水平内边距
}
.labelStyle(CenteredLabelStyle())
.buttonStyle(.borderless)
Expand Down Expand Up @@ -556,7 +556,7 @@ struct CenteredLabelStyle: LabelStyle {
configuration.icon
configuration.title
.font(.system(size: 12))
Spacer() // 添加 Spacer 让内容靠左
// Spacer() // 添加 Spacer 让内容靠左
}
.frame(maxWidth: .infinity, alignment: .center)
}
Expand Down Expand Up @@ -591,15 +591,16 @@ struct ShareButton: View {
@Environment(\.colorScheme) var colorScheme
let content: String
let view: CommonTimelineStatusComponent

var body: some View {
Menu {
Button(action: {
// 系统分享
let activityVC = UIActivityViewController(activityItems: [content], applicationActivities: nil)
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first,
let rootVC = window.rootViewController {
let rootVC = window.rootViewController
{
activityVC.popoverPresentationController?.sourceView = window
rootVC.present(activityVC, animated: true)
}
Expand All @@ -610,11 +611,12 @@ struct ShareButton: View {
Image(systemName: "square.and.arrow.up")
}
}

Button(action: {
// 截图分享
if let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first {
let window = windowScene.windows.first
{
let renderer = ImageRenderer(content: view)
if let uiImage = renderer.uiImage {
let activityVC = UIActivityViewController(activityItems: [uiImage], applicationActivities: nil)
Expand All @@ -633,10 +635,10 @@ struct ShareButton: View {
}
} label: {
HStack {
Spacer()
Spacer()
Spacer()
Label {
Text("") // 空文本,保持与其他按钮一致的结构
Text("") // 空文本,保持与其他按钮一致的结构
} icon: {
Image(systemName: "square.and.arrow.up")
.imageScale(.medium)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TwitterText
import UIKit

public enum FlareMarkdownText {
// MARK: - Constants
// - Constants

public static let lensIDRegex: NSRegularExpression? = {
guard let regex = try? NSRegularExpression(
Expand All @@ -17,7 +17,7 @@ public enum FlareMarkdownText {
return regex
}()

// MARK: - Style Configuration
// - Style Configuration

public struct Style {
public let font: UIFont
Expand Down Expand Up @@ -71,7 +71,7 @@ public enum FlareMarkdownText {
}
}

// MARK: - Link Types
// - Link Types

public enum LinkType {
case url(URL)
Expand Down Expand Up @@ -198,7 +198,7 @@ public enum FlareMarkdownText {
return (AttributedString(nsAttrString), previewLink, luckyDropLink)
}

// MARK: - Private Methods
// - Private Methods

private static func parseEntities(from text: String) -> [Entity] {
var entities: [Entity] = []
Expand Down Expand Up @@ -280,7 +280,7 @@ public enum FlareMarkdownText {
}
}

// MARK: - Supporting Types
// - Supporting Types

extension FlareMarkdownText {
struct Entity {
Expand All @@ -289,7 +289,7 @@ extension FlareMarkdownText {
}
}

// MARK: - String Extensions
// - String Extensions

private extension String {
var isImageLink: Bool {
Expand Down
Loading

0 comments on commit 8ea1237

Please sign in to comment.