Giter VIP home page Giter VIP logo

inject's Introduction

Hi there πŸ‘‹

I am Principal engineer and creator of apps and tools that are trusted by over 80,000 teamsβ€”including industry leaders Apple, Disney, and Airbnb.

I've just released a video course that you can join if you want to save lots of time creating apps for Apple platforms.

πŸš€ I'm available for consulting and speaking engagements. Feel free to reach out to me to discuss opportunities.

In the past, I led iOS development at The New York Times, worked on apps such as Headspace, The Browser Company, and created my own indie apps like Foldify.

Community Work

You can sponsor my work and get premium content on my blog.

My Expertise

I focus on creating maintainable architecture and improving developer experience and efficiency by:

  • πŸ€” Designing flexible architecture that is easy to maintain
  • βš™οΈ Creating automation for common code tasks and workflows
  • πŸ‘₯ Establishing best practices for architecture, testing, and workflows
  • πŸ“‹ As a consultant, I usually:
    • πŸ€” Perform code reviews for entire projects and provide clients with practical recommendations to improve their team efficiency and satisfaction (through better development experience and automation)
    • πŸ‘₯ Help establish best practices and provide architecture recommendations
    • πŸ› οΈ Design and implement flexible and pragmatic solutions for hard problems
  • πŸ§™ And much more...

Talking with Me

  • 🐦 My Twitter: @merowing_
  • πŸ’¬ Pronouns: He/Him

You can learn more about me and my past experience on my blog.

inject's People

Contributors

allanmaral avatar amonshiz avatar darioroa avatar dasdom avatar felginep avatar gcharita avatar guzhenhuagithub avatar imostfa avatar johnno1962 avatar krzysztofzablocki avatar lipka avatar maatheusgois avatar marcoeidinger avatar niorko avatar nunogoncalves avatar patrick-kladek avatar rnystrom avatar shengchl avatar spnkr avatar taruntyagi946 avatar vascoorey avatar vitaliideveloper avatar wojciech-kulik avatar zenangst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inject's Issues

Exception when saving or rebuilding storyboard.

When I'm changing something in a storyboard file and pressing save or rebuild, I get the following exception:

SnapKit.LayoutConstraint constant is not finite!

Any idea why this might happen? I don't get the exception when I'm using InjectIII without this repo.

Incompatible with builds for Intel?

Could not find module 'Inject' for target 'x86_64-apple-ios-simulator'; found: arm64-apple-ios-simulator

Could you make it compatible with builds for Intel?

Doesn't work on Mac Catalyst

I believe it's due to the logic dictated by:
#if canImport(AppKit)

As Catalyst can import AppKit but only for limited use, ie. NSToolbar.

NSView, etc are unavailable.

New version/tag

Could you please add a new tag to make the last changes available via SPM?

unable to use it in all files with @_exported import Inject

The Readme doesn't really explain how to setup Inject to watch all files in a project.

@_exported import Inject 

Where should this be used? it says on targets but I'm not sure if under .xcodeproj or where. Any help is appreciated, SwiftUI beginner here.

  • Also InjectionIII doesn't log to the console unless I run the Prepare project - Add patch option

Where should `@_exported import Inject` be placed?

You can either add import Inject in individual files in your project or use @_exported import Inject in your project target to have it automatically available in all its files.

Where should I add this line? Google didn't help me in this case.

(thank you for this great library!)

Not working in AppCode

I'm trying to get this to work in AppCode (it works fine in Xcode) but I keep seeing this, any one knows whats going on?

