- Add blurhash and image scaling to MarkdownImage component - Implement useCalculateNaturalSize hook for responsive image sizing - Create atoms and types for entry model and media - Update HTML renderer to support dynamic image rendering with Jotai state management - Improve iOS image preview with save functionality and dynamic root view controller retrieval Signed-off-by: Innei <tukon479@gmail.com>
27 lines
570 B
Swift
27 lines
570 B
Swift
//
|
|
// Utils.swift
|
|
// FollowNative
|
|
//
|
|
// Created by Innei on 2025/2/7.
|
|
//
|
|
|
|
import Foundation
|
|
import UIKit
|
|
|
|
private class Noop {}
|
|
|
|
enum Utils {
|
|
static let bundle = Bundle(for: Noop.self)
|
|
static let accentColor =
|
|
UIColor(named: "Accent", in: bundle, compatibleWith: nil) ?? UIColor.systemBlue
|
|
|
|
static func getRootVC() -> UIViewController? {
|
|
if let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
|
|
let window = scene.windows.first,
|
|
let rootVC = window.rootViewController {
|
|
return rootVC
|
|
}
|
|
return nil
|
|
}
|
|
}
|