Git Product home page Git Product logo

dip-ui's Introduction

Hi there 👋

I am an iOS Infrastructure & Platform Engineer (aka Mobile DevOps).
I provide developer with tools, scripts and automation to improve their Developer Experience

About my contributions

About my expertise

I create and provide tools to iOS developers to improve their productivity. This includes:

  • 🤖 Automating the release process to QA, TestFlight, AppStore…
  • 👥 Improving the PR review experience (using Danger and Vapor Bots to interact with your PRs, among others)
  • ⏱ Improving the iOS CIs pipelines and build times
  • ⚙️ Providing integration between tools for developers, QA & product (GitHub, JIRA, Lokalize, Figma, TestRails, CI, …)
  • 📋 Consulting on testing strategies (project testability, balance between Unit/UI/Snapshot/manual tests, interaction with QA…)
  • ✨ And much more 🙂

Talking with me


Learn more about me on the About page of my blog

dip-ui's People

Contributors

ilyapuchka avatar lightsprint09 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

Watchers

 avatar  avatar  avatar  avatar  avatar

dip-ui's Issues

How to resolve UIViewController with runtime arguments?

Hi,

I need to resolve a UIViewController with runtime arguments to do something like this following:

container.register(.unique) { (id: String, object: MyProtocol?) in try MyViewModel(repository: container.resolve(), id: id, object: object) as MyViewModelProtocol }

container.register(storyboardType: MyUIViewController.self, tag: "MyTag") .resolvingProperties { container, vc in vc.viewModel = try container.resolve(arguments: id, object) as MyViewModelProtocol }

Is it possible?

Thanks.

Is it possible to inject into NSWindowController instances?

Hi, I've been using Dip for a week or two with the UI extensions, and it's working great for my NSViewControllers, but I haven't been able to find a way to inject into NSWindowControllers so far.

It conforms to the StoryboardInstantiatable protocol, and there is a dipTag on the NSWindowController subclass but it's getting injected into. I also tried using the auto inject class to resolve the dependencies, and that was to no avail also.

I have a workaround in mind, by setting the isInitialController to false and creating the window in my app delegate in order to inject but it's not ideal.

I'm happy to concede that I have made a mistake somewhere, but I can't see it if I have.

Thanks in advance for any help you may be able to provide.

Connor

Edit: I can auto inject using the Injected class, it was a badly defined dependency, but would like to define the dependencies in the container initialisation.

Further edit: My above edit was incorrect, I still cannot get it to work.

P.S. I love how easy it was to implement, kudos on the framework, and I love the weakSingleton component scope, it makes sharing my view models really easy.

1.0.0 installation issue

Hello,

I've noticed that new version of DipUI was released - "1.0.0", unfortunately I was unable to install it through CocoaPods. Version 0.2.2 pops up as latest. Has anyone experienced it?

BTW Thanks for this nice library.

Resolve view controllers in code

Hi! I configured my view controller following a guide and I try to resolve an instance of view controller like this:

let viewController = try! container.resolve(tag: "myVC") as TestViewController

I get the instance of TestViewController, but it doesn’t have outlets and all the stuff that I set in the storyboard. Does DipUI work only when you create all view controllers with segues? Is there any way to resolve instances in code?

Setup travis integration

Travis lets setup only repos with administrative access, so I can not do that. I've added travis script, but you have to enable integration yourself, @AliSoftware

Make registering ViewControllers more save

Would it make sense to have an extension on DependencyContainer like the following:

extension DependencyContainer {
  public func registerViewController<T: StoryboardInstantiatable>(_ scope: ComponentScope = .shared, type: T.Type = T.self, tag: DependencyTagConvertible? = nil, factory: @escaping () throws -> T) -> Dip.Definition<T, ()> {
    return register(scope, type: type, tag: tag, factory: factory)
  }
}

This would help to not forget to conform to StoryboardInstantiatable .

Cocoapods Dip version dependency resolving problems

In my Podfile I set Dip version to 7.0 and Dip-UI version was automatically redused to 0.2.2 version.
When I set Dip-UI version to 2.0, I got an error during pod update

[!] CocoaPods could not find compatible versions for pod "Dip":
  In snapshot (Podfile.lock):
    Dip (= 7.0.0, >= 4.1.0, ~> 7.0)

  In Podfile:
    Dip (~> 7.0)

    Dip-UI (~> 2.0) was resolved to 2.0, which depends on
      Dip (~> 6.0)

Strange behavior with several uiContainers

Hi! In our project we wanted to use different uiContainers for different userStories, but we stuck in some sort of issue.

what happened:
at first we were using one uiContainer and it works like a charm 👍

but then, as we added second container, some stage things start to appear

WE've added second container like
DependencyContainer.uiContainers.append(storyBoardContainer)

btw, first uiContainer was added just like this too.

And then, when controllers from new user story must be initialized, console wrote smth like

No definition registered for type: HotelSearchVC, arguments: (), tag: nil.
Check the tag, type you try to resolve, number, order and types of runtime arguments passed to resolve() and match them with registered factories for type HotelSearchVC.

BUT! though it wrote this in console, it also resolves injected properties like it was made to.

Then, we tried to use containers like in Readme
DependencyContainer.uiContainers = [storyBoardContainer]

and it starts working like it should.

So, the question is:

  • Is uiContainers can't work with several containers? Or is there something that we're doing wrong?

Superfluous error messages using multiple UI Containers

Hello! There are couple of modules in my VIPER-designed app. Each of them has separate DependencyContainer and each of them contains UIViewController that is instantiated from Storyboard.

func configureContainers(container rootContainer: DependencyContainer) {
    Dip.logLevel = .Errors
    DependencyContainer.uiContainers = [rootModule,
                                        homeModule,
                                        dockModule,
                                        settingsModule,
                                        listModule,
                                        previewModule]
    ...
}
let rootModule = DependencyContainer { container in
    let rootController = container.register(.shared, tag: "Root") { RootViewController() }
    ....
}

When these dependencies are being resolved during app execution, there are a lot of error messages in the console log. Something like:

No definition registered for type: SomeViewController, arguments: (), tag: String("Some").
Check the tag, type you try to resolve, number, order and types of runtime arguments passed to `resolve()` and match them with registered factories for type SomeViewController.

This messages are emitted by these lines in NSObject extension in dipTag setter:

for container in DependencyContainer.uiContainers {
        do {
          try instantiatable.didInstantiateFromStoryboard(container, tag: tag)
          return
        } catch { }
      }

The reason is in how Dip "finds" proper container for instantiating storyboard object. And it definitely doesn't look too pretty.
It looks like these error messages can be safely ignored, but in my opinion it would be better to get rid of them. They give a wrong idea to the users, who will think that they do something wrong.

Or maybe it's me who does something wrong :)

Спасибо за полезный фреймворк, желаю удачи :)

Does not build with Xcode 9 b4

When building via carthage 0.24.0 and Xcode 9 beta4, we get an error.

When using master all works fine. Maybe a new release or a swift3.2/4.0 would be good.

Can't inject into NSSplitViewController

I have followed the exact steps as I use with NSViewController subclasses but the dependencies never get injected into NSSplitViewController subclasses.

I have tested whether the setter for a property (that I called "blah") on NSObject is called when I set a runtime attribute (just like "dipTag"), and it appears that it never gets called and I suspect this is why the dependencies are not injected.

Do you have a workaround for this that you know of? At the moment I'm considering using NSViewController subclasses with a child NSSplitView to get it to work, but that makes it harder to have view controllers associated with the child views.

I know I can access the container in the app delegate as well, but I like keeping the wiring out of the view component if possible

Can't inject dependency in UITabBarController

I have main UITabBarController with many view controllers. But method didInstantiateFromStoryboard doesn't call (for UITabBarController and view controllers in this tabbarcontroller ). dipTag and container register and added to uiContainers.

DipUI doesn't build from Carthage on XCode 8

I've tried in Swift 3.0 project.
"Use Legacy Swift Language version" set to NO

Cartfile:
github "AliSoftware/Dip-UI"

Build log:
/usr/bin/xcrun xcodebuild -project /Users/Stan/tmp/DipUUUI/Carthage/Checkouts/Dip-UI/DipUI/DipUI.xcodeproj -scheme DipUI-iOS -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean buildBuild settings from command line:
BITCODE_GENERATION_MODE = bitcode
CARTHAGE = YES
CODE_SIGN_IDENTITY =
CODE_SIGNING_REQUIRED = NO
ONLY_ACTIVE_ARCH = NO
SDKROOT = iphoneos10.0

=== CLEAN TARGET DipUI-iOS OF PROJECT DipUI WITH CONFIGURATION Release ===

Check dependencies
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

=== BUILD TARGET DipUI-iOS OF PROJECT DipUI WITH CONFIGURATION Release ===

Check dependencies
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

Command line build output:
carthage update --platform iOS
*** Fetching Dip-UI
*** Fetching Dip
*** Downloading Dip.framework binary at "4.6.1"
*** Checking out Dip-UI at "0.2.2"
*** xcodebuild output can be found in /var/folders/q1/6l276hx53m590df28r4rvpv00000gn/T/carthage-xcodebuild.dvMvGI.log
*** Building scheme "DipUI-iOS" in DipUI.xcodeproj
** CLEAN FAILED **

The following build commands failed:
Check dependencies
(1 failure)
** BUILD FAILED **

The following build commands failed:
Check dependencies
(1 failure)
A shell task (/usr/bin/xcrun xcodebuild -project /Users/Stan/tmp/DipUUUI/Carthage/Checkouts/Dip-UI/DipUI/DipUI.xcodeproj -scheme DipUI-iOS -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES clean build) failed with exit code 65:
** CLEAN FAILED **

The following build commands failed:
Check dependencies
(1 failure)
** BUILD FAILED **

The following build commands failed:
Check dependencies
(1 failure)

Swift 3 problem

Hello,

I saw thread "Swift 3 issues" in Issues page of Dip library and I am wondering whether problems mentioned there applies also to DipUI library. Since I updated library to version 1.0.0, I am experiencing problem when instantiating controller from storyboard with DipUI.
Here is sample code for container controller registration:

container.register(tag: "ViewController") {
            ViewController()
            } .resolvingProperties { (container, entity) in
            entity.viewModel = try! container.resolve() as ViewModel
        }

I have storyboard with viewController with dipTag "ViewController". When I try to instantiate VC, following error occurs:
fatal error: attempt to bridge an implicitly unwrapped optional containing nil
in line 46 in AutoInjection.swift in Dip library.

Has any one found solution for this? Or should we wait for Swift 3.1? This method worked with Swift 2.3 and DipUI 0.2.2

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.