πŸ’‰ Compiling /Users/user/git/MyApp/MyApp.swift
πŸ’‰ Loading .dylib ...
πŸ’‰ ⚠️ dlopen() error: dlopen(/Users/user/Library/Developer/CoreSimulator/Devices/3B86055C-0B91-4BCB-894C-F9AE1495D42C/data/Containers/Data/Application/CCFD64A8-BC92-446E-BD13-7601EC4422AD/tmp/eval102.dylib, 0x0002): tried: '/Users/user/Library/Caches/JetBrains/AppCode2022.2/DerivedData/News-ebmudasepawfrxgusfsadmvllwph/Build/Products/debug-iphonesimulator/eval102.dylib' (no such file), '/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.2.simruntime/Contents/Resources/RuntimeRoot/Users/user/Library/Developer/CoreSimulator/Devices/3B86055C-0B91-4BCB-894C-F9AE1495D42C/data/Containers/Data/Application/CCFD64A8-BC92-446E-BD13-7601EC4422AD/tmp/eval102.dylib' (no such file), '/Users/user/Library/Developer/CoreSimulator/Devices/3B86055C-0B91-4BCB-894C-F9AE1495D42C/data/Containers/Data/Application/CCFD64A8-BC92-446E-BD13-7601EC4422AD/tmp/eval102.dylib' (mach-o file (/Users/user/Library/Developer/CoreSimulator/Devices/3B86055C-0B91-4BCB-894C-F9AE1495D42C/data/Containers/Data/Application/CCFD64A8-BC92-446E-BD13-7601EC4422AD/tmp/eval102.dylib), but incompatible platform (have 'iOS', need 'iOS-sim')), '/usr/lib/eval102.dylib' (no such file)

SwiftUI custom modifier

Hi,

Is there something special to do when working with custom modifiers? I've made one, but when using it, the hot reloading is no longer working

modifier:

extension View {
  func navigationBarColor(backgroundColor: UIColor = .clear, foregroundColor: UIColor = .white) -> some View {
    return self.modifier(NavigationBarModifier(backgroundColor: backgroundColor, foregroundColor: foregroundColor))
  }
}

usage:

  var body: some View {
    ZStack {
      // ..
    }
    .navigationBarColor(...)
    .enableInjection()
  }

error: "error: value of type 'some View' has no member 'navigationBarColor'"

Thanks for your help

'Inject.Inject' shadows module 'Inject' - Inject does not compile when used in framework

Starting with Xcode_14.3 it seems that it is not possible to use Inject in a framework as the following build error appears:

.../SourcePackages/checkouts/Inject/Sources/Inject/Inject.swift:15:13: warning: public enum 'Inject.Inject' shadows module 'Inject', which may cause failures when importing 'Inject' or its clients in some configurations; please rename either the enum 'Inject.Inject' or the module 'Inject', or see https://github.com/apple/swift/issues/56573 for workarounds

When built with Xcode_14.2 there is just a warning about the shadowing.

Sample project: https://github.com/cakl/MyUIFramework (succeeds with Xcode_14.2, fails with Xcode_14.3.1 or higher).

Similar issue: krzysztofzablocki/Difference#36

