Some of the major topics covered in this section include:
This file contains 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
// | |
// Activity.swift | |
// | |
// Created by Zachary Waldowski on 8/21/16. | |
// Copyright © 2016 Zachary Waldowski. Licensed under MIT. | |
// | |
import os.activity | |
private final class LegacyActivityContext { |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<!-- iOS 10, macOS Sierra, and friends bring a new logging subsystem that's | |
supposed to scale from the kernel, up to frameworks, and up to apps. It defaults | |
to a more regimented, privacy-focused approach that large apps and complex | |
systems need. | |
It, along with Activity Tracing introduced in iOS 8 and macOS Yosemite and the | |
Console app in macOS Sierra, hope to help you graduate from caveman debugging to |
This file contains 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 UIKit | |
class DoneAccessoryView: UIInputView { | |
private let toolbar = UIToolbar() | |
init() { | |
super.init(frame: .zero, inputViewStyle: .default) | |
translatesAutoresizingMaskIntoConstraints = false | |
allowsSelfSizing = true |
This file contains 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 { | |
@Environment(\.locale) var locale | |
var body: some View { | |
VStack { | |
Image(systemName: "globe") | |
.imageScale(.large) | |
.foregroundStyle(.tint) | |
Text("Locale: \(locale.identifier)") | |
Text("Measurement: \(locale.measurementSystem.identifier)") |
This file contains 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 UIKit | |
import ObjectiveC.runtime | |
// MARK: - IOKit | |
@objc private protocol IOHIDEvent: NSObjectProtocol {} | |
private struct IOHIDDigitizerEventMask: OptionSet { | |
let rawValue: UInt32 | |
init(rawValue: UInt32) { self.rawValue = rawValue } |
This file contains 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 AVPlayerViewWrapper: UIViewControllerRepresentable { | |
var url: URL | |
var shouldStartPlayback: Bool | |
func makeUIViewController(context: Context) -> AVPlayerViewController { | |
let controller = AVPlayerViewController() | |
controller.player = AVPlayer(url: url) | |
return controller | |
} |
This file contains 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 SwiftData | |
import SwiftUI | |
@main | |
struct Much_TodoApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
} | |
.modelContainer(for: TodoItem.self) |
This file contains 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
// TODO docs | |
public typealias SubviewProxy = _VariadicView.Children | |
// TODO docs | |
public struct SubviewReader<Children, Content>: View where Children: View, Content: View { | |
var children: Children | |
var content: (SubviewProxy) -> Content | |
// TODO docs | |
public init(_ children: Children, @ViewBuilder content: @escaping (SubviewProxy) -> Content) { |
This file contains 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 UIKit | |
private class CardPresenter: UIPresentationController { | |
private let dimmingView = UIView() | |
private let roundingView = UIView() | |
// MARK: - | |
override init(presentedViewController: UIViewController, presenting presentingViewController: UIViewController?) { |
NewerOlder