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

106 Posts
Sort by:
Post marked as Apple Recommended
545 Views
I'm using XCODE 15 and trying to add the iPhone XS as a selection option within the device configuration pane. My view controller canvas is limited to the ten iPhone default options that came with XCODE15. While I am able to install and configure an iPhone XS as the device simulator, I can't seem figure out how to change my view controller and canvas to that of an iPhone XS. Welcome any ideas. I've seen some good older posts that relate to much older versions of XCODE, and I've referenced the XCODE documentation such as the interface builder workflow. I'm new to XCODE and still learning, so appreciate any ideas if anyone has figured this out already. For now, my view controller is just set to use the iPhone 11 but it's not quite the same. Thanks.
Posted
by Roberto1.
Last updated
.
Post not yet marked as solved
0 Replies
271 Views
I teach Swift coding to high school students. I would like to be able to assign the various labs in the Fundamentals curriculum where I reduce the opportunities for cheating. Students will share images of the coding answers with each other or they can go on the internet to see the answers. I would like individualize the labs for each student. For example: When they have an assignment where the directions require a longitude property to be set to 50.001. Then changed to another number. I would like to automatically generate slightly different numbers in the lab (a different number for each student) and then save this new lab in the intended student's name. Is that possible? Is it easy to do? Harold Peaden
Posted Last updated
.
Post not yet marked as solved
0 Replies
428 Views
Hi, I installed a few versions of Additional Tools for Xcode. I was interested the most in the CarPlay Simulator. I installed the Tools for Xcode 15 - they do not work because of my version of macOS (11.7.4). So I went with the earliest and the latest version of those tools for Xcode 14. They didn't work because I have an Intel machine. I tried the earliest ones for Xcode 13 - they didn't work but I assumed that it could be something to do with the Beta version of the CarPlay Sim (labeled as Beta). I installed the latest version for Xcode 13, labeled as for Xcode 13.4. I tried 3 different devices. iPhone 11 running iOS 17.0.2, iPhone 6s running a version of iOS 15 and an iPhone 13 running some version of iOS 16. All 3 of them connect normally to a CarPlay equipped infotainment system (Discover Media, MIB 3 in a 2021 Volkswagen Caddy). The phones connect to the car both wired and wireless flawlessly, but I cannot connect them to the carplay sim. None devices run any non-finished, unreleased app. The CarPlay Sim recognizes all 3, but in the devices tab the dot is red. I tried turning off personal hotspot, clicking the device name in the devices tab, multiple lightning cables and multiple versions of the CarPlay Simulator. Nothing will work, all 3 phones show "Accesory Not Supported - Your phone does not support this accesory". All cables are MFI certified. All of them are USB-A because my computer is pre-USB-C era. What can possibly be wrong, what can I do?
Posted Last updated
.
Post not yet marked as solved
2 Replies
1.3k Views
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.
Posted
by rainypuns.
Last updated
.
Post marked as solved
25 Replies
7.6k Views
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
Posted
by Serzhas.
Last updated
.
Post not yet marked as solved
5 Replies
1.3k Views
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!
Posted Last updated
.
Post not yet marked as solved
0 Replies
316 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 Last updated
.
Post not yet marked as solved
0 Replies
286 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 Last updated
.
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 Last updated
.
Post not yet marked as solved
0 Replies
361 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 MowinMan.
Last updated
.
Post not yet marked as solved
2 Replies
863 Views
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!
Posted
by CrisPn.
Last updated
.
Post not yet marked as solved
0 Replies
415 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 Last updated
.
Post not yet marked as solved
1 Replies
475 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 mediter.
Last updated
.
Post not yet marked as solved
0 Replies
338 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 Last updated
.
Post not yet marked as solved
2 Replies
936 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 dhoerl.
Last updated
.
Post not yet marked as solved
0 Replies
384 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 jpdev001.
Last updated
.
Post not yet marked as solved
0 Replies
684 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 gidanmx2.
Last updated
.