I know that there are workarounds (apple/swift#64669 (comment)) but they come with a "high price" as far as I understand them.

Thanks for any help

On device flags compilation failure

Works fine on simulator however when attempting to run on device I am getting this error during compilation:
-interposable and -bitcode_bundle (Xcode setting ENABLE_BITCODE=YES) cannot be used together

Older Swift Tool Version Support

Hello,

Currently, I'm using Xcode 12 with Swift Tool Version 5.4, but the Inject's Swift Package is built with Swift Tool Version Is 5.5. So I cannot add this project to my application. Is it possible to add support for older Xcode versions (< Xcode 13)?

Thanks in advance, have a nice and safe day.

❌🫡🏽 Show reloaded result instantly without tapping the simulator

First of all, thanks for open-sourcing this amazing repo. ❀️ A true time-saver!

I got it running but to be able to see the change I have to tap on the simulator. Would be neat to show the result instantly.

I'm guessing enabling the animation is meant for that.

Inject.animation = .interactiveSpring()

But I don't know where to place it. Xcode gives me an error no matter where I place it.

I'm using the @ObserveInjection var inject inside my ContentView.

My Xcode version is 13.4.1.

Ability to subclass Inject.ViewControllerHost

I have a case where my own view controller override properties like supportedInterfaceOrientations and preferredStatusBarStyle of UIViewController. (also my view controller implements a generic protocol)

So instead of adding Inject as SPM dependency, I added all the files in my project and made a subclass of Inject.ViewControllerHost like this:

protocol MyGenericProtocol: UIViewController {
    var isNavigationBarHidden: Bool { get }
}

class MyViewControllerHost<T: MyGenericProtocol>: Inject.ViewControllerHost<T>, MyGenericProtocol {
    // MARK: - Orientation
    
    override var supportedInterfaceOrientations: UIInterfaceOrientationMask { instance.supportedInterfaceOrientations }
    override var shouldAutorotate: Bool { instance.shouldAutorotate }
    
    // MARK: - Status bar
    
    override var preferredStatusBarStyle: UIStatusBarStyle { instance.preferredStatusBarStyle }
    
    // MARK: - MyGenericProtocol
    
    var isNavigationBarHidden: Bool { instance.isNavigationBarHidden }
}

Is there any consideration to make Inject.ViewControllerHost open for subclassing from other modules?

SwiftUI + UIKit project causes crashes

Hi, we have a UIKit project that we are currently working on migrating to SwiftUI. The default view is SwiftUI, and we use a UIHostingController to display it. I’ve added inject into the SwiftUI view, and editing already added elements works fine (like changing text). However, if I add a new element, it crashes the app with Thread 1: EXC_BAD_ACCESS (code=1, address=…). Is there any way I can fix this? I’ve tried using Inject.ViewControllerHost on the UIHostingController, and also using Inject.ViewControllerHost without having inject in the SwiftUI part, but neither helped.

Our project is open source, and I can give you a link to the branch with the SwiftUI stuff if needed. (I haven’t pushed adding Inject yet.) It’s a pretty complex project, and uses libraries written in Objective-C and Rust, so it might take a little while to setup.

iOS 12 Support

Is there any reason why iOS 12 isn't being supported? If no, it would be great to get iOS 12 support officially from the main repo.

If there are reasons, but no limitations, I can just fork the repo myself. Figured I would ask to get some more information before I do anything.

Inject on multi frameworks project

Hello I have an issue with the integration please. I have a multi frameworks iOS project. I installed injectorIII and I did all the configuration (other linker flags...)
But when I make a change in a view controller nothing change.
image
I have the same issue both for UIKit and swift ui views.
Any idea please?

InjectionIII connected but view doesn't reload

Hi, I have issue with hot-reload. In terminal I have next message
//
πŸ’‰ InjectionIII connected /Users/mac/Documents/Developer/Barter(swift)/Barter(swift).xcodeproj
πŸ’‰ Watching files under the directory /Users/mac/Documents/Developer/Barter(swift)
//
and after when I press "ctrl + s" I have next message
//
πŸ’‰ Compiling /Users/mac/Documents/Developer/Barter(swift)/Barter(swift)/Views/AuthViews/AuthView.swift
πŸ’‰ Loading .dylib ...
πŸ’‰ Interposed 3 function references.
πŸ’‰ Injected type #1 'Barter_swift_.AuthView'
πŸ’‰ Injected type #2 'Barter_swift_.AuthView_Previews'
//

but simulator doesn't reload

Setup with UITabBarController

Is this correctly setup for a UITabBarController in your view?

        let window = UIWindow(windowScene: windowScene)

        let dashboardViewController = Inject.ViewControllerHost(DashboardViewController())
        dashboardViewController.tabBarItem = UITabBarItem(tabBarSystemItem: .favorites, tag: 0)

        let historyViewController = Inject.ViewControllerHost(HistoryViewContrller())
        historyViewController.tabBarItem = UITabBarItem(tabBarSystemItem: .recents, tag: 1)

        let tabBarController = Inject.ViewControllerHost(UITabBarController())
        tabBarController.viewControllers = [
            dashboardViewController,
            historyViewController,
        ]

        window.rootViewController = tabBarController

For me it seems to break completely and just show a fully gray tabbar after a reload.

Please update "-Xlinker -interposable" instruction.

@krzysztofzablocki first of all BIG thanks for your library! One issue I faced during integration was a misunderstanding with adding '-Xlinker -interposable' in the config. I believe it would be helpful for everyone to avoid the mistake I made. Note that these flags should be separated and added independently.

-Xlinker
-interposable

Regards,
Max

Could not find module for target 'x86_64-apple-ios-simulator'

Hi all✌️
When I have SPM + Pods on mac m1 you get error: Could not find module for target 'x86_64-apple-ios-simulator'
Then I setted VALID_ARCHS = "arm64, x86_64" and got errors for Inject lib.

Maybe somebody had the same issue and knows how to fix.

Here Pods settings:

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
  installer.pods_project.targets.each do |target|
    puts target.name
    target.build_configurations.each do |config|
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
  end
end

TCA 1.7.3 crash (ComposableArchitecture/Store.swift:682: Fatal error: Unexpectedly found nil while unwrapping an Optional value)

I'm trying to use this package with TCA 1.7.3, however when a non-leaf view is changed the app crashes. I've created an example project for this: InjectTCATest.
In the linked project if I change the Text("AppFeature") in AppView to Text("AppFeature2") there's a crash:

πŸ’‰ InjectionIII connected /Users/kuglee/Downloads/InjectTCATest/InjectTCATest.xcodeproj
πŸ’‰ Watching files under the directory /Users/kuglee/Downloads/InjectTCATest
πŸ’‰ Compiling /Users/kuglee/Downloads/InjectTCATest/InjectTCATest/AppFeature.swift
πŸ’‰ Selecting Xcode /Applications/Xcode-beta.app/Contents/Developer
πŸ’‰ Loading .dylib ...
πŸ’‰ Interposed 15 function references.
πŸ’‰ Injected type #1 'InjectTCATest.AppFeature'
πŸ’‰ Injected type #2 'InjectTCATest.AppFeature.State'
πŸ’‰ Injected type #3 'InjectTCATest.AppFeature.Action'
πŸ’‰ Injected type #4 'InjectTCATest.AppFeature.Action.AllCasePaths'
πŸ’‰ Injected type #5 'InjectTCATest.AppView'
ComposableArchitecture/Store.swift:682: Fatal error: Unexpectedly found nil while unwrapping an Optional value
crash

If I change the Text("ChildFeature") in ChildView to Text("ChildFeature2") it works as expected.

Not updating in simulator

I have a simple SwiftUI project (2 files), everything is installed and set up, I see all the messages from InjectionIII in console. But changes that I make in views do not appear in simulator.

Injection is not working Xcode 14.0.1

Hi! Maybe I'm doing something wrong but I can make Injection work. I've start with a clean project, added Package Dependency through Xcode and thought that this will work, but it don't. After that I've decided to check GitHub for other projects using Inject (like this one) in case of I've missed somethings. I've cloned it but I still get nothing when modifying any code in the controller.

Maybe anyone can suggest where to look for the root of problem?

Xcode 14.0.1
Simulator iPhone 12 iOS 16
macOS 13.0.1

Upload to cocoapods

SPM doesn't always work well, could you please upload the package to Cocoapods please

Debug View Hierarchy stops working after compiling a new ViewController

Hey Krzysztof. Thanks for the awesome tool!

I would like to ask if you have any known issues with Debug View Hierarchy (DVH).
I can run the app and navigate to a screen that hosts my ViewController. If at first I debug the view hierarchy, it works ok.
Now I update some code and hit save. Once it gets injected, DVH stops working, as in I tap the button and nothing happens. Once I make another save in the file then Xcode opens the DVH window on a loading state until I get this:

image

I'm not thinking this will break my workflow a lot but got curious to know if this is known and if there's any explanation for it.

Thanks again for this awesome tool. You and obviously, @johnno1962 πŸ‘ŒπŸΌ πŸ™πŸΌ

It doesn't seem to update UIHostingController

I was trying to use Inject to update a SwiftUI View in a UIKit-based application, but it doesn't seem to work.

import UIKit
import SwiftUI
import Inject

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil
    ) -> Bool {
        window = UIWindow(frame: UIScreen.main.bounds)
        let viewController = UIViewController()
        viewController.view.backgroundColor = .white
        window?.rootViewController = UIHostingController(rootView: ContentView())
        window?.makeKeyAndVisible()

        #if DEBUG
        Bundle(path: "/Users/antran/Desktop/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle")?.load()
        #endif
        return true
    }

}

