Worth a read for some more context.
Create the file in the root of the project (where your Package.swift file lives as well), and use the following contents:
/// Package.xcconfigWorth a read for some more context.
Create the file in the root of the project (where your Package.swift file lives as well), and use the following contents:
/// Package.xcconfig| // | |
| // UIViewWrapper.swift | |
| // lingq-5 | |
| // | |
| // Created by Timothy Costa on 2019/06/14. | |
| // Copyright © 2019 timothycosta.com. All rights reserved. | |
| // | |
| import SwiftUI | |
| import UIKit |
| // | |
| // ContentView.swift | |
| // DeleteMe | |
| // | |
| // Created by Chris Eidhof on 02.02.21. | |
| // | |
| import SwiftUI | |
| /* |
| import SwiftUI | |
| class KeyboardAvoidingHostingController<Content>: UIHostingController<Content> where Content: View { | |
| override func viewDidAppear(_ animated: Bool) { | |
| super.viewDidAppear(animated) | |
| NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillChangeFrame), name: UIResponder.keyboardWillChangeFrameNotification, object: nil) | |
| } | |
| override func viewDidDisappear(_ animated: Bool) { | |
| super.viewDidDisappear(animated) |
| #!/bin/bash | |
| # Parameters | |
| source="$(pwd)/$1" # Track folder source where diffs are checked | |
| index=$2 # Track diff remote | |
| project_root=${0%/*} # Track project root folder | |
| swiftlint_path='Pods/SwiftLint/swiftlint' # Track SwiftLint path | |
| # Parameter check | |
| if [[ $# < 1 ]]; then |
| import UIKit | |
| import SafariServices | |
| import AuthenticationServices | |
| import AppAuth | |
| import Reachability | |
| class OIDExternalUserAgentASWebAuthenticationSession: NSObject, OIDExternalUserAgent { | |
| private let presentingViewController: UIViewController | |
| private var externalUserAgentFlowInProgress: Bool = false | |
| private var authenticationViewController: ASWebAuthenticationSession? |
| import SwiftUI | |
| private let linkDetector = try! NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue) | |
| struct LinkColoredText: View { | |
| enum Component { | |
| case text(String) | |
| case link(String, URL) | |
| } | |
| @propertyWrapper | |
| public final class LayoutInvalidating<Value> where Value: Equatable { | |
| public static subscript<EnclosingSelf>( | |
| _enclosingInstance observed: EnclosingSelf, | |
| wrapped wrappedKeyPath: ReferenceWritableKeyPath<EnclosingSelf, Value>, | |
| storage storageKeyPath: ReferenceWritableKeyPath<EnclosingSelf, LayoutInvalidating> | |
| ) -> Value where EnclosingSelf: UIView { | |
| get { | |
| return observed[keyPath: storageKeyPath].stored |
swiftc main.swift -emit-module-path main.swiftmodule -emit-executable -enable-private-imports -Xfrontend -enable-implicit-dynamic./main -> prints From original bar()swiftc -emit-library inject.swift -o inject.dylib -I . -Xlinker -undefined -Xlinker suppress -Xlinker -flat_namespace -Xfrontend -disable-access-controlDYLD_INSERT_LIBRARIES=inject.dylib ./main -> prints From replacement bar()-Xfrontend -enable-implicit-dynamic removes you from having to add dynamic to everything you want to be replacable