Interface Builder

RSS for tag

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

Posts under Interface Builder tag

47 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

View appears transparent over tableView, whatever alpha channel
I have a view in storyboard, with a tableView and a coloured UIView. The UIView is declared after tableView, so it appears on top of tableView. However, it appears semi transparent over the tableView. In addition, I cannot set its alpha channel to values other than 1 or 0 (e.g., 0.9) But if I create the view programmatically, the view if fully opaque as expected. What am I missing ?
1
0
832
Jun ’24
GridView addRow height problem
I am trying to add rows to GridView and not able to get expected row height correctly. override func viewDidLoad() { super.viewDidLoad() // Remove the row in IB designer gridView.removeRow(at: 0) let image = NSImage(named: NSImage.colorPanelName)! //image.size = NSMakeSize(80, 80) let imageView = NSImageView(image: image) imageView.imageFrameStyle = .grayBezel imageView.imageScaling = .scaleAxesIndependently imageView.frame = NSMakeRect(0, 0, 80, 80) let label = NSTextField(labelWithString: "test text") let row = gridView.addRow(with: [imageView, label]) row.height = 80 } What was wrong with my code?
5
0
781
Jan ’24
Are storyboard and UIKit due to disappear ?
I read in Xcode 15.2 release notes that @IBDesignable and @Inspectable are deprecated and will disappear in a future release. After the abandon of WatchKit and its storyboard, replaced by SwiftUI, does it mean storyboards (and consequently UIKit) will progressively disappear, leaving developers alone with SwiftUI to design apps (IMHO, inadequate to design complex UI: for instance, I always struggle to position precisely objects for all devices sizes as we miss constraints manager in SwiftUI) ? For sure, IBDesignable is (was) whimsical, but a very useful tool to design sophisticated UI. Replacing by #Preview does not make it. I also understand that Xcode is a very complex piece of code and that maintaining and evolving some tools (as IBDesignable) requires effort. But isn't it what we expect from Apple ? To provide us with the best tools and keep on the promise of WYSIWYG environments, all along ? Is it only me or do others share this view ?
2
0
1.9k
Dec ’23
Weird problem of NSTableView with auto layout
I have had this issue for a long time. If I configure any auto layout constraints in TableViewCell, I get extremely weird layout behavior in IB designer; however, layout is completely good during runtime. For example, with a completely new project and a single NSTableView on the main view, I get: If I resize main view, the tableview won't get resized Every time I reopen the project, the tableview would shrink by height. It seems the shrinked height is doubled every time. For example, in the following screenshot, the gap is 56. Next reopen will double the gap to 112. Is this a known bug? I would want to file bug report at https://feedbackassistant.apple.com.
1
1
556
Nov ’23
How to fix: IPA BINARY CODE ANALYSIS in iOS swift
I received the MOBSF security check result PDF, where I found some "High" severity issues. 1.Binary makes use of insecure API(s) with high CWE: CWE-676: Use of Potentially Dangerous Function OWASP Top 10: M7: Client Code Quality OWASP MASVS: MSTG-CODE-8. The binary may contain the following insecure API(s): _sscanf, _memcpy, _fopen. 2.Binary makes use of the malloc function with high CWE: CWE-789: Uncontrolled Memory Allocation OWASP Top 10: M7: Client Code Quality OWASP MASVS: MSTG-CODE-8. The binary may use the _malloc function instead of calloc. I have utilized a static analyzer, but I am unable to identify the APIs such as _sscanf and others in my codebase. This issue is not being shown in Xcode IDE either. I have attempted static analysis in Xcode using the approach: Product -> Analyze, but I am still unable to identify the mentioned issues. Can anyone please help me overcome this scenario and successfully pass the MOBSF test? Thanks in Advance
1
0
2.3k
Jul ’24
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
29
22
10k
Aug ’24
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.5k
Jan ’24