struct ContentView: View {
    var body: some View {
        Text("Hot Reloading")
            .enableInjection()
    }
}
Kapture.2022-04-14.at.09.19.39.mp4

Do you have any suggestion how to make this setup working?

SPM not working

It seems that integrating Inject via SPM doesn't currently work. I get a Resolve Package Graph error.

Device injection

I just realised that i was commenting on a closed issue so I deleted my comment and created this instead.

I am wondering about device injection. I realise that injection on the device is very experimental but it is also extremely cool and useful so I really want to get it working. For me what is happening is that it never connects, in fact nothing is outputtet to the console at all.

I did mange to get device injection to work using the HotReloading project, but I prefer this way for ease of use and because I'm having issues with hot refreshing collectionView cells with the HotReloading project which seems to work out of the box using this. It was my understanding that this project and the HotReloading project connects to the InjectionIII app the same way which is way I'm confused why device reloading works with HotReloading but not with Inject....

Trigger update when non source code file changes

Might be a weird question, but would it trigger a refresh in the sim when a non source code file in the project is changed?
My case is to quickly see changes to a json file reflected in the simulator..
This will of cause require the modified json to be injected when changed...

Using hosted instance of Inject.ViewControllerHost

Hi

in README the following example is given

// WRONG
let viewController = YourViewController()
rootViewController.pushViewController(Inject.ViewControllerHost(viewController), animated: true)

