swift
import StoreKit

class StoreKitManager: NSObject, ObservableObject {
    static let shared = StoreKitManager()

    @Published var products: [SKProduct] = []

StoreKit for in-app purchases

swift storekit iap
by Sofia Martinez 1 tab
swift
import Foundation
import UIKit

// MARK: - Memory Leak Prevention
class ImageDownloader {
    private var tasks: [URL: URLSessionDataTask] = [:]

Instruments and performance profiling

ios performance profiling
by Sofia Martinez 1 tab
swift
import CloudKit
import Combine

class CloudKitManager: ObservableObject {
    static let shared = CloudKitManager()

CloudKit for iCloud sync

swift cloudkit icloud
by Sofia Martinez 1 tab
swift
import WidgetKit
import SwiftUI

struct SimpleEntry: TimelineEntry {
    let date: Date
    let count: Int

iOS app extensions - widgets and share

swift ios extensions
by Sofia Martinez 2 tabs
swift
import UIKit

// MARK: - Custom Delegate Protocol
protocol PostCellDelegate: AnyObject {
    func postCell(_ cell: PostTableViewCell, didTapLike post: Post)
    func postCell(_ cell: PostTableViewCell, didTapComment post: Post)

UIKit delegates and protocols

swift uikit delegates
by Sofia Martinez 1 tab
swift
import SwiftUI

struct PostsView: View {
    @StateObject private var viewModel = PostsViewModel()

    var body: some View {

SwiftUI task modifiers and async lifecycle

swift swiftui async-await
by Sofia Martinez 1 tab
swift
import UIKit

class ProfileViewController: UIViewController {
    private let profileImageView: UIImageView = {
        let imageView = UIImageView()
        imageView.contentMode = .scaleAspectFill

UIKit Auto Layout programmatically

swift uikit auto-layout
by Sofia Martinez 1 tab
swift
import Foundation

// MARK: - Basic Codable
struct User: Codable {
    let id: Int
    let username: String

JSON encoding and decoding with Codable

swift codable json
by Sofia Martinez 1 tab
swift
import SwiftUI
import MapKit
import CoreLocation

struct Location: Identifiable {
    let id = UUID()

MapKit integration for location features

swift mapkit location
by Sofia Martinez 1 tab
swift
import SwiftUI

// MARK: - Size Preference
struct SizePreferenceKey: PreferenceKey {
    static var defaultValue: CGSize = .zero

SwiftUI PreferenceKey for child-to-parent communication

swift swiftui preferencekey
by Sofia Martinez 1 tab
swift
import SwiftUI
import AVFoundation
import AVKit

struct VideoPlayerView: View {
    let videoURL: URL

AVFoundation for media playback

swift avfoundation media
by Sofia Martinez 1 tab
swift
import Foundation

enum UserDefaultsKey: String {
    case username
    case isFirstLaunch
    case lastSyncDate

UserDefaults and app preferences

swift userdefaults persistence
by Sofia Martinez 1 tab