Comments (11)
We can rename Inject
to InjectConfiguration
and remove namespacing so that Hosts are not namespaced so they can still be referred to by Inject.VIewControllerHost
etc
from inject.
Idle thought, do you get this warning if you use a typealias?
from inject.
Idle thought, do you get this warning if you use a typealias?
A typealias on the integrating side like this: https://github.com/cakl/MyUIFramework/blob/feature/typealias/MyUIFramework/ViewController.swift ? This does not seem to help.
from inject.
Are we sure this is still an issue? I have a class SwiftTrace in a package SwiftTrace which used to give a warning but I've not seen it for a while (Xcode 15). There was talk for a while this would eventually not be allowed but perhaps they realised this would be very disruptive.
from inject.
Are we sure this is still an issue? I have a class SwiftTrace in a package SwiftTrace which used to give a warning but I've not seen it for a while (Xcode 15). There was talk for a while this would eventually not be allowed but perhaps they realised this would be very disruptive.
I only have the issue if Inject
is used in a framework. If I'm not doing anything else wrong, yes, it is still an issue. The behaviour can be reproduced with the linked sample project (https://github.com/cakl/MyUIFramework) with Xcode 14.2 and Xcode 14.3.1 (build the xcframework with the provided shell file). The same behaviour is also reproduceable on GH runners (14.2 build vs 14.3.1 build)
from inject.
OK, I'm with you now. Using your script, I can see that when packaging a binary framework an invalid .swiftinterface file is generated if a type shares its name with the package which is what Xcode warns about - even with Xcode 15.2.
from inject.
Can you not add OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface
to your script? It builds but I don't know if that just kicks the problem down the road. The invalid Inject.swiftinterface doesn't seem to be in the built .xcframework.
from inject.
We've not heard back from you. Are you not able to build your framework? I'm using the following and it seems to work:
#!/bin/bash
set -euxo pipefail
# Builds xcframework from iOS framework template project called MyUIFramework
# Clean build folder
rm -rf ./build
# Archive for iOS
xcodebuild archive -scheme MyUIFramework -destination="iOS" -archivePath ./build/ios.xcarchive -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface
# Archive for simulator
xcodebuild archive -scheme MyUIFramework -destination="iOS Simulator" -archivePath ./build/iossimulator.xcarchive -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface
# Build xcframework with two archives
xcodebuild -create-xcframework -framework ./build/ios.xcarchive/Products/Library/Frameworks/MyUIFramework.framework -framework ./build/iossimulator.xcarchive/Products/Library/Frameworks/MyUIFramework.framework -output ./build/MyUIFramework.xcframework
from inject.
We've not heard back from you. Are you not able to build your framework? I'm using the following and it seems to work:
#!/bin/bash set -euxo pipefail # Builds xcframework from iOS framework template project called MyUIFramework # Clean build folder rm -rf ./build # Archive for iOS xcodebuild archive -scheme MyUIFramework -destination="iOS" -archivePath ./build/ios.xcarchive -sdk iphoneos SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface # Archive for simulator xcodebuild archive -scheme MyUIFramework -destination="iOS Simulator" -archivePath ./build/iossimulator.xcarchive -sdk iphonesimulator SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES OTHER_SWIFT_FLAGS=-no-verify-emitted-module-interface # Build xcframework with two archives xcodebuild -create-xcframework -framework ./build/ios.xcarchive/Products/Library/Frameworks/MyUIFramework.framework -framework ./build/iossimulator.xcarchive/Products/Library/Frameworks/MyUIFramework.framework -output ./build/MyUIFramework.xcframework
Sorry for the delayed reply. I will try your script in the production code asap. I just thought that this build flag should be the last option and hoped that @krzysztofzablocki’s proposal of renaming should be the way to go (to prevent to „kick the problem down the road“).
from inject.
I'd go for trying changing your script for your specific use case before we start renaming things which might affect other Inject users.
from inject.
@krzysztofzablocki Sorry for the late reply and thank you for your changes.
What I observed:
- I updated my demo repo to Inject v1.4.0 and the build fails (see: branch, build with the following error:
- Error:
/Users/runner/work/MyUIFramework/MyUIFramework/MyUIFramework/ViewController.swift:20:23: error: module 'Inject' has no member named 'ViewControllerHost' let childVC = Inject.ViewControllerHost(ChildViewController())
- Error:
- I observed a similar error in a release config build of a current iOS-project using Inject not in an SDK.
I may not fully understand Inject's code and your change, but to me it looks like in the release
build the hosts must be accessed via InjectConfiguration (e.g. InjectConfiguration.ViewControllerHost(...)
) and in a Debug build still Inject.ViewControllerHost(...)
can be used (because of the global typealias). Or what am I missing?
Thanks for your help...
from inject.
Related Issues (20)
- Debug View Hierarchy stops working after compiling a new ViewController HOT 2
- Inject on multi frameworks project HOT 4
- Device injection HOT 8
- Injection is not working Xcode 14.0.1 HOT 3
- InjectionIII connected but view doesn't reload HOT 9
- SwiftUI + UIKit project causes crashes HOT 12
- Interface Builder and prepare for segue HOT 4
- / HOT 1
- Could not find module for target 'x86_64-apple-ios-simulator' HOT 11
- Xcode package integration not working HOT 4
- Only add on root view (SwiftUI) HOT 3
- unable to use it in all files with @_exported import Inject HOT 4
- Please update "-Xlinker -interposable" instruction. HOT 4
- SwiftUI custom modifier HOT 7
- TCA support? HOT 13
- TCA 1.7.3 crash (ComposableArchitecture/Store.swift:682: Fatal error: Unexpectedly found nil while unwrapping an Optional value) HOT 19
- Setup with UITabBarController HOT 2
- Updating the trunk of Cocoapods HOT 2
- Module 'Inject' has no member named 'ViewControllerHost' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inject.