iosswiftswift4typhoon

AppDelegate integration of Typhoon with Swift 4


I've been using Typhoon with AppDelegate integration in Swift 3 without any problems but since updating to Swift 4 and Xcode 9 I'm having an issue where initialAssemblies() is never called.

AppDelegate.swift

func initialAssemblies() -> NSArray {
    return [SharedComponentsAssembly.self,
            ViewControllersAssembly.self]
}

Previously in Swift 3, Xcode 8: initialAssemblies() was called before application(_:didFinishLaunchingWithOptions:)

Now in Swift 4, Xcode 9: initialAssemblies() is never called

I've looked in the Activating Assemblies guide from Typhoon wiki but couldn't find the solution. For now I'm using plist integration as a workaround but I'd prefer to use the AppDelegate integration.

If anyone has successfully used the AppDelegate integration with Swift 4 please help!


Solution

  • Did you try to add "@objc" specifier? Like that

    @objc func initialAssemblies() -> [Any] {
        return [SharedComponentsAssembly.self,
                ViewControllersAssembly.self]
    }
    

    I've checked and this method gets called in my case.