Interface Builder

RSS for tag

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

Posts under Interface Builder tag

82 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.4k
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.2k
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.5k
Oct ’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
948
Oct ’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.2k
Jan ’24
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.6k
Oct ’23
Xcode 15 Beta - Could not instantiate class named _UIRecessedMaterialView because no class named _UIRecessedMaterialView was found
This is a very annoying error which is causing a crash in my app. The error description is very vague and I'm guessing mostly related to oddities of Xcode 15 Beta. Here is the full error stack: *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named _UIRecessedMaterialView because no class named _UIRecessedMaterialView 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)' *** First throw call stack: ( 0 CoreFoundation 0x00007ff80048c88a __exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007ff800057894 objc_exception_throw + 48 2 CoreFoundation 0x00007ff80048c768 -[NSException initWithCoder:] + 0 3 UIFoundation 0x00007ff804a1eb4d UINibDecoderDecodeObjectForValue + 352 4 UIFoundation 0x00007ff804a1eebe UINibDecoderDecodeObjectForValue + 1233 5 UIFoundation 0x00007ff804a1e9e2 -[UINibDecoder decodeObjectForKey:] + 257 6 UIKitCore 0x000000010e566a9f -[UIView initWithCoder:] + 1327 7 UIKitCore 0x000000010e4ed417 -[UIScrollView initWithCoder:] + 65 8 UIKitCore 0x000000010e34cbd5 -[UITextView initWithCoder:] + 65 9 UIFoundation 0x00007ff804a1ecb4 UINibDecoderDecodeObjectForValue + 711 10 UIFoundation 0x00007ff804a1e9e2 -[UINibDecoder decodeObjectForKey:] + 257 11 UIKitCore 0x000000010d97e7f0 -[UIRuntimeConnection initWithCoder:] + 160 12 UIFoundation 0x00007ff804a1ecb4 UINibDecoderDecodeObjectForValue + 711 13 UIFoundation 0x00007ff804a1eebe UINibDecoderDecodeObjectForValue + 1233 14 UIFoundation 0x00007ff804a1e9e2 -[UINibDecoder decodeObjectForKey:] + 257 15 UIKitCore 0x000000010d977a79 -[NSCoder(UIIBDependencyInjectionInternal) _decodeObjectsWithSourceSegueTemplate:creator:sender:forKey:] + 447 16 UIKitCore 0x000000010d97a77e -[UINib instantiateWithOwner:options:] + 1118 17 UIKitCore 0x000000010d532dab -[UIViewController loadView] + 643 18 UIKitCore 0x000000010d533128 -[UIViewController loadViewIfRequired] + 129 19 UIKitCore 0x000000010d533960 -[UIViewController view] + 27 .... Has anyone found the solution to this issue? This is preventing us from fully validating our iPadOS 17 upgrade builds. Thanks in advance.
2
1
746
Jul ’23
Wrong fonts loaded from Storyboards in Xcode 15
We use Storyboards and custom fonts in our app. Once we started developing new features for iOS 17 and did the first build in Xcode 15, we've noticed that in quite a few places incorrect fonts are set to views. In some places it is incorrect weight, while in other it's completely different font. Some observations: Fonts may change the next time app is build. E.g., instead of SF Pro Display Semibold we got SF Pro Display Heavy, and then after few relaunches it switched to Nunito Bold 😵‍💫 We’ve ensured that correct font is set in Storyboard, and even tried to re-assign it. That didn’t help. All custom fonts are properly added to a target and are registered in info.plist All custom fonts are listed in UIFont.familyNames, so they are indeed registered with the system. Wrong fonts are loaded on both development environment and in TestFlight builds We’ve never experienced anything similar before Xcode 15 What we've tried: Re-assigning fonts in Storyboard. Creating new Storyboard in Xcode 15 and copying screens into it. I wonder if anybody else having similar issues and maybe knows the workaround. Thank you. P.S. I've filed a Feedback to Apple: FB12903371
28
22
8.6k
Oct ’23
NSNumberFormatter wrongfully displays 16-bit unsigned int as signed
Hi all, My interface displays a text field bound to an NSNumber that I use internally as unsigned int. That NSNumber is actually saved with Core Data as Integer 16. However, the interface displays the number signed, meaning anything above 32.768 is actually shown to be negative. I couldn't find a way to force my NSNumberFormatter to display unsigned numbers. Setting the minimum value to 0 also doesn't work, since internally it's gonna be positive anyway. Could you help me display my 16-bit integer as an unsigned int between 0 and 65.535? I am building a macOS app using Objective-C, macOS SDK 10.14 and Xcode 14.3.1.
1
0
511
Aug ’23
Cannot change title text color in MacOS popup buttons
I am having a problem configuring popup buttons for a macOS application, using the Interface Builder mechanisms of Xcode (14.3.1). I am prepared to report the issue as a bug, but I thought I would check here to see if I had overlooked something in my configuration efforts: Briefly, I wish to have a popup button in my app's main window (not in the menu bar), that has a bezel color of "System Orange Color" and that uses white lettering for its title. My app has a lot of buttons, and for all the other button types I have used, when I set the bezel color to System Orange or to some similarly dark-ish color, the title lettering automagically comes up white. That of course also happens for the popup buttons that are part of the menu bar -- their titles have white lettering -- but when I place a popup button in the main window of my app, its title comes up with black letters no matter what I do. This is solely an aesthetic problem -- the popup button works perfectly well, it just looks out of place because its lettering doesn't match the other buttons. The misbehaving popup button is configured via Xcode only -- no commands sent from code. Its Xcode configuration settings include Pull Down, No Arrow, Bevel, Momentary Push In, System Orange Color, System Regular (font), and No Image.
0
0
548
Sep ’23
Issue Changing Color with Custom Color in Xcode's Interface Builder
Hello Apple Developer community, I'm encountering an issue when trying to change the color of a component using a custom color in Xcode's Interface Builder. While I can easily set the background color to system colors like "System Pink," I'm facing difficulties when attempting to use custom colors. Problem Description: When I select the color wheel, color sliders, or color palettes to choose a custom color, the changes don't seem to apply to my components. Steps I've Taken to Resolve the Issue: I have updated my macOS to the latest version. I've ensured that Xcode is up to date. I've even tried reinstalling Xcode from scratch. I've deleted derived data and cleared caches as part of troubleshooting. Additional Information: I've recorded a video demonstrating the issue, which you can view (https://drive.google.com/file/d/1q2fztiAOwvDM5t-k1eMbfBULobcJZiax/view?usp=share_link) I'm looking for guidance on how to successfully set a custom background color for my UIView in Interface Builder. Has anyone else experienced this issue or found a solution? Any help or insights would be greatly appreciated. Thank you in advance for your assistance!
0
0
321
Sep ’23
Storyboard is not compiling and causing a crash if I open it in latest Xcode 15 release
I have a project with a fairly complex storyboard (~13k lines). The project builds fine with Xcode 14, both locally and on Xcode Cloud. However, on Xcode 15 Release (And also the last Beta version) opening the storyboard causes Xcode to crash, while trying to compile the project fails with a crash in ibtool. I've tried a few solutions to no avail. I've tried to isolate the build issue and try running ibtool locally to see if I get more output. This is what I get: /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --output-format human-readable-text Main.storyboard 2023-09-20 18:54:17.690 ibtoold[289:56283117] [MT] DVTAssertions: ASSERTION FAILURE in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot11/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/IDEInterfaceBuilderCocoaTouch/IDEInterfaceBuilderCocoaTouch-22130/InterfaceBuilder/WidgetIntegration/IBUIAutolayoutGuide/IBUIViewAutolayoutGuideIntegration.m:481 Details: code which should be unreachable has been reached Object: <IBUIViewAutolayoutGuide: 0x6000068a6d00> Method: -ibPrimitiveAddConstraintsToCandidateListOnly:thatAreAlreadyInDocument: Thread: <_NSMainThread: 0x600001e241c0>{number = 1, name = main} Hints: Backtrace: 0 -[DVTAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation) 1 _DVTAssertionHandler (in DVTFoundation) 2 _DVTAssertionFailureHandler (in DVTFoundation) 3 -[IBUIViewAutolayoutGuide(IBUIViewAutolayoutGuideIntegration) ibPrimitiveRemoveConstraintsFromCandidateListOnly:keepingInDocument:] (in IDEInterfaceBuilderCocoaTouchIntegration) 4 -[NSView(IBViewIntegration) ibMoveCandidateConstraint:toParent:alreadyInDocument:] (in IDEInterfaceBuilderKit) 5 -[NSView(IBViewIntegration) ibVerifyConstraintsAreWellFormedInDocument:subarbitrationUnitCache:andPopulateMessages:] (in IDEInterfaceBuilderKit) 6 -[IBDocumentVerifier _verifyConstraintsAndPopulateMessages:] (in IDEInterfaceBuilderKit) 7 -[IBDocumentVerifier verifyAndPopulateMessages:] (in IDEInterfaceBuilderKit) 8 -[IBCocoaTouchDocumentVerifier verifyAndPopulateMessages:] (in IDEInterfaceBuilderCocoaTouchIntegration) 9 -[IBiOSDocumentVerifier verifyAndPopulateMessages:] (in IDEInterfaceBuilderiOSIntegration) 10 -[IBiOSStoryboardDocumentVerifier verifyAndPopulateMessages:] (in IDEInterfaceBuilderiOSIntegration) 11 __41-[IBDocumentVerifier performVerification]_block_invoke (in IDEInterfaceBuilderKit) 12 -[IBDocumentAutolayoutManager ignoreAutolayoutStatusInvalidationDuring:] (in IDEInterfaceBuilderKit) 13 -[IBDocument ignoreAutolayoutStatusInvalidationDuring:] (in IDEInterfaceBuilderKit) 14 -[IBDocumentVerifier performVerification] (in IDEInterfaceBuilderKit) 15 -[IBDocument performVerification] (in IDEInterfaceBuilderKit) 16 -[IBDocument readFromURL:ofType:error:] (in IDEInterfaceBuilderKit) 17 IBLoadDocument (in ibtoold) 18 -[IBCLIInterfaceBuilderToolPersona invokeArguments:outputDictionary:] (in ibtoold) 19 -[IBCLIInterfaceBuilderToolPersona runSingleInvocation:outputtingToFileHandle:andVerifyingEnvironment:] (in ibtoold) 20 IBCLIServerRunSingleInvocation (in ibtoold) 21 __IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess_block_invoke_2 (in ibtoold) 22 __IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess_block_invoke (in ibtoold) 23 -[IBCLIErrorForwarder forwardErrorOutputToDescriptor:whileInvokingBlock:] (in ibtoold) 24 IBCLIServerRunSingleInvocationWithIODirectedAtPipesAndUnlinkOnSuccess (in ibtoold) 25 main (in ibtoold) 26 start (in dyld)
4
0
865
Sep ’23
Relative To Container in Interface Builder rounds value in Xcode
I'm not sure when it started (sometime before Xcode 15), but in Interface Builder, if I set the Height or Width to Relative to Container, the value I put in the numeric field displays as a rounded integer. In other words, if I set it to be 0.25, it displays as 0; if I set it to 0.75, it displays as 1. It does behave as the number I've entered. It's just frustrating when I'm trying to tweak my numbers and I have to write down what I've entered. Is this a bug in Xcode, or is there some oddball setting that I may have inadvertently changed?
1
0
373
Sep ’23
Xcode 15 Crashing when previewing a Swift ui View File(Error: 'ld: warning: ignoring duplicate libraries: '-lc++'')
I updated MacOs to Sonoma and Xcode to 15 but when I want to preview some SwiftUI view, my project crashes. Some views don't crash but the others do. It started when I updated Xcode and my Mac. I also receive an error message, ld: warning: ignoring duplicate libraries: '-lc++' Please help, very confused. Thanks
2
1
1.1k
Sep ’23