// CORRECT
let viewController = Inject.ViewControllerHost(YourViewController())
rootViewController.pushViewController(viewController, animated: true)

Existing UIKit projects might want pass the viewController around, e.g. for configuration and then presentation.

let viewController = Inject.ViewControllerHost(YourViewController())
configureAndPresentReusableViewController(vc: viewController)

func configureAndPresentReusableViewController(vc: YourViewController) {
  vc.defaultText = "Configured"
  self.present(vc, animated: true)
}

The code above will not compile due to Cannot convert value of type '_InjectableViewControllerHost<YourViewController>' to expected argument type 'YourViewController'

If I use instance property of class _InjectableViewControllerHost<Hosted: InjectViewControllerType>: InjectViewControllerType then I can prevent the compilation error.

let viewController = Inject.ViewControllerHost(YourViewController())
configureAndPresentReusableViewController(vc: viewController.instance) // fine :)

func configureAndPresentReusableViewController(vc: YourViewController) {
  vc.defaultText = "Configured"
  self.present(vc, animated: true)
}

But I noticed that this either leads to incorrect visualization or to a runtime error down the road.

Any recommendation?

Recommended way of using it with UIKit

I'm trying to integrate the existing UIKit project with Inject. I wrapped ViewController with Inject.ViewControllerHost(...) and presented. I noticed that when I update ViewController it does hot-reload but doesn't call viewDidLoad.

We set up constraints and controls in viewDidLoad. Therefore, views and constraints are not reloaded until I leave the screen and show it again.

What is the recommended way of using it? Preferably without modifying ViewController.

UISearchBar Doesn't Show with UINavigationController + Inject.ViewControllerHost

class ViewController: UIViewController, UISearchResultsUpdating {

    let searchController: UISearchController

