Skip to content

Instantly share code, notes, and snippets.

View seanlilmateus's full-sized avatar

Mateus seanlilmateus

View GitHub Profile
  • list packages adb shell pm list packages -f
  • delegate package adb shell am start -a android.intent.action.DELETE -d package:
@seanlilmateus
seanlilmateus / anim-part6.swift
Created October 15, 2023 09:45 — forked from swiftui-lab/anim-part6.swift
Examples for SwiftUI Blog Post (Advanced SwiftUI Animations - Part 6)
// Author: SwiftUI-Lab (swiftui-lab.com)
// Description: Advanced SwiftUI Animations - Part 6 Examples
// blog article: https://swiftui-lab.com/swiftui-animations-part6
import SwiftUI
struct ContentView: View {
@State var show: Int? = nil
var body: some View {
@seanlilmateus
seanlilmateus / SwiftUIDataUnitTest.swift
Created October 12, 2023 02:12 — forked from helje5/SwiftUIDataUnitTest.swift
Unit Testing a SwiftUI Query
//
// Created by Helge Heß.
// Copyright © 2023 ZeeZide GmbH.
//
import XCTest
import UIKit
import SwiftData
import SwiftUI
@seanlilmateus
seanlilmateus / RelativeSizeLayout.swift
Created March 25, 2023 06:59 — forked from ole/RelativeSizeLayout.swift
A SwiftUI layout and modifier for working with relative sizes ("50 % of your container"). https://oleb.net/2023/swiftui-relative-size/
import SwiftUI
extension View {
/// Proposes a percentage of its received proposed size to `self`.
///
/// This modifier multiplies the proposed size it receives from its parent
/// with the given factors for width and height.
///
/// If the parent proposes `nil` or `.infinity` to us in any dimension,
/// we’ll forward these values to our child view unchanged.
@seanlilmateus
seanlilmateus / AdvancedToolbarWindow.swift
Created March 18, 2023 07:08 — forked from stephancasas/AdvancedToolbarWindow.swift
A SwiftUI-compatible window for macOS with advanced toolbar configurability.
//
// AdvancedToolbarWindow.swift
//
// Created by Stephan Casas on 3/17/23.
//
import SwiftUI;
import AppKit;
class AdvancedToolbarWindow<MainContent: View, TitleToolbarContent: View>: NSWindow, NSToolbarDelegate {
//
// ContentView.swift
// AppleMusicLyricsPlayer
//
// Created by Magesh Sridhar on 2/5/23.
//
import SwiftUI
import AVKit
@seanlilmateus
seanlilmateus / PhotosStylePicker-Final.swift
Created December 29, 2022 00:08 — forked from HarshilShah/PhotosStylePicker-Final.swift
A SwiftUI picker that tries to match the Years/Months/Days/All Photos palette in the Library tab of Photos for iOS
import SwiftUI
protocol TitleProvider {
var title: String { get }
}
extension ColorScheme {
var dual: ColorScheme {
switch self {
case .light: return .dark
@seanlilmateus
seanlilmateus / NSPersistentContainer+extension.swift
Created December 18, 2022 13:08 — forked from atomicbird/NSPersistentContainer+extension.swift
Back up and restore Core Data persistent stores
//
// NSPersistentContainer+extension.swift
// CDMoveDemo
//
// Created by Tom Harrington on 5/12/20.
// Copyright © 2020 Atomic Bird LLC. All rights reserved.
//
import Foundation
import CoreData
@seanlilmateus
seanlilmateus / URLProtocolMock.swift
Created November 2, 2022 22:07 — forked from soujohnreis/URLProtocolMock.swift
Mock URLSession using URLProtocol
class URLProtocolMock: URLProtocol {
/// Dictionary maps URLs to tuples of error, data, and response
static var mockURLs = [URL?: (error: Error?, data: Data?, response: HTTPURLResponse?)]()
override class func canInit(with request: URLRequest) -> Bool {
// Handle all types of requests
return true
}
override class func canonicalRequest(for request: URLRequest) -> URLRequest {
@seanlilmateus
seanlilmateus / 1.README.md
Created October 1, 2022 10:09 — forked from brettohland/1.README.md
ISBN example with FormatStyle, AttributedStringFormatStyle, ParseableFormatStyle conformance.

Supporting FormatStyle & ParseableFormatStyle To Your Custom Types

A full example of adding String and AttributedString output to our custom types, as well as adding the ability to parse String values into your custom type.

Read the blog post

See the Xcode Playground

ko-fi