Skip to content

Instantly share code, notes, and snippets.

View bigmountainstudio's full-sized avatar
📕
Get your FREE SwiftUI Picture Book!

Big Mountain Studio bigmountainstudio

📕
Get your FREE SwiftUI Picture Book!
View GitHub Profile
@bigmountainstudio
bigmountainstudio / AggregateExamples.swift
Last active March 12, 2024 21:24
SwiftData Aggregate Functions
// Copyright © 2024 Big Mountain Studio. All rights reserved. Twitter: @BigMtnStudio
import SwiftData
import SwiftUI
@Model
class EmployeeModel {
var employeeId: UUID
var birthDate: Date
var firstName: String
var lastName: String
@bigmountainstudio
bigmountainstudio / ArtistView.swift
Created January 16, 2024 04:53
Cool transitions between List and Grid using SwiftData and MatchedGeometryEffect.
// Copyright © 2024 Big Mountain Studio. All rights reserved. Twitter: @BigMtnStudio
// Website for awesome SwiftUI picture books 😃: bigmountainstudio.com
import SwiftData
import SwiftUI
import UIKit
// Refer to SwiftData Mastery book for more info.
@Model
class ArtistModel {
@bigmountainstudio
bigmountainstudio / BigMountainStudio (Light).xccolortheme
Created March 10, 2021 19:27
Xcode Theme: BigMountainStudio (Light)
<!-- Add this file to: ~/Library/Developer/Xcode/UserData/FontAndColorThemes -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0 0 0 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SFMono-Bold - 9.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
@bigmountainstudio
bigmountainstudio / GruvBox.xccolortheme
Last active March 29, 2024 18:54
Xcode Theme: GruvBox
<!-- Add this file to: ~/Library/Developer/Xcode/UserData/FontAndColorThemes -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.901961 0.831373 0.639216 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SFMono-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
@bigmountainstudio
bigmountainstudio / Animation.md
Last active November 28, 2023 18:05 — forked from JeOam/Animation.md
iOS Core Animation: Advanced Techniques, Part 1: The Layer Beneath

1. The Layer Tree

Core Animation's original name is Layer Kit

Core Animation is a compositing engine; its job is to compose different pieces of visual content on the screen, and to do so as fast as possible. The content in question is divided into individual layers stored in a hierarchy known as the layer tree. This tree forms the underpinning for all of UIKit, and for everything that you see on the screen in an iOS application.

In UIView, tasks such as rendering, layout and animation are all managed by a Core Animation class called CALayer. The only major feature of UIView that isn’t handled by CALayer is user interaction.

There are four hierarchies, each performing a different role:

  • view hierarchy
  • layer tree
@bigmountainstudio
bigmountainstudio / MockData.swift
Created December 24, 2018 16:08
This is the new MockData file used in the Itinerary app. Full series here: https://www.youtube.com/playlist?list=PLHDMmeIMXj8UV9xqF7Mr2Puh8xehDCy-O
import Foundation
class MockData {
static func createMockTripModelData() -> [TripModel] {
var mockTrips = [TripModel]()
mockTrips.append(TripModel(title: "Trip to Bali!", image: #imageLiteral(resourceName: "bali"), dayModels: createmockDayModelData()))
mockTrips.append(TripModel(title: "Mexico", image: #imageLiteral(resourceName: "mexico")))
mockTrips.append(TripModel(title: "Russian Trip"))
return mockTrips
}