import StoreKit
class StoreKitManager: NSObject, ObservableObject {
static let shared = StoreKitManager()
@Published var products: [SKProduct] = []
import Foundation
import UIKit
// MARK: - Memory Leak Prevention
class ImageDownloader {
private var tasks: [URL: URLSessionDataTask] = [:]
import CloudKit
import Combine
class CloudKitManager: ObservableObject {
static let shared = CloudKitManager()
import WidgetKit
import SwiftUI
struct SimpleEntry: TimelineEntry {
let date: Date
let count: Int
import UIKit
// MARK: - Custom Delegate Protocol
protocol PostCellDelegate: AnyObject {
func postCell(_ cell: PostTableViewCell, didTapLike post: Post)
func postCell(_ cell: PostTableViewCell, didTapComment post: Post)
import SwiftUI
struct PostsView: View {
@StateObject private var viewModel = PostsViewModel()
var body: some View {
import UIKit
class ProfileViewController: UIViewController {
private let profileImageView: UIImageView = {
let imageView = UIImageView()
imageView.contentMode = .scaleAspectFill
import Foundation
// MARK: - Basic Codable
struct User: Codable {
let id: Int
let username: String
import SwiftUI
import MapKit
import CoreLocation
struct Location: Identifiable {
let id = UUID()
import SwiftUI
// MARK: - Size Preference
struct SizePreferenceKey: PreferenceKey {
static var defaultValue: CGSize = .zero
import SwiftUI
import AVFoundation
import AVKit
struct VideoPlayerView: View {
let videoURL: URL
import Foundation
enum UserDefaultsKey: String {
case username
case isFirstLaunch
case lastSyncDate