Interface Builder

RSS for tag

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

Interface Builder Documentation

Posts under Interface Builder tag

103 Posts
Sort by:
Post not yet marked as solved
0 Replies
496 Views
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.
Posted
by
Post not yet marked as solved
0 Replies
290 Views
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!
Posted
by
Post marked as solved
3 Replies
739 Views
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)
Posted
by
Post not yet marked as solved
0 Replies
333 Views
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?
Posted
by
Post not yet marked as solved
0 Replies
441 Views
Using VNDocumentCameraViewController, if the document is automatically scanned, it cannot be obtained in the func documentCameraViewController (_ controller: VNDocumentCameraViewController, didFinishWith scan: VNDocumentCameraScan) {}. If manual photography is used, data can be obtained May I ask how to solve it?
Posted
by
Post not yet marked as solved
1 Replies
1k Views
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
Posted
by
Post not yet marked as solved
0 Replies
714 Views
Hi, Yesterday, I updated my Mac (M2 chip) to Sonoma 14.0 and Xcode to version 15. Now, with every project I use, even with a new sample project, when I select Editor &gt; Assistant and then Editor &gt; Preview (which is the procedure I used with previous versions of Xcode to preview the UI on multiple devices), the Editor Assistant window closes, but the preview does not appear. This is a big problem for me, as I'm unable to test AutoLayout in real time. Is this a bug? I found on the internet that some other users have this issue: https://stackoverflow.com/questions/77166887/live-preview-in-the-new-xcode-15 Thanks
Posted
by
Post not yet marked as solved
0 Replies
400 Views
Anyone else getting 100% CPU usage when using Interface Builder for tvOS projects on Xcode 15.0? To reproduce, simply create a new project (Obj C or Swift), select "Storyboard interface" and add a blank UIViewController to the storyboard. Note: Observed launchd_sim and PineBoard processes in Mac Activity Monitor app. Processes will stay at 98-100% until project is closed. (No issue with iOS projects.)
Posted
by
Post not yet marked as solved
2 Replies
996 Views
Have an app with Storyboards that use a few customer fonts (Poppins and FontAwesome). No issues at all in Xcode 14. Updated to Xcode 15, and can build clean and run no issues reported. But many of the buttons and labels have the incorrect custom Font assigned - instead of FontAwesome, the get assigned Poppin. In a few cases FontAwesome is used, but the incorrect weight (I log the button font in awakeFromNib. I've looked at the Storyboard XML, it looks fine, and if I set the font to some system font all works fine. Setting it to a system font, then back to FontAwesome does not fix anything, and the XML looks identical to what it was before. I'm at a total loss as to what to do next. Any suggestions most appreciated. PS: in awakeFromNib, I can set the font to the correct FontAwsome font, and the control shows as it should. So the font works from code, not from the Storyboard.
Posted
by
Post not yet marked as solved
1 Replies
491 Views
According to Apple's official documentation titled "Previewing localizations" https://developer.apple.com/documentation/xcode/previewing-localizations/# "For Interface Builder, you can preview localizations any time during development by choosing localizations including pseudolanguages in the preview. You don’t need to build and run your app to see the preview." However, this functionality seems to have been removed in Xcode 15. "Preview" is not available in the Editor option menu in Interface Builder. Compared to what's available before:
Posted
by
Post not yet marked as solved
0 Replies
361 Views
In an app I'm working on, I have a UINavigationController which has a navigation item in a xib file. I see Left Bar Button Items, Center Item Groups and Right Bar Button Items. Under Right Bar Button Items, I have a UIButton. But, in the interface of the xib file, I don't see it, even if I click on it. Further, I can't add anything to the Left Bar Button Items. In a previous version of Xcode, I had been able to put and edit the UIButton but not anymore? What's going on?
Posted
by
Post not yet marked as solved
1 Replies
1.4k Views
**On the final step of uploading my game to App Store, while archiving the project in Xcode 15, my build fails because of the linker error and AdMob undefined symbols reason. There may be something wrong with the unity-plugin-library like on the screenshots.I think Xcode just cant find some files from my projects that are linked with Google AdMob Ads plugin. I got 2 errors and warnings The error is like this: Unity Framework 2 issues Undefined symbols: Linker command failed with exit code 1 (use -v to see invocation)** _CGSizeFromGADAdSize, referenced from: +[GADUPluginUtil safeAdSizeForAdSize:] in unity-plugin-library.a[arm64] [14] (GADUPluginUtil.o) _GADAdSizeEqualToSize, referenced from: + [GADUPluginUtil safeAdSizeForAdSize:] in unity-plugin-library.a [arm64] [14] (GADUPluginUtil.o) GADAdSizeFromCGSize, referenced from: __GAMUBannerViewSetValidAdSizes in unity-plugin-library.a [arm64][11] (GADUInterface.o) + [GADUPluginUtil safeAdSizeForAdSize:] in unity-plugin-library.a [arm64] [14] (GADUPluginUtil.o) + [GADUPluginUtil adSizeForWidth: height:] in unity-plugin-library.a [arm64] [14] (GADUPluginUtil.o) GADAdSizeFullWidthPortraitWithHeight, referenced from: + [GADUPluginUtil adSizeForWidth: height:] in unity-plugin-library.a[arm64] [14] (GADUPluginUtil.o) _GADCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth, referenced from: + [GADUPluginUtil adaptiveAdSizeForWidth: orientation:] in unity-plugin-library.a [arm64] [14] (GADUPluginUtil.o) GADErrorUserInfoKeyResponseInfo, referenced from: GADUGetAdErrorResponse Info in unity-plugin-library.a[arm64] [11] (GADUInterface.o) GADLandscapeAnchored Adaptive BannerAdSizeWithWidth, referenced from: + [GADUPluginUtil adaptiveAdSizeForWidth: orientation:] in unity-plugin-library.a[arm64] [14] (GADUPluginUtil.o) GADPortraitAnchoredAdaptiveBannerAdSizeWithWidth, referenced from: + [GADUPluginUtil adaptiveAdSizeForWidth:orientation:] in unity-plugin-library.a[arm64] [14] (GADUPluginUtil.o) _NSValueFromGADAdSize, referenced from: _GAMUBannerViewSetValidAdSizes in unity-plugin-library.a[arm64][11] (GADUInterface.o) _OBJC_CLASS_$_GADAppOpenAd, referenced from: in unity-plugin-library.a[arm64] [9] (GADUAppOpenAd.o) _OBJC_CLASS_$__GADBannerView, referenced from: in unity-plugin-library.a[arm64] [10] (GADUBanner.o) _OBJC_CLASS_$_GADExtras, referenced from: in unity-plugin-library.a[arm64] [15] (GADURequest.o) _OBJC_CLASS_$_GADInterstitialAd, referenced from: in unity-plugin-library.a[arm64] [12] (GADUInterstitial.o) clang: error: linker command failed with exit code 1 (use -v to see invocation) **I tried to add libraries or frameworks in the "Compile Sources" window in Build Phases in Xcode. I tried adding frameworks to "Link binary with Libraries". I tried adding "$inherited" to properties of one of the files. I tried restarting my Mac and XCode. At first I was building with Google AdMob unity plugin version 8.4.0 and I updated to the latest plugin 8.5.2 but the errors were the same. My configuration: Unity: 2021.3.31f1 AdMob: 8.5.2 Xcode: 15 MacOS: MacOS 14 latest BaseSDK: IOS Architecture: Arm64 Ruby: 3.2.2 CocoaPods: 1.13.0 **
Posted
by
Post not yet marked as solved
0 Replies
438 Views
I think I have found a Cocoa memory leak that is resulting in my NSDocuments being retained after they have been closed by the user. I am posting here to see if anyone else has encountered this, and if so, what solutions might be available. Essentially, when you have an Autosaving NSDocument that opens an NSWindow containing an NSToolbar the default 'Unified' toolbar style places the Document title to the left of the Toolbar. When the titlebar is laid out like this, there is a clickable area to the right of the title. If the user clicks in this area a log error appears that reads '[Document] Popover failed to show' This seems harmless enough, but in actual fact a memory leak has occurred with the 'NSDocumentTitlebarPopoverViewController' that has failed to show. This View Controller is retained, and unfortunately it contains a strong reference to the NSDocument. So the entire NSDocument instance is also retained. Here is a screenshot of the clickable area: Here is a link to a minimum reproducible example, hosted on GitHub. It is just a template Document Based App with an added Toolbar and a print statement in the Deinit of the Document so you can see if it deinits successfully. Searching online for the '[Document] Popover failed to show' log message doesn't yield any results, nor does searching for the leaking View Controller class name ('NSDocumentTitlebarPopoverViewController').
Posted
by
Post not yet marked as solved
0 Replies
377 Views
I have a WKInterfaceLabel that spans two other objects (could be most anything, but generally solid color). (I'm using Interface Builder). One object is light and the other is dark. I'd like the part of the label on the light object to be black, and the part on the dark object to be white. See the example below. Is there any way to "mask" out part of the label so that the objects behind show through? I could have two labels, one black and one white, but would need to mask out each half. I can't simply half cover each label to mask it out because that will mask out the other.
Posted
by
Post not yet marked as solved
0 Replies
304 Views
I'm just starting to learn Swift and I'm using the "Using Stacks to Create Views" learning module and I'm stuck in section 2 (Compose views) step 1 and the problem that I am having is that the code that is on the right hand section of the learning module is not the same code that I have in my Xcode contentview.swift in the ScrumdingerApp project. https://developer.apple.com/tutorials/app-dev-training/using-stacks-to-arrange-views I'm kind of embarassed as I should be zipping right through this part.. The code in the lesson module is like this - import SwiftUI struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) Text("Hello, world!") } .padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } and the code in my Scrumdinger contentview.swift is much longer and looks like this - this is what I downloaded>> // // ContentView.swift // Scrumdinger // // Created by Chet Shannon on 10/22/23. // import SwiftUI import CoreData struct ContentView: View { @Environment(.managedObjectContext) private var viewContext @FetchRequest( sortDescriptors: [NSSortDescriptor(keyPath: \Item.timestamp, ascending: true)], animation: .default) private var items: FetchedResults<Item> var body: some View { NavigationView { List { ForEach(items) { item in NavigationLink { Text("Item at \(item.timestamp!, formatter: itemFormatter)") } label: { Text(item.timestamp!, formatter: itemFormatter) } } .onDelete(perform: deleteItems) } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { EditButton() } ToolbarItem { Button(action: addItem) { Label("Add Item", systemImage: "plus") } } } Text("Select an item") } } private func addItem() { withAnimation { let newItem = Item(context: viewContext) newItem.timestamp = Date() do { try viewContext.save() } catch { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nsError = error as NSError fatalError("Unresolved error \(nsError), \(nsError.userInfo)") } } } private func deleteItems(offsets: IndexSet) { withAnimation { offsets.map { items[$0] }.forEach(viewContext.delete) do { try viewContext.save() } catch { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. let nsError = error as NSError fatalError("Unresolved error \(nsError), \(nsError.userInfo)") } } } } private let itemFormatter: DateFormatter = { let formatter = DateFormatter() formatter.dateStyle = .short formatter.timeStyle = .medium return formatter }() #Preview { ContentView().environment(.managedObjectContext, PersistenceController.preview.container.viewContext) }
Posted
by
Post not yet marked as solved
0 Replies
334 Views
Hey everyone, I've recently upgraded to Xcode 15.0, and I've noticed that the performance of my storyboards has taken a significant hit. They're running extremely slow, and it's making the development process quite frustrating. I'm wondering if anyone else has encountered this issue and if you've found any effective solutions or workarounds to improve storyboard performance in Xcode 15.0? I'd appreciate any insights or tips on how to make the storyboarding experience smoother and more efficient. Bellow are the details for more information :- System configuration : ( Latest 2023 ) Apple M2 Max with 12‑core CPU, 30‑core GPU and 16‑core Neural Engine 32GB unified memory 1TB SSD storage Xcode Version : 15.0 macOS : Sonoma 14.0 NOTE* : One xib in one storyboard only Thanks in advance for your help!
Posted
by