Posts

Post not yet marked as solved
4 Replies
783 Views
I wanted to move a few .swift files from the framework to different container. I tried creating framework/static-library/SPM to move a few files from the framework but getting compilation errors for the new framework and old framework due to dependancy. I don't want ondemand resource and wanted to keep it local. So I looking for some container to move a few files from framework and load/import them back. I tried moving those files to Settings.bundle but unable to load/import them in the framework? Is there any other way to achieve this?
Posted Last updated
.
Post not yet marked as solved
0 Replies
376 Views
I wanted to separate a few file from the framework. Let's say I have Class A,B,C,D,E,F,G. I wanted to move Class D and E out of the framework and keep it separate. Creating a new static/dynamic framework/SPM/Target is giving compilation error as Class D and E dependent on other classes. Is there a way to separate Class D and E by putting them in a separate container and import them in the framework?
Posted Last updated
.
Post not yet marked as solved
2 Replies
764 Views
Xcode is not responding when opening a workspace. I deleted the cache, derived data, saved application state and xcuserdata. I tried with different Xcode version too. Any help is much appreciated.
Posted Last updated
.
Post not yet marked as solved
1 Replies
903 Views
My client is using Xcode 11 but the iOS framework imported in the project is available only in Xcode 13. Client is getting "framework not found" in Xcode 11 . Is there a way to make my project compatible with older Xcode Version?
Posted Last updated
.
Post not yet marked as solved
0 Replies
387 Views
I linked a framework as optional/weak and it's working fine in the latest Xcode but in the older Xcode version compilation is failing due to "framework not found". Is there a way to fix the compilation error in the older Xcode version?
Posted Last updated
.
Post not yet marked as solved
2 Replies
568 Views
What is the best way to print in the order for the given implementation (void) print:(NSString*) str while(true) { NSLog(@“%@”, str); } } [self print:@“123”]; [self print:@“ABC”]; [self print:@“456”]; [self print:@“DEF”]; output should be printing in the order continuously 123 ABC 456 DEF 123 ABC 456 DEF … … …
Posted Last updated
.
Post not yet marked as solved
8 Replies
1k Views
I have declared an NSMutableArray and the count should not exceed 100. If some one calls addObject method to add an item to that array when the count is 100 then that method call should not be executed until someone removes an item so that count will go down below 100. Can we use semaphore or group dispatch for signaling or mutex/NSLock is recommended.
Posted Last updated
.
Post not yet marked as solved
1 Replies
586 Views
I believe weak references are not required when using self inside the dispatch queues. Is there any other occasions where weak self is not required related to closure?
Posted Last updated
.
Post not yet marked as solved
0 Replies
593 Views
I wrote a few unit test cases using XCTest by mocking the data? Is there any best practice to have multiple test profiles with different data sets? Sometime mock should return nil, sometimes an array with 2 elements and sometimes an array with 10 elements. How to have multiple test profiles?
Posted Last updated
.
Post not yet marked as solved
0 Replies
544 Views
func displayUI () { let hostingController = UIHostingController(rootView: ContentView(ViewModel: contentViewModal).environmentObject(self)) } Above code works fine. I attempted to make the hostingController as instance variable instead of local variable and declared the hostingController outside of display function like this lazy var hostingController: UIHostingController = UIHostingController(rootView: ContentView()) and so I removed let keyword func displayUI () {  hostingController = UIHostingController(rootView: ContentView(ViewModel: contentViewModal).environmentObject(self)) } Once I remove the let keyword I started getting this error. Cannot convert value of type 'some View' to specified type ‘ContentView' Any idea why I am getting this error after removing let keyword declared before hostingController variable?
Posted Last updated
.
Post not yet marked as solved
0 Replies
631 Views
class A { func processData { let viewModel: ViewModal = ViewModal() let viewController = ViewController() viewController.displayUI(viewModel) .... .... .... .... viewModel.imageName = "abcd" .... .... .... .... viewModel.imageName = "efg" .... .... .... .... viewModel.imageName = "hij" } } class ViewController { func displayUI (viewModal: ViewModal){ let contentView = ContentView(viewModal: viewModal).environmentObject(self) // present contentView } } class ViewModal { @Published var imageName: String = ""   @Published var label: String = "" // string formatting } struct ContentView: View {  @State var viewModel: ViewModal  @EnvironmentObject var viewController: ViewController  var body: some View { } } Can class A directly access ViewModal or it should pass the data to ViewController and ViewController set the data in ViewModal
Posted Last updated
.
Post not yet marked as solved
1 Replies
994 Views
I am using "Excluded Source File Names" in Xcode build settings to remove a folder from IPA. The given relative path is correct but for some reason, the folder that needs to be excluded is still exists in the .app file. Any idea why Excluded Source File Names is not working. The folder that I am trying to remove is listed under "Copy Bundle Resources" Here is the path "$(SRCROOT)/../foldera/folderb/foldertoberemoved"
Posted Last updated
.
Post marked as solved
2 Replies
2.3k Views
I am trying to localize Swift framework and added a file Localizable.Strings and that file is included in the target but the app that consumes this framework is showing the key not the actual string. NSLocalizedString("string_key", comment: "Actual String") I think issue is related to bundle. Do I need to add bundle parameter to NSLocalizedString? If so what is the bundle parameter value? If bundle is not required then what must be the issue
Posted Last updated
.