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 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
swift
import Foundation
import UIKit

class ImageProcessor {
    // Background processing with main thread updates
    func processImage(_ image: UIImage, completion: @escaping (UIImage?) -> Void) {

Grand Central Dispatch for concurrency

swift gcd concurrency
by Sofia Martinez 1 tab
swift
import SwiftUI

struct Triangle: Shape {
    func path(in rect: CGRect) -> Path {
        var path = Path()
        path.move(to: CGPoint(x: rect.midX, y: rect.minY))

SwiftUI custom shapes and paths

swift swiftui shapes
by Sofia Martinez 1 tab
swift
import SwiftUI

// MARK: - State and Binding
struct CounterView: View {
    @State private var count = 0

Property wrappers for SwiftUI state

swift swiftui property-wrappers
by Sofia Martinez 1 tab
ruby
# Fastlane Fastfile for automated deployment
default_platform(:ios)

platform :ios do
  desc "Push a new beta build to TestFlight"
  lane :beta do

App Store submission and TestFlight beta testing

ios app-store testflight
by Sofia Martinez 2 tabs
swift
import SwiftUI

struct ResponsiveGridView: View {
    let items: [GridItem]

    var body: some View {

SwiftUI GeometryReader for dynamic layouts

swift swiftui layout
by Sofia Martinez 1 tab
swift
import Combine
import Foundation

class SearchViewModel: ObservableObject {
    @Published var searchQuery = ""
    @Published var results: [SearchResult] = []

Combine operators for data transformation

swift combine reactive
by Sofia Martinez 1 tab
swift
import UIKit
import Combine

class PostsTableViewController: UITableViewController {
    enum Section {
        case main

UIKit UITableView with diffable data source

swift uikit uitableview
by Sofia Martinez 2 tabs