    init() {
        self.searchController = UISearchController(searchResultsController: nil)

        super.init(nibName: nil, bundle: nil)

        searchController.searchResultsUpdater = self
        searchController.obscuresBackgroundDuringPresentation = false
        searchController.searchBar.placeholder = NSLocalizedString("Search", comment: "")
        searchController.searchBar.searchBarStyle = .minimal

        navigationItem.searchController = searchController
        navigationItem.title = "Hello"
        navigationItem.hidesSearchBarWhenScrolling = false

        self.definesPresentationContext = true
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    func updateSearchResults(for searchController: UISearchController) {

    }

}

// elsewhere

let injectVC = Inject.ViewControllerHost(ViewController())
let root = UINavigationController(rootViewController: injectVC)
window.rootViewController = root

self.window = window
window.makeKeyAndVisible()

Doing something like the following results in the search bar never showing with iOS 16 (I haven't tried iOS 15 yet). Removing the Inject.ViewControllerHost and just using ViewController directly works just fine, so I'm not sure if ViewControllerHost is messing with UIKit's ability to detect where to put the search bar or forwarding or something Β―_(ツ)_/Β―

Any idea for a workaround? For now I've just decided to not use Inject. Tried it with and without Injection app running

Sorry if you aren't working on iOS 16 support yet, disregard for now if so!

Could not find module for target 'x86_64-apple-ios-simulator'

Hello there, I would love to integrate Inject into my project but as I follow the steps to do so, when I try to run the project using a simulator I get this error. I'm using Xcode 14.3. Not exactly sure what am I missing but any help would be greatly appreciated.

Could not find module for target 'x86_64-apple-ios-simulator'

Excluded architectures in the project look like this:

Screenshot 2023-04-28 at 15 44 59

Sugar

Hello!
Maybe it would be even more handy if something like this existed?

#if SUPPORTS_INJECTION
import Inject
#endif
import UIKit

protocol Injectable { }

extension UIViewController: Injectable { }
extension Injectable where Self: UIViewController {

#if SUPPORTS_INJECTION
  var injected: Inject.ViewControllerHost<Self> { Inject.ViewControllerHost(self) }
#else
  var injected: Self { self }
#endif

}

extension UIView: Injectable { }
extension Injectable where Self: UIView {

#if SUPPORTS_INJECTION
  var injected: Inject.ViewHost<Self> { Inject.ViewHost(self) }
#else
  var injected: Self { self }
#endif

}

Is it possible to use with storyboards?

I've since switched to creating view controllers and UI programmatically, but I still have several VCs use storyboards. Is there any way to integrate Inject with views and VCs that are loaded this way?

thanks

Only add on root view (SwiftUI)

Would it be possible to only add the prerequisites (.enableInjection() & @ObserveInjection var inject) on our root view so it is automatically working for all subviews hierarchy?

Here it is working but I have to reinitiate the view (dismiss / reinit) it for my changes to display.

Amazing lib btw πŸ‘πŸ‘πŸ‘

How to use it with .xib or .storyboard?

I need to reload .xib or .storyboard to see an updated UI in my app. How can I use it in this way?
I see a message in the console

Problem reloading nib: *** -[__NSDictionaryM setObject:forKeyedSubscript:]: key cannot be nil

Add @available(watchOSApplicationExtension 6.0, *) to all Inject classes to allow using it in a library that targets WatchOS as well

(Obligatory intro - Inject is awesome, thank you!)

Hello, I develop an app that shares view code amon iOS and WatchOS extension targetys in a library. The library has set WatchOS 7.0 as a minimum target (see below), but adding Inject a dependency produces a lot of errors with SwiftUI APIs not available before WatchOS 6.

Could you please mark the classes (or a whole package - I don't know if it's possible) as WatcOS 6.0+ only?

Something like @available(watchOSApplicationExtension 6.0, *) should help.

Or is there a better way? I am confused as for why does Xcode try to build the package for all WatchOS versions if it's only going to be used in a library that targets 7.0+?

Thank you! Tomas

Screenshot 2022-04-13 at 11 26 58

Error Group
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Inject.swift:18:42: 'Animation' is only available in watchOS 6.0 or newer
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Inject.swift:45:30: 'AnyCancellable' is only available in watchOS 6.0 or newer
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Inject.swift:43:33: 'ObservableObject' is only available in watchOS 6.0 or newer
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Integrations/Hosts.swift:3:45: cannot find type 'UIViewController' in scope
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Integrations/Hosts.swift:4:35: cannot find type 'UIView' in scope
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Integrations/Hosts.swift:41:24: method does not override any method from its superclass
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Integrations/KitFrameworks.swift:5:11: cannot find type 'UIView' in scope
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Integrations/KitFrameworks.swift:6:11: cannot find type 'UIViewController' in scope
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Integrations/SwiftUI.swift:6:44: 'View' is only available in watchOS 6.0 or newer
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Integrations/SwiftUI.swift:14:74: 'View' is only available in watchOS 6.0 or newer
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Integrations/SwiftUI.swift:5:26: 'View' is only available in watchOS 6.0 or newer
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Integrations/SwiftUI.swift:6:31: 'some' return types are only available in watchOS 6.0.0 or newer
<redacted path>/SourcePackages/checkouts/Inject/Sources/Inject/Integrations/SwiftUI.swift:14:61: 'some' return types are only available in watchOS 6.0.0 or newer

i couldn't present ViewController

at first, Thank you for make this comfortable method

What I want is simple
I want to make an "ViewController" that becomes "inject"

i wrote below it

//no.1
       let viewController = Inject.ViewControllerHost(LoginViewController())
        self.navigationController?.pushViewController(viewController, animated: true)
//no.2
//        present(viewController, animated: true, completion: nil)

I'm sorry to ask you such an easy one

What should I do?

Inject View Controller which conforms to protocol

First Thanks for the great tool!!!

Here is my question:
I have a view controller which conforms to protocol "MyProtocol"
then I do let calendar = Inject.ViewControllerHost(CalendarViewController())
and try to pass this calendar to the SideMenu which expects VC of MyProtocol type
but calendar returns nil, when I do calendar as? MyProtocol

are there any workarounds of this ?

Xcode package integration not working

Hello, I trying to integrate you great solution
And it worked good via CocoaPods

But when I trying to integrate it via Xcode 14.3 package manager I get an error in console on same project

Error loading /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection:  dlopen(/Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection, 265): Library not loaded: @rpath/SwiftTrace.framework/SwiftTrace
  Referenced from: /Applications/InjectionIII.app/Contents/Resources/iOSInjection.bundle/iOSInjection
  Reason: Incompatible library version: iOSInjection requires version 1.0.0 or later, but SwiftTrace provides version 0.0.0

Please, can you explain how can I fix it?
Project is swift UIKit, and it work good with CocoaPod integration

As I clearly understand your project using https://github.com/johnno1962/InjectionIII, but it needs to force reload UIView and UIViewController when that lib calls Injected callback. And this your project doing it by wrapping to Host. Am I right?

And also, do you know this project of InjectionForXcode owner https://github.com/johnno1962/HotReloading ?
If it is doing the same as your project, of for what it is?

Support NavigationController

Hello everyone

Because ViewController host, it's a new instance, currently, the ViewController hosts do not support the navigation controller of the child.

And for example, we may have some configuration for our NavigationController and then set it to our host(...), and all of our Navigation configuration gonna be ignored because of the new Host instance.

Updating the trunk of Cocoapods

Hello,

i'm working on integrating this amazing project.
and it looks like the master repo of Cocoapods Spec is outdated
so as far as i see, latest commit is pointing to 1.2.2, which is way behind the current release 1.4.0

CocoaPods/Specs@9b02570

suggested actions:
1- can i open a commit to update it to latest version ? or it should be the repo owner ? @krzysztofzablocki
2- can we make a release containing latest changes on main ? so maybe it's 1.4.1

Thanks you so much !!

TCA support?

Can we use it with the latest version of TCA (1.6.0) and how? I saw there is a little mentioned in the readme about the fork of The Browser Company, but it is very hard to navigate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.