Sofia Martinez

40 code snips · on codesnips 5 months

Senior iOS Developer specializing in SwiftUI, UIKit, and modern iOS architectures. Expert in building performant, accessible apps with clean code. 8+ years shipping production...

swift
import AuthenticationServices
import CryptoKit

class SignInWithAppleManager: NSObject, ObservableObject {
    @Published var isSignedIn = false
    @Published var userID: String?

Sign in with Apple authentication

swift sign-in-apple authentication
by Sofia Martinez 1 tab
swift
import SwiftUI

// MARK: - Semantic Colors in SwiftUI
struct AdaptiveColorsView: View {
    var body: some View {
        VStack(spacing: 20) {

Dark mode support and adaptive colors

swift dark-mode colors
by Sofia Martinez 1 tab
swift
import UIKit

class HapticFeedbackManager {
    static let shared = HapticFeedbackManager()

    private let impactLight = UIImpactFeedbackGenerator(style: .light)

Haptic feedback with UIFeedbackGenerator

swift haptics feedback
by Sofia Martinez 1 tab
swift
import UserNotifications
import CoreLocation

class LocalNotificationManager {
    static let shared = LocalNotificationManager()

Local notifications scheduling

swift notifications local
by Sofia Martinez 1 tab
swift
import UIKit
import WebKit

class WebViewController: UIViewController {
    private var webView: WKWebView!
    private var progressView: UIProgressView!

WKWebView for web content display

swift wkwebview webkit
by Sofia Martinez 1 tab
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