Interface Builder

RSS for tag

Build interfaces for applications without writing code using Interface Builder, an editor within Xcode.

Posts under Interface Builder tag

97 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

UITabBarController is unsupported as viewController
Hi, I'm testing one of my app on iOS 14 with Xcode 12 beta 3 (12A8169g) and I have a problem with my storyboards. Xcode give me this error for all the storyboards that contain a split view controller: An internal error occurred. Editing functionality may be limited. The log generated by the Xcode "Report a bug" button say: Exception name: NSInvalidArgumentException Exception reason: UITabBarController is unsupported as viewController for -[UISplitViewController setViewController:forColumn:] in Primary column It worked correctly on Xcode 12 beta 2. Has anyone encountered the same problem and found a way to fix it? Thank you
7
0
2.3k
Jul ’23
Xcode Application Continuous (OSX) Indexing Crash Problem
Xcode indexing will cause my Mac Mini (M1) to crash when indexing is active (ON). ===> Xcode Version 12.5.1 (12E507) To test the following, I created a smaller OSX desktop application, compared to my main OSX desktop application, which is significantly larger in scope, and size. That said, I enter the following code in the terminal to activate and deactivate Xcode Indexing: 1. Indexing is active (ON) when applied in the terminal : defaults write com.apple.dt.XCode IDEIndexDisable 0 2. Indexing is NOT active (OFF) when applied in the terminal : defaults write com.apple.dt.XCode IDEIndexDisable 1 The application causing the crash with Xcode Indexing turned (ON), creates a PList file for my main application to use, which is an array of dictionary tuples. This application for the moment, creates a baseline array of 4,000+ dictionary objects with eight (8) tuple objects per dictionary. I use the same design with different, and significantly less information to create other PList array of dictionary objects, such as creating a PList array of dictionary objects for one column of objects instead of my application’s eight tableView columns. The smaller PLlist array of dictionary objects for an identified tableView column contains numeric information, which my application analyses to provide statistical data, such as mean, median, mode, maximum, minimum, number of occurrences, histograms, charts, et al. The smaller PList column application does not crash when Xcode Indexing is active (ON). When Xcode Indexing is active (ON) for the larger PList application the following occurs: 1. Xcode quickly usurps all the RAM in my Mac Mini (M1 - 16 GB). 2. Activity Monitor shows “SourceKitService” climbs steadily to (20 GB) from (140 MB). 3. Activity Monitor shows “swift-frontend” climbs steadily to (80 GB) from (1 GB). 4. Activity Monitor shows “Physical Memory: 16 GB” 5. Activity Monitor shows “Memory Used: 14.01 GB” 6. Activity Monitor shows “Cached Files: 1.91 GB” 7. Activity Monitor shows “Swap Used: 29.49 GB” 8. Activity Monitor shows “App Memory: 3.69 GB” 9. Activity Monitor shows “Wired Memory: 1,012.5 MB” 10. Activity Monitor shows “Compressed: 8.53 GB” 11. Activity Monitor shows “Memory Pressure: Max” My Mac Mini (M1) does not hesitate to show the Force Quit Modal: “Your system has run out of application memory.” Xcode ===> (“Xcode set at 309.0 MB”) Finder ===> (“Finder set at 158.2 MB”) Boom, I must restart my computer. When Xcode Indexing is NOT active (OFF) the following occurs: 1. The Mac Mini (M1) does not crash. 2. My application will NOT allow me to connect to any viewController outlet in my application from any IB. 3. Attempting a connection from IB to the associated properly named “viewController” presents the following error message: ===> Could not insert new action connection: could not find any information for the class named “blah blah blah …” <=== This exercise to turn “ON” and turn “OFF” Xcode indexing for my situation is repeatable. Turning (OFF) Xcode indexing introduces the above "Could not" error message, and turning (ON) Xcode indexing prevents the error message from showing with my smaller indexed applications. So, for the moment, I can manually create an outlet in the “viewController” with copy and paste, “change” the new outlet name and function, then “connect” the IB item to the new viewController outlet, using “control-drag.” This “get-by-product” effort allows me to continue making connections without frustration. For me, and my Mac Xcode programming experience, when Xcode Indexing is “OFF,” all the other internet suggestions to fix the “Could not insert new action connection” failed miserably. Those suggestions obviously worked for the individual poster, but unfortunately not for me. When Xcode crashes with this error, my computer asks to send the issue to Apple, so I say “Yes.” This experience blindly took me more than two months to isolate my application issue, through trial and error, trying to follow the numerous suggestions on the internet to no avail. I turned OFF Xcode Indexing a few months ago to prevent the larger indexing application from crashing. My efforts to resolve the “Could not insert new action” message included: 1. Creating new view controllers. 2. Copying the original viewController code into the new viewController. 3. Clean and rebuild. 4. Delete derived folders. 5. Reviewing possible “Automatic and Manual” assistant editor issues. 5. Believing my suspect object copy methods from one IB to another IB, caused the issue, therefore causing me to rebuild an IB or two from scratch. The Xcode Index crashing issue, and the subsequent “Could not insert new action” issue happens to be annoying, but I am able to continue programming my application without Xcode indexing. My main concern and my current dilemma right now happens to be, what will become of my application, since I cannot index the application without Xcode indexing causing my Mac Mini (M1) to crash … ? Just curious … :] All suggestions, as always, are welcome. Best regards, jim_k
2
0
2.1k
Aug ’23
UIButton image disappears when “debug executable” is unchecked in edit scheme
I have created a UIButton in storyboard, and have set an image for the UIButton (the image is in assets.xcassets). The button shows up in the simulator and when run on an iPhone. However, if I quit the app on the iPhone and open it again, the button disappears, but I am still able to click it and it works. The same thing happens when I uncheck "debug executable." When I check the view hierarchy, the button is on top of the hierarchy but is invisible. Using infoButton.isHidden = false also does not work. In my button's view controller, I have called view.bringSubviewToFront(_: infoButton) in viewDidLoad(). I have also tried setting the button's image programmatically, but it still doesn't show up. However, when I set a background color for the button with infoButton.backgroundColor = UIColor.blue, I can see a blue box where the button should be, but no image. Here are my settings for the UIButton: I would appreciate any help, thank you.
2
1
1.4k
Oct ’23
Xcode 14.3 - Failed to render and update auto layout status
Since updating to Xcode 14.3 every view controller in every storyboard is not updating its IBDesignable's with an error saying it can't find the right .app with the right architecture. This all worked fine in Xcode 14.2 I'm running on an M1 mac mini Error below: /Users/****/Documents/Projects/****/****/Modules/Onboarding/Base.lproj/Onboarding.storyboard Failed to render and update auto layout status for ****ViewController (3EC-3V-hGn): dlopen(****.app, 0x0001): tried: '/****' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot****.app' (no such file), '****.app' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')) I've tried following a stackoverflow post that suggested changing "Build Active Architecture Only" to "No" for debug builds. When I rebuilt I got a prompt from Xcode saying the build failed, and it asked me to turn on Rosetta to try again. I didn't try this as it seemed like this is broken, given it works fine on 14.2
6
3
2.8k
Jun ’23
Problems updating to Xcode 14.3
When I upgraded Xcode to the latest version 14.3, I have some problems with AEPServices. Showing Recent Errors Only underlying Objective-C module 'AEPServices' not found failed to verify module interface of 'AEPServices' due to the errors above; the textual interface may be broken by project issues or a compiler bug So I use more solutions about config search paths, target in build settings, and build phases, but it does not work for me. If anyone has encountered this problem, please give me a solution to fix it. Thanks a lot!
2
0
902
Oct ’23
Xcode 15 beta 2 - Build Error: "Failed to find or create execution context for description '<IBCocoaTouchPlatformToolDescription: 0x600002588860>'"
After I've updated to Xcode 15 beta 2, I'm getting these build time errors, which I didn't see in beta 1. Failed to find or create execution context for description '<IBCocoaTouchPlatformToolDescription: 0x600002588860> System content for IBRealityIdiom-seventeenAndLater <IBScaleFactorDeviceTypeDescription: 0x600002588b60> scaleFactor=2x, renderMode.identifier=(null)'. I've tried - restarting the Xcode15 beta 2, re-installing Xcode 15 beta 2 and also its Commnad Line Tools Restarting the macOS (twice) However, nothing has worked so far. I'd appreciate any suggestions or ideas as to how to fix this issue, because I'm stuck without being able to build the projects. Thanks in advance!
3
2
2.5k
Jul ’23
Storyboard Boolean Switch Object
The Storyboard Interface Builder has a Switch object that toggles between On, and Off, states. While in the On state it looks normal. While in the Off state it is grayed out. I have a use for this object for the user to toggle between two options which are other than On, and Off. For my intended use its Off state gray out is undesirable. Is there way to prevent this switch graying out in its Off state?
0
0
307
Jun ’23
Generation of IPA using Command line tools
I am generating the IPA file using command line tools for custom IPA generation. Each time, it asks for login credentials during code signing. However, this doesn't work for me because I always use a different developer's profile to generate the IPA. Consequently, I am unable to enter the login passcode for each developer's profile. Please let me know if there are any other steps to avoid code signing while generating the IPA file. The scripts as follows: xcodebuild -workspace -scheme -archivePath archive xcodebuild -exportArchive -archivePath -exportPath -exportOptionsPlist.
1
0
1.3k
Jun ’23
Accessing Interface Builder GUI Controls Anywhere in the App
I used the Interface Builder to place a Switch object in a view. I ctrl dragged it into the Assistant to make its handler a method of the class the view's is in, which is itself a subclass of "UITableViewController". A dialog box appear into which I entered the function name, and select the the option to have the sender as an argument. The result is function of the form: @IBAction func switchStateChange(_ sender: UISwitch) { } Now I need to query this Switch's On/Off state from elsewhere in the program, and if necessary change its state. It is not a good solution to save the sender parameter to a global variable because then it would require the user to change this switch's state before that global variable is set. What is needed is to identify, and lookup, this switch object to access it from anywhere in the application. How is this done?
1
0
566
Jun ’23
Can @AppStorage be used on Storyboard objects?
The need is to persist between launches the state of storyboard objects such as of type UISwitch, UITextField, etc. Can this be done using @AppStorage? If so how can @AppStorage be set to watch these? I tried getting @AppStorage to watch an outlet class member variable that is connected to the storyboard object: @IBOutlet weak var iPhoneName: UITextField! @AppStorage("iPhoneName") var iPhoneName: String = "" This got an error because the variable to be watched is already declared. I decided to make the the watched variable different than the one connected to the Storyboard's UITextField object: @AppStorage("iPhoneName") var striPhoneName: String = "" and got the error: Unknown attribute 'AppStorage' . In what import library is @AppStorage defined? If @AppStorage cannot be used for this, what is the easiest way to code storyboard object persistence? I am looking for an easy, and quick way. I am not concerned with memory usage right now.
2
0
1.1k
Jan ’24
Duplicate a ViewController on Canvas
I was able to duplicate (option + Drag) a ViewController on my canvas the first time, although wasn't easy. The second time, I had so much trouble to get it to work, then finally (option + drag) worked again. I am trying to duplicate the 3rd time and it still is not working. I am able to copy paste the ViewController, the only issue is that I have no visual representation on the canvas, while I do have the duplicate in the document outline and I can do what ever I want to it there, however I prefer seeing a visual rep. on the canvas as well. Is this a bug in Xcode 15 that I am not able to easily (option + drag) a ViewController to duplicate it, like it is done for the UI Objects. On that note it (option + dark) is also a hassle to get it to work the first time even up to the 4 time around on the ViewController itself. Any ideas or info is appreciated.
0
0
453
Jun ’23
UIButton Changing Foreground, and Background, Colors
The goal is to have the background, and foreground, colors show the current state of a UIButton on a storyboard file. The attempt to do that is done with this code: var toggleLight: Bool = false @IBAction func toggleLight(_ sender: UIButton) { if( toggleLight ){ toggleLight = false sender.baseBackgroundColor = UIColor.black sender.baseForegroundColor = UIColor.white }else{ toggleLight = true sender.baseBackgroundColor = UIColor.white sender.baseForegroundColor = UIColor.black } tableView.reloadData() } I get these errors: Value of type 'UIButton' has no member 'baseBackgroundColor' Value of type 'UIButton' has no member 'baseForegroundColor' I do not understand this because in file "UIKit.UIButton" I see: extension UIButton { ... public var baseForegroundColor: UIColor? public var baseBackgroundColor: UIColor? ... } What has gone wrong there?
0
0
464
Jun ’23
Can't Create Storyboard Outlet
I am not able drag a reference object from a Storyboard screen to code in the Assistant. The expected blue line appears as the screenshot shows, but no code is created in the Assistant. This reference object is not in the Launch Screen. When the the screen this object is in is highlighted, the correct file opens in the Assistant. Dragging this object from the "Content View" folder also does not work, even though the blue line also appears. I was recently able to do this. Something changed. What might have changed?
1
0
728
Jul ’23
Firebase and Compiling errors with Xcode 15.0 beta 2
I am getting the following errors when I attempt to build my project since I updated Xcode to Version 15.0 beta 2 (15A5161b). I am wondering if anyone could help me figure it out as I have already cleared the cache and the build folder as well as reinstalling the firebase package entirely. Here are the two errors I have been receiving: "failed to verify module interface of 'Project_Name' due to the errors above; the textual interface may be broken by project issues or a compiler bug" (The code on the line this error is on is on a autogenerated file titled "Project_Title.private" and cannot be edited, "// swift-interface-format-version: 1.0") The other error I assume also has to do with the above issue, "no such module as 'firebase'" ( the code on line of question is "import Firebase".) I would appreciate ay help I could get because I cannot find any documentation or similar problems. I have attached screenshots below for your convenience. Thank you for your help!
5
2
1.5k
Oct ’23
How to prevent my custom header from being pushed up
Hi all, I have been racking my brain about this for hours now and cannot seem to get it figured out. I have created a custom header using a Swift UI View. When I put the HeaderView onto say my Menu View it is fine until I start adding content. I want to add navigation links in my Menu View to navigate my app. At that time, the shape part of my header start to get bumped up out of position but the text stays where it should. How do I prevent the header from moving at all? I want it to be in a fixed position on each screen. I will be using the same header just with different text on each screen. Here is my HeaderView struct HeaderView: View { let title: LocalizedStringKey var bgColor: Color var body: some View { GeometryReader { geometry in ZStack { Ellipse() .fill(self.bgColor) .frame(width: geometry.size.width * 1.4, height: geometry.size.height * 0.30) .position(x: geometry.size.width / 2.00, y: geometry.size.height * 0.035) .edgesIgnoringSafeArea(.all) VStack{ Text(self.title) .font(.title) .fontWeight(.bold) .foregroundColor(Color.green) .padding(.top,20) Spacer() } } } } } Here is my Menu View: struct MenuView: View { @StateObject var viewModel = MenuViewViewModel() init() {} var body: some View { NavigationView{ VStack{ HeaderView(title: "Menu", bgColor: Color.green.opacity(0.3)) HStack{ Image(systemName: "bell.fill") NavigationLink("Notifications", destination: NotificationsView()) } HStack{ Image(systemName:"person.crop.circle.fill") NavigationLink("Profile", destination: ProfileView()) } HStack{ Image(systemName: "puzzlepiece.fill") NavigationLink("Projects", destination: ProjectsView()) } } } } } I can provide screenshots of what happens after I do this if need be. Thanks in advance.
0
0
498
Jul ’23
Xcode 15 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named StopwatchSupport.ActivityIndicatorVisualStyle
Hello I'm encountering a strange error, probably linked to a bug in Xcode 15 beta 2. When running my app from xcod 15 Beta 2 (either on device running iOS16.5.1 or any simulator running iOS17) for some views I receive the following fatal error: 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named StopwatchSupport.ActivityIndicatorVisualStyle because no class named StopwatchSupport.ActivityIndicatorVisualStyle was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target)' From the stack trace, the error seems to be appearing just afterthos calls: #3 0x00000001b3faef54 in UINibDecoderDecodeObjectForValue () #4 0x00000001b3faf1ec in UINibDecoderDecodeObjectForValue () Thanks for any help guidance provided.
4
2
1.1k
Jul ’23
How to add a scene, and its class, to the Storyboard
I added a scene to an existing story board that already has other scenes. I put focus on the new scene, and in the Identity Inspector's "Class" field I gave it a class name. The "Storyboard ID" field did not show in this inspector. Why would it not? No file named after the class name I gave it appeared in the "Project navigator". Is this supposed to happen automatically? Or must I create this Swift file that contains the class definition for the scene manually?
2
0
1.2k
Jul ’23