Skip to content

Instantly share code, notes, and snippets.

//
// ContentView.swift
//
//
// Created by Bernstein, Joel on 7/4/20.
//
import SwiftUI
struct ElementModel: Identifiable
@yujinqiu
yujinqiu / Settings.swift
Created February 22, 2021 10:51 — forked from jordansinger/Settings.swift
iOS 6 Settings built in SwiftUI
//
// Settings.swift
// Settings
//
// Created by Jordan Singer on 2/20/21.
//
import SwiftUI
struct Settings: View {
@yujinqiu
yujinqiu / CombineFetcherAndDecoder.swift
Created April 1, 2021 07:12 — forked from stinger/CombineFetcherAndDecoder.swift
Combine - fetching and decoding JSON data
import Foundation
import Combine
enum APIError: Error, LocalizedError {
case unknown, apiError(reason: String), parserError(reason: String)
var errorDescription: String? {
switch self {
case .unknown:
return "Unknown error"
@yujinqiu
yujinqiu / CombineMockClient.swift
Last active April 2, 2021 04:15 — forked from stinger/CombineMockClient.swift
Mock data loader using Combine
import Foundation
import Combine
enum APIError: Error, LocalizedError {
case unknownError
case unknownURL
case unknownData
case parserError(reason: String)
case apiError(reason: String)
@yujinqiu
yujinqiu / gist:f266ab137b6f3ee6f7a1e7a253fbb014
Created January 22, 2022 03:16 — forked from andrewgrant/gist:477c7037b1fc0dd7275109d3f2254ea9
Example changes for automake to support x86 & arm64 plus universal binaries
# configure.ac
# add an --enable-macos-universal-binary flag that when building for mac
# create a universal x86_64 / arm64 binary
AC_ARG_ENABLE([macos-universal-binary],
[AS_HELP_STRING([--enable-macos-universal-binary],
[Create an universal x86_64+arm64 binary when building for macos)])],,
[enable_macos_universal_binary=no])
# Determine if we're building for macos/darwin by checking for macos & darwin
@yujinqiu
yujinqiu / WeatherView.swift
Created November 8, 2023 03:30 — forked from unixzii/WeatherView.swift
A demo of implementing iOS Weather card in SwiftUI.
import SwiftUI
struct HeaderView: View {
var body: some View {
HStack {
Image(systemName: "info.circle.fill")
.resizable()
.frame(width: 12, height: 12)
Text("Section Header")
.font(.system(size: 13))