- Integrate Kingfisher for image caching with CachedAsyncImage component - Add CacheSettingsView for managing image cache size and clearing cache - Implement three card layout styles: compact, magazine (default), natural - Add AppearanceSettingsView with visual layout previews and theme settings - Create Clean Architecture for card layout with domain models and use cases - Implement FlowLayout for dynamic label width calculation - Add skeleton loading animation for initial bookmark loads - Replace delete confirmation dialogs with immediate delete + 3-second undo - Support multiple simultaneous undo operations with individual progress bars - Add grayed-out visual feedback for pending deletions - Centralize notification names in dedicated NotificationNames file - Remove pagination logic from label management (replaced with FlowLayout) - Update AsyncImage usage across BookmarkCardView, BookmarkDetailView, ImageViewerView - Improve UI consistency and spacing throughout the app
50 lines
1.6 KiB
Swift
50 lines
1.6 KiB
Swift
//
|
|
// ShareViewController.swift
|
|
// URLShare
|
|
//
|
|
// Created by Ilyas Hallak on 11.06.25.
|
|
//
|
|
|
|
import UIKit
|
|
import Social
|
|
import UniformTypeIdentifiers
|
|
import SwiftUI
|
|
|
|
class ShareViewController: UIViewController {
|
|
|
|
private var hostingController: UIHostingController<ShareBookmarkView>?
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
let viewModel = ShareBookmarkViewModel(extensionContext: extensionContext)
|
|
let swiftUIView = ShareBookmarkView(viewModel: viewModel)
|
|
let hostingController = UIHostingController(rootView: swiftUIView)
|
|
addChild(hostingController)
|
|
hostingController.view.translatesAutoresizingMaskIntoConstraints = false
|
|
view.addSubview(hostingController.view)
|
|
NSLayoutConstraint.activate([
|
|
hostingController.view.topAnchor.constraint(equalTo: view.topAnchor),
|
|
hostingController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor),
|
|
hostingController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor),
|
|
hostingController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor)
|
|
])
|
|
hostingController.didMove(toParent: self)
|
|
self.hostingController = hostingController
|
|
|
|
NotificationCenter.default.addObserver(
|
|
self,
|
|
selector: #selector(dismissKeyboard),
|
|
name: .dismissKeyboard,
|
|
object: nil
|
|
)
|
|
}
|
|
|
|
@objc private func dismissKeyboard() {
|
|
self.view.endEditing(true)
|
|
}
|
|
|
|
deinit {
|
|
NotificationCenter.default.removeObserver(self)
|
|
}
|
|
}
|