See also: UIApplicationDelegate
documentation
// AppDelegate.swift
@main
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(
_ application: UIApplication,
disabled_rules: | |
- trailing_comma | |
opt_in_rules: | |
- file_header | |
file_header: | |
forbidden_pattern: /./ | |
custom_rules: | |
state_private: | |
name: "Private SwiftUI State" | |
regex: "\\@State\\s*var" |
See also: UIApplicationDelegate
documentation
// AppDelegate.swift
@main
final class AppDelegate: NSObject, UIApplicationDelegate {
func application(
_ application: UIApplication,
// | |
// LayoutThatFits.swift | |
// WWDC22Experiments | |
// | |
// Created by Ryan Lintott on 2022-06-08. | |
// | |
import SwiftUI | |
struct LayoutThatFits: Layout { |
// | |
// Created by Volodymyr Andriienko on 18.05.2021. | |
// Copyright © 2021 VAndrJ. All rights reserved. | |
// | |
#if DEBUG | |
#if canImport(SwiftUI) | |
import SwiftUI | |
@available (iOS 13.0, *) |
// | |
// AppDelegate.swift | |
// StatusBarTest | |
// | |
// Created by hiroki on 2021/02/11. | |
// | |
import UIKit | |
import SwiftUI |
import Contacts | |
import Intents | |
protocol ContactStoring { | |
func enumerateContacts(with fetchRequest: CNContactFetchRequest, usingBlock block: @escaping (CNContact, UnsafeMutablePointer<ObjCBool>) -> Void) throws | |
} | |
extension CNContactStore: ContactStoring {} | |
class IntentPersonProvider { |
import Contacts | |
import Intents | |
class IntentHandler: INExtension, INStartCallIntentHandling { | |
/// CNContactsStore implementation to get a person from contacts. | |
/// | |
/// See https://gist.github.com/quintonpryce/d69499bf40bdef208bd35d00aba188db | |
lazy var personProvider = IntentPersonProvider() | |
@available(iOSApplicationExtension 13.0, *) |
# A Best in Class Checklist | |
A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10. | |
> To use this, create a Github Issue in your own repo, and simply copy and paste this text. | |
## iOS Core Technology | |
_Things any iOS app can benefit from_ | |
- [ ] iCloud Sync | |
- [ ] Focus Filter Support |
import Foundation | |
import class UIKit.UIImage | |
struct AttributedString: ExpressibleByStringInterpolation { | |
enum Attribute: Hashable { | |
enum ImportanceLevel: String, Equatable { | |
case very | |
case enough | |
} | |
case important(ImportanceLevel = .enough) |
import Foundation | |
// MARK: - typed predicate types | |
public protocol TypedPredicateProtocol: NSPredicate { associatedtype Root } | |
public final class CompoundPredicate<Root>: NSCompoundPredicate, TypedPredicateProtocol {} | |
public final class ComparisonPredicate<Root>: NSComparisonPredicate, TypedPredicateProtocol {} | |
// MARK: - compound operators |