Note highlight a "Note" using blockquote (Beta)
or
Warning
func localAuthenticationInSimulator<T>( | |
evaluating policy: LAPolicy = .deviceOwnerAuthentication, | |
on context: LAContext = LAContext(), | |
beforeCalling function: @escaping () -> T? | |
) async -> T? { | |
#if targetEnvironment(simulator) | |
var localizedReason = context.localizedReason | |
if localizedReason.isEmpty { | |
localizedReason = "Test in simulator" | |
context.localizedReason = localizedReason |
for identifier in TimeZone.knownTimeZoneIdentifiers { | |
let tz = TimeZone(identifier: identifier)! | |
print("// \(tz.identifier) (\(tz.abbreviation() ?? ""))") | |
} | |
// Africa/Abidjan (GMT) | |
// Africa/Accra (GMT) | |
// Africa/Addis_Ababa (GMT+3) | |
// Africa/Algiers (GMT+1) | |
// Africa/Asmara (GMT+3) |
#!/bin/bash | |
# https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api | |
searchTerms=( | |
# File timestamp APIs | |
"creationDate" | |
"modificationDate" | |
"fileModificationDate" | |
"contentModificationDateKey" | |
"creationDateKey" |
import Foundation | |
import Security | |
// Function to generate RSA key pair | |
func generateRSAKeyPair() throws -> (privateKey: SecKey, publicKey: SecKey) { | |
let attributes: [String: Any] = [ | |
kSecAttrKeyType as String: kSecAttrKeyTypeRSA, | |
kSecAttrKeySizeInBits as String: 2048 | |
] | |
var error: Unmanaged<CFError>? |
#!/bin/sh | |
dir="$PWD" | |
# remove a potential suffix in case Xcode shows a Swift Package | |
suffix="/.swiftpm/xcode" | |
dir=${dir//$suffix/} | |
open -a iterm "$dir" |
import SwiftUI | |
/// Example of an reusable SwiftUII view available in the Xcode library | |
struct CalendarView: View { | |
var body: some View { | |
Text("A fake calendar view :)") | |
} | |
} | |
@available(iOS 14.0, *) |
#compdef swift | |
local context state state_descr line | |
_swift_commandname=$words[1] | |
typeset -A opt_args | |
_swift() { | |
integer ret=1 | |
local -a args | |
args+=( | |
'(-h --help)'{-h,--help}'[Show help information.]' |
// This file was generated from JSON Schema using quicktype, do not modify it directly. | |
// To parse the JSON, add this file to your project and do: | |
// | |
// let gitHubGraphQLResponse = try? newJSONDecoder().decode(GitHubGraphQLResponse.self, from: jsonData) | |
import Foundation | |
// MARK: - GitHubGraphQLResponse | |
struct GitHubGraphQLResponse: Codable { | |
var data: DataClass? |
import SwiftUI | |
struct CircularProfileImage: View { | |
let imageState: ProfileModel.ImageState | |
var body: some View { | |
ProfileImage(imageState: imageState) | |
.frame(width: 100, height: 100) | |
.clipShape(Circle()) | |
.background { |