This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UDvars { | |
| var AppLaunch: Int = UserDefaults.standard.object(forKey: "AppLaunch") as? Int ?? 0 { | |
| didSet { | |
| UserDefaults.standard.set(AppLaunch, forKey: "AppLaunch") | |
| } | |
| } | |
| var Bool: Bool = UserDefaults.standard.object(forKey: "Bool") as? Bool ?? false { | |
| didSet { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // http://blog.human-friendly.com/drawing-images-from-pixel-data-in-swift | |
| // https://github.com/FlexMonkey/MetalReactionDiffusion/blob/1ea9aa4a841d20e0b247505fdf716cd5fe1a01fd/MetalReactionDiffusion/ViewController.swift | |
| public struct PixelData { | |
| var a:UInt8 = 255 | |
| var r:UInt8 | |
| var g:UInt8 | |
| var b:UInt8 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftUI | |
| import UIKit | |
| // 1. Custom UIKit View: Cat with Speech Bubble | |
| class CatWithSpeechBubbleView: UIView { | |
| var message: String = "UIKit ❤️ SwiftUI" { | |
| didSet { | |
| setNeedsDisplay() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import subprocess | |
| import shutil | |
| import sys | |
| import argparse # The standard library for parsing command-line arguments | |
| # --- Configuration --- | |
| # The template for the output subdirectory. It will now include the mode (color/grayscale). | |
| OUTPUT_SUBDIR_TEMPLATE = 'compressed_{dpi}dpi_{mode}' | |
| # --- End of Configuration --- |
OlderNewer