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

152 Posts
Sort by:
Post not yet marked as solved
0 Replies
46 Views
Greetings everyone! Judging by the fact that Xcode is running very slowlz and the banner up top is saying "An internal error occurred. Editing functionality might be limited." I'm thinking either I am doing something wrong or something is not working right. Is it too many elements/pages? How is one supposed to do this correctly? Context: I'm making an app that is supposed to be an AR platform, kind of like a browser for AR content.
Posted
by tuskuno.
Last updated
.
Post not yet marked as solved
1 Replies
59 Views
I have the following code and when trying to add Animation, I get the following error: "Cannot find 'withAnimation' in scope error" Is there something I'm missing please? import Foundation import MapKit class LocationsViewModel: ObservableObject { //All loaded locations @Published var locations: [Locations] //Current location on the map @Published var mapLocation: Locations @Published var mapRegion: MKCoordinateRegion = MKCoordinateRegion() let mapSpan = MKCoordinateSpan(latitudeDelta: 0.1, longitudeDelta: 0.1) init() { let locations = LocationsDataService.locations self.locations = locations self.mapLocation = locations.first! self.updateMapRegion(locations: locations.first!) } private func updateMapRegion (locations:Locations) { withAnimation(.easeInOut) { mapRegion = MKCoordinateRegion( center: Locations.coordinates, span: mapSpan) }
Posted
by swift_100.
Last updated
.
Post not yet marked as solved
0 Replies
121 Views
This is probably an extend/ follow up of https://developer.apple.com/forums/thread/697442. I have an app that is built based on iPad mini 5 (1024x768) and have been working fine. Recently I am working on to make it compatible to iPad mini 6 which it has two empty bars top and bottom. (Same as the issue the above thread is facing) The debugger recognizes iPad mini 6 as 1024x768 but it should be 1133x744. I have searched online and tried below: Turn on/ off UIRequiresFullScreen in info.plist change storyboard source code 1133x744 switch "view as" on story board (it automatically change source code to the size but when I run it, same issue still occur) Is there a special step that I am missing after making a change to the storyboard on xcode and deploy to the device from visual studio? I do make sure the change go through to visual studio before I start to rebuild and run by comparing source code. I am super new to ios app development so may be missing something very simple. I am using real devices for testing (both iPad mini 5 and mini 6), they both on ios 16.1.1. I am using xcode 14.1 and visual studio to build and deploy to the device.
Posted
by Kimidacat.
Last updated
.
Post not yet marked as solved
3 Replies
485 Views
Xcode 14.0 crashes when i open my Main.storyboard. It happens randomly but especially anytime i go back to it from another code file window or other storyboard. Any advice would be really appreciated. I have attempted cleaning build folder, restarting, fixing constraints, setting useAutolayout="YES" to NO... Nothing seem to work and at this point it crashes so often that i can not even investigate the interface builder that much. The report shows that 'Thread 13 crashes' but i am unsure what to do to prevent that.: ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Process: Xcode [14057] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 14.0 (21335) Build Info: IDEFrameworks-21335000000000000~35 (14A309) App Item ID: 497799835 App External ID: 851890269 Code Type: X86-64 (Native) Parent Process: launchd [1] User ID: 501 Date/Time: 2022-09-25 16:54:25.9759 -0600 OS Version: macOS 12.6 (21G115) Report Version: 12 Bridge OS Version: 6.6 (19P6067) Anonymous UUID: 5350E89D-B390-D37F-76F9-598FD667385E Sleep/Wake UUID: 6D902654-A522-4A2E-87D3-D3F577604736 Time Awake Since Boot: 5900 seconds Time Since Wake: 5046 seconds System Integrity Protection: enabled Crashed Thread: 13 Dispatch queue: Xcode.IB.MessageChannel Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Application Specific Information: abort() called com.apple.main-thread Application Specific Signatures: !previousCommandBacktrace ... Thread 13 Crashed:: Dispatch queue: Xcode.IB.MessageChannel 0 libsystem_kernel.dylib 0x7ff80af6400e __pthread_kill + 10 1 libsystem_pthread.dylib 0x7ff80af9a1ff pthread_kill + 263 2 libsystem_c.dylib 0x7ff80aee5d24 abort + 123 3 IDEKit 0x109a9f307 +[IDEAssertionHandler _handleAssertionWithLogString:assertionSignature:assertionReason:extraBacktrace:] + 1216 4 IDEKit 0x109a9f812 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] + 1075 5 DVTFoundation 0x10650e4b5 _DVTAssertionHandler + 464 6 DVTFoundation 0x10650e6c1 _DVTAssertionFailureHandler + 306 7 AssetCatalogFoundation 0x11846d945 -[IBMessageSendChannel sendMessage:returnValue:context:error:arguments:] + 1785 8 IDEInterfaceBuilderCocoaTouchIntegration 0x12da2ab36 __61-[IBCocoaTouchToolProxy updateScenesWithSceneUpdateRequests:]_block_invoke + 115 9 IDEInterfaceBuilderKit 0x12c7bb9ef -[IBAbstractPlatformToolProxy _ON_QUEUE_sendMessage:toChannelReturningError:during:] + 149 10 IDEInterfaceBuilderKit 0x12c7bb636 __59-[IBAbstractPlatformToolProxy sendMessage:toChannelDuring:]_block_invoke + 49 11 libdispatch.dylib 0x7ff80ade3317 _dispatch_client_callout + 8 12 libdispatch.dylib 0x7ff80adf07ee _dispatch_lane_barrier_sync_invoke_and_complete + 60 13 DVTFoundation 0x10655d1bb DVTDispatchSync + 148 14 IDEInterfaceBuilderKit 0x12c7bb550 -[IBAbstractPlatformToolProxy sendMessage:toChannelDuring:] + 217 15 IDEInterfaceBuilderCocoaTouchIntegration 0x12da2aa90 -[IBCocoaTouchToolProxy updateScenesWithSceneUpdateRequests:] + 123 16 IDEInterfaceBuilderCocoaTouchIntegration 0x12da45b6c __114-[IBCocoaTouchSceneUpdateRequestProcessor performRequestOnBackgroundThreadWithData:diagnosticsBlock:platformTool:]_block_invoke.33 + 30 17 IDEInterfaceBuilderKit 0x12ca675b9 +[IBPlatformToolFailureHandler performRequestWithTool:failureHandlerBlock:failureMessageBlock:diagnosticsConfigurationBlock:duringBlock:] + 114 18 IDEInterfaceBuilderCocoaTouchIntegration 0x12da4557f -[IBCocoaTouchSceneUpdateRequestProcessor performRequestOnBackgroundThreadWithData:diagnosticsBlock:platformTool:] + 413 19 IDEInterfaceBuilderKit 0x12ca6b5ce __42-[IBPlatformToolRequester processRequests]_block_invoke + 740 20 IDEInterfaceBuilderKit 0x12ca6a72b -[IBPlatformToolRequester _connectToToolProxyWithSupersessionIdentifier:during:] + 802 21 IDEInterfaceBuilderKit 0x12ca6b0c2 -[IBPlatformToolRequester processRequests] + 1102 22 IDEInterfaceBuilderKit 0x12ca69a2d __104-[IBPlatformToolRequester issueRequestWithData:supersessionIdentifier:diagnosticsBlock:completionBlock:]_block_invoke + 21 23 DVTFoundation 0x10655c789 __DVT_CALLING_CLIENT_BLOCK__ + 7 24 DVTFoundation 0x10655d29d __DVTDispatchAsync_block_invoke + 196 25 libdispatch.dylib 0x7ff80ade20cc _dispatch_call_block_and_release + 12 26 libdispatch.dylib 0x7ff80ade3317 _dispatch_client_callout + 8 27 libdispatch.dylib 0x7ff80ade9317 _dispatch_lane_serial_drain + 672 28 libdispatch.dylib 0x7ff80ade9dfd _dispatch_lane_invoke + 366 29 libdispatch.dylib 0x7ff80adf3eee _dispatch_workloop_worker_thread + 753 30 libsystem_pthread.dylib 0x7ff80af96fd0 _pthread_wqthread + 326 31 libsystem_pthread.dylib 0x7ff80af95f57 start_wqthread + 15 ...
Posted Last updated
.
Post not yet marked as solved
2 Replies
454 Views
hello! recently played in pubg mobile and noticed that the home button (played on xr) is not activating after the first swap and you need to double swap it to minimize the game. I wonder how to make the same button in unity? can you please send me a source to it
Posted
by Shastr.
Last updated
.
Post not yet marked as solved
0 Replies
128 Views
I have been unable to find any way to detach the inspector pane of Xcode (13.2.1) so it can be displayed on a second monitor. I can open individual class files and display them on a second monitor (and that is a help and that is a big help in setting up nib files) but can find no way to separate the inspector pane from the main Xcode window so as to drag it to the second monitor. From doing some online searching it seems that this was possible earlier, but I can not see any way to do it. Is it possible? And, if so, how?
Posted Last updated
.
Post not yet marked as solved
2 Replies
187 Views
Hi I am in Xcode in the interface builder storyboard trying to make a tic-tac-toe game. In an action I wanted when the user presses a button an X appears at a certain font size. I have looked for a long time around the internet and still couldn't find anything. I will be forever grateful if you could help me 😁.  @IBAction func testX(_ sender: UIButton) { sender.titleLabel?.font = [UIFont withSize(75.0)]; } I tried this it doesn't work.
Posted Last updated
.
Post not yet marked as solved
6 Replies
951 Views
Hello, I have been working with storyboards for my projects without any problems. However, since the XCode Version 14.0 (14A309), the "safe area" on the storyboard preview is wrong for landscape orientation, as you can see in the image below: The "safe area" acts as in portrait (with margins on top and bottom) instead of margins on the left and right side as in the previous version. Also changing the device for preview does not help. It seems to affect only the preview, as the safe area is well in place after building it on both iPhone 13 and iPhone 12 mini. Do you have any idea how to fix this? Or is it a bug that should be fixed by the Apple developer team? Thanks
Posted
by WizAxel.
Last updated
.
Post not yet marked as solved
2 Replies
403 Views
With Xcode 14, the device selection on the bottom of the storyboard canvas has changed, and the iPhone 12 and 13 mini screens are no longer there, as well as there only being one model of iPad. Is there a way to add more devices to this section? I have simulators installed for these devices, and this is the way I've been checking compatibility so far, but this is not sustainable. I appreciate any help that you can give me.
Posted Last updated
.
Post not yet marked as solved
0 Replies
211 Views
Hello there. Since Xcode 12 I'm facing issue with Sent events section disappearing in Interface Builder when set up as custom class and module. public class TestButton: UIButton {} Problem appears when custom class is part of another binary framework. When custom class is part of source code dependency, all events are appearing just fine. Of course, there is a workaround to use Sent Events by changing button class to default UIButton, assigning events and then changing back to custom class and module. However, it would be nice if I could use Sent Events without those unnecessary extra steps.
Posted Last updated
.
Post not yet marked as solved
0 Replies
214 Views
We're using PDFs for assets in a Mac app, using Xcode 14.1 The generated Assets.car file is very big, much larger than the total size of the .xcassets directory that contains all the source images (PDFs). When examining the output of assetutil --info it looks like each of our PDF assets appears 4 times in the asset catalog: Scale=1 and Colorspace=srgb Scale=1 and Colorspace=extended srgb Scale=2 and Colorspace=srgb Scale=2 and Colorspace=extended srgb How can we generate an asset catalog that contains only 1 copy of each asset? (We're using asset catalogs in order to support dark mode, otherwise we could work around this issue by just using the PDFs as resources directly.) Has anyone else run into this problem? Thanks!
Posted Last updated
.
Post marked as solved
4 Replies
338 Views
I have a macOS tableview I have a textfield as a column along with an IBAction code to capture the data from this field. I wanted to add continuous spell check for this column . So, I decided to change the column from a TextField to a ScrollView to take advantage of the continuous spell check. Using Xcode 14 I changed the Cell to a custom Cell. The custom cell has a scrollview object as the object because I want to take advantage of the built in continuous spell checking instead of using a textfield. All is well with this implementation until I tried to add a IBAction code for when I enter text in the scrollview/textView field. There does not seem to be a way to capture the text? Am I trying to do something that can't be done or is there a way to add continuous spell check to a textField?
Posted
by BigEagle.
Last updated
.
Post not yet marked as solved
1 Replies
271 Views
I've been having issues with the launch screen in my app displaying correctly on iPad - the launch screen is only showing on ~1/3rd of the display. I think it started when I updated to iPadOS 16 but can't be sure. To confirm it's not an issue with my launch screen file, I have also tested a launch screen with image and background color (the SwiftUI style I believe) and I created an empty Swift Storyboard app with no modifications. In both cases it exhibited the issue. This is what it looks like in my app now: When I originally made the launch screen it would look like this: This issue appears on my 11" M1 iPad and 12.9" M2 iPad but not on my 6th gen iPad Mini. All 3 devices on are on iOS 16.1. It also does not show up in the iOS simulator. My development machine is on macOS 13 with Xcode 14.1. Thanks in advance.
Posted Last updated
.
Post not yet marked as solved
2 Replies
541 Views
Xcode 14 keeps being unusable on Ventura: any IBOutlet properties created on Ventura won't be recognized in Interface Builder. It also applies to the latest beta, Xcode 14.1 RC2. No issues on Monterey. It's unusual that such a major bug could make it into the final release (of whether Xcode or macOS or both). It's not some kind of a minor obscure issue that's easy to miss. It's a part of core functionality. The bug makes development in Xcode on Ventura pretty much impossible (at least in Objective-C, don't know if it affects Swift).
Posted
by Leo Braun.
Last updated
.
Post not yet marked as solved
2 Replies
239 Views
Howdy, I have a storyboard-based view controller which I manually load into memory (i.e. no segues) and push into a navigation stack. For this view controller, I would like to dynamically update the title prior to presentation based on some runtime-state. My initial assumption was that this could be done simply by updating navigationItem.title sometime before viewDidAppear(:). But this procedure is not behaiving quite as I expected. It seems that no matter where I set navigationItem.title, the rendered title is only updated after the view controller is fully pushed. Meaning that the user is able to see the title is changing from its default value as defined in the storyboard to the dynamically generated one. This is not the behavior I want. What is the easiest/correct way to force an update to the visible title before the view controller is presented to the user? Is this even possible? Thanks, smkuehnhold
Posted Last updated
.
Post marked as solved
2 Replies
300 Views
I have old projects without autolayout. When I open the storyboard in Interface Builder everything looks fine. But if I move a button or label by one pixel, for example, or add a new UIView, then the Interface Builder randomly changes the x, y, width, or height values for almost all elements in all UIViewControllers in the storyboard file. Not all values are changed, but a lot. If I close and open Storyboard a few times and do an action, the values are changed so many times that the user interface is completely broken. Does anyone have an idea how I can fix the problem? I am using Xcode 14.0.1 and it happens with all projects I have. The changes look like this, for example:
Posted
by vsmedia.
Last updated
.
Post marked as solved
4 Replies
282 Views
I'm seeing a strange issue in which my @IBDesignable class fail to render in Interface Builder unless I make a change to the underlying class file. To elaborate on what I mean by that, Create a subclass of UIButton and mark the class as @IBDesignable Add some @IBInspectable properties. Switch over to Interface Builder, go to the Library and drag an instance of a Button onto your Interface Builder canvas. Go to the Identity Inspector and change the class type from UIButton to your custom UIButton subclass. Go back to the Attributes Inspector. At this point, I do see all my @IBInspectable properties in the Attributes Inspector, and Interface Builder properly puts my custom class name above my defined inspectable properties. Everything looks normal except for the fact that the UI above my Inspectable that typically reads "Designables Up to date" does not show at all. I then proceed to change and modify the Inspectable properties only to see that the button in the canvas does not update or change at all. At this point, I go back to my class file, and make a modification. Any modification at all, even just adding a single space to a comment, and when I go back to Interface Builder, everything is working. I see the "Designables Up to date" UI showing, my button is displaying with my custom styling, etc. If I interact with, and make changes to my Inspectable properties in the Attributes Inspector, my button also properly updates in real time. While an annoyance during the development process, I do see this becoming a bit of more significant issue given the fact that the components I am building into a Framework are to be distributed to 3rd party developers in the form of XCFramework binary in a Swift Package. A third party developer won't be able to say, go to the class file and make a modification, nor would I want them to. The only other work around I found is after changing the class type to your custom @IBDesignable class, to then just quit and reboot Xcode. And when after relaunching the @IBDesignable appears and works correctly. Obviously, I don't want to add to my documentation to reboot Xcode after dragging a UI component to your canvas. I've never seen this issue before, has anyone else seen anything like this? I am currently running Xcode 13.4.1 (13F100), still haven't had a chance to update to the latest Xcode. I will also try upgrading later this afternoon to the latest Xcode 14 release but I'm not seeing anything in the Release Notes that might indicate anything that would address this issue if it had been previously identified.
Posted
by JohnC2.
Last updated
.