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
public struct SkeletonableView<Content: View, Model: Collection>: View { | |
private var data: Model | |
private var placeholder: Model | |
@State private var timeoutRemaining: Int = 5 | |
private let content: (Model) -> Content | |
private let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect() | |
public init(data: Model, | |
placeholder: Model, |
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
/// An alternative to the print function which allows for better security and efficiency in release builds. | |
/// | |
/// Release configurations: do nothing. | |
/// Debug configurations: write the textual representations of the given items into the standard output. | |
/// | |
/// - Parameters: | |
/// - items: Zero or more items to print. | |
/// - separator: A string to print between each item. The default is a single | |
/// space (`" "`). | |
/// - terminator: The string to print after all items have been printed. The |
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://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/printf.c;h=4c8f3a2a0c38ab27a2eed4d2ff3b804980aa8f9f;hb=3321010338384ecdc6633a8b032bb0ed6aa9b19a | |
#include <libioP.h> | |
#include <stdarg.h> | |
#include <stdio.h> | |
#undef printf | |
/* Write formatted output to stdout from the format string FORMAT. */ | |
/* VARARGS1 */ |
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://sourceware.org/git/?p=glibc.git;a=blob;f=stdio-common/vfprintf.c;h=fc370e8cbc4e9652a2ed377b1c6f2324f15b1bf9;hb=3321010338384ecdc6633a8b032bb0ed6aa9b19a | |
#include <ctype.h> | |
#include <limits.h> | |
#include <printf.h> | |
#include <stdarg.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> |
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
\documentclass[11pt, oneside]{article} | |
\usepackage[margin=0.5in]{geometry} | |
\geometry{letterpaper} | |
\usepackage[parfill]{parskip} | |
\usepackage{graphicx} | |
\usepackage{amssymb} | |
\usepackage{xcolor} | |
\pagecolor{white} | |
\usepackage[colorlinks = true, linkcolor = blue, urlcolor = blue]{hyperref} | |
\pagestyle{empty} |
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
test |
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
struct ContentView: View { | |
@State private var showButton: Bool = false | |
var body: some View { | |
ZStack { | |
Color.green | |
if showButton { | |
Button("Skip Onboarding") { | |
// skip ahead |
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
@State private var videoCompleteTask: Task<Void, Error>? | |
@State private var showContinueButton: Bool = false | |
@State private var videoDurationRemaining: Double = 12 | |
var body: some View { | |
// ... | |
.onAppear { | |
resetVideoCompleteTask() | |
} | |
.onDisappear { |
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
actor AuthService { | |
func getAuthToken() async throws -> String { | |
if let localToken = getLocalToken(), | |
!localToken.isExpired { | |
return localToken | |
} | |
return try await refreshAuthToken() | |
} | |
} |
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
actor AuthService { | |
var tokenTask: Task<String, Error>? | |
func getAuthToken() async throws -> String { | |
if let localToken = getLocalToken(), | |
!localToken.isExpired { | |
return localToken | |
} | |
if tokenTask == nil { |
OlderNewer