Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
name: Check NextJs build | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: ["main"] | |
# Runs on any open or reopened pull request | |
pull_request: | |
types: [opened, reopened] # you can change this according to https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#using-multiple-events |
struct ConcaveGlassView: ViewModifier { | |
func body(content: Content) -> some View { | |
if #available(iOS 15.0, *) { | |
content | |
.padding() | |
.frame(height: 50) | |
.background(.ultraThinMaterial) | |
.overlay( | |
RoundedRectangle(cornerRadius: 14) | |
.stroke(.linearGradient(colors:[.black,.white.opacity(0.75)], startPoint: .top, endPoint: .bottom), lineWidth: 2) |
struct ConcaveGlassViewWithOverlay: ViewModifier { | |
func body(content: Content) -> some View { | |
if #available(iOS 15.0, *) { | |
content | |
.padding() | |
.frame(height: 50) | |
.background(.ultraThinMaterial) | |
.overlay( | |
LinearGradient(colors: [.black.opacity(0.2), .clear], startPoint: .top, endPoint: .bottom)) | |
.cornerRadius(14) |
struct FlatGlassView : ViewModifier { | |
func body(content: Content) -> some View { | |
if #available(iOS 15.0, *) { | |
content | |
.padding() | |
.frame(height: 50) | |
.background(.ultraThinMaterial) | |
.cornerRadius(14) | |
} else { | |
// Fallback on earlier versions |
// This is the code for the Flappy Bird game running in a Unix terminal. | |
// Demo: https://twitter.com/daniel_duan/status/1327735679657250816?s=21 | |
// To run it, simply do "swift bird.swift" in a Unix command line. | |
#if canImport(Darwin) | |
import Darwin | |
#else | |
import Glibc | |
#endif | |
enum RawModeError: Error { |
/** | |
``` | |
// Encode a model with properties of type [String : Any] | |
var propertiesContainer = container.nestedContainer(keyedBy: DynamicKey.self, forKey: .properties) | |
if let properties = properties { | |
try propertiesContainer.encodeDynamicKeyValues(withDictionary: properties) | |
} | |
``` | |
*/ | |
struct DynamicKey: CodingKey { |
Author: Chris Lattner
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.