interface-builder

NSTextField with automatic NSNumberFormatter in Interface Builder

*爱你&永不变心* 提交于 2019-12-19 06:00:55
问题 I've been making iOS apps for awhile, but I'm trying my hand at MacOS development. I'm adding an NSTextField to my UI and I noticed in Xcode that one of the options in the graphical widgets is "NSTextField with NSNumberFormatter" which implies to me that I'll be able to restrict the input of the field to numbers and configure the formatter in some way. When I add the NSTextField with NSNumberFormatter to my UI, I can see it has a formatter outlet which appears to be kind of linked to an

In xcode 6.1, interface builder deleting ui elements

那年仲夏 提交于 2019-12-19 05:21:53
问题 I have a view with some tableviews and some collection views and also some buttons and labels. I'm not sure if this is new with Xcode 6.1 because I have not worked on the ui aspect of this project for some time. However, when I try to resize just about anything in the view, my tableviews and collection views, and possibly some other elements I am not noticing, get deleted. Specifically, it seems their frame or rect propertied get deleted. To be clear, this only occurs when I attempt to resize

UI Elements showing blue border in Interface builder

旧巷老猫 提交于 2019-12-19 05:08:42
问题 Since the latest Xcode updates all the elements of a view appear with a blue border in Interface Builder. Is there any way to disable this blue border in each view? When there are many elements in the view this is annoying. Attached is a sample image 回答1: Go in Menu' Editor->Canvas and make sure the option "Show bounds Rectangles" or "Show Layout Rectangles" is disable. 回答2: In Xcode: Editor canvas show Bounds rectangles. This option show/hide the blue lines. 来源: https://stackoverflow.com

Xcode 4.5 storyboard crashing

≯℡__Kan透↙ 提交于 2019-12-19 04:38:16
问题 Very often when I try to edit UILabels in storyboard, Xcode is crashing. Any ideas what could be causing this? It looks like it has something to do with one of the autolayout constraints. Here's the error report: Process: Xcode [43938] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 4.5 (1839) Build Info: IDEApplication-1839000000000000~3 App Item ID: 497799835 App External ID: 10747437 Code Type: X86-64 (Native) Parent Process: launchd [43283] Date

How to use modal views in swift?

跟風遠走 提交于 2019-12-19 03:21:39
问题 When adding an account to Mail (in preferences), you get a modal view, like this: My question is, how do I replicate this programatically? In other words, how do I display a modal UIView over a presenting view? Here's what I have: import UIKit class ViewController: UIViewController { @IBAction func addCard(sender: AnyObject) { var addContact : secondViewController = secondViewController() self.modalTransitionStyle = UIModalTransitionStyle.FlipHorizontal self.modalPresentationStyle =

What does “Controller Key” mean in Interface Builder > Inspector > Bindings?

久未见 提交于 2019-12-19 03:19:05
问题 I can't find in the Docs where they explain all those fields and what they mean. Especially "Controller Key" is not clear to me. 回答1: The Controller Key pop-up menu is a way to help you discover what keys the controller (typically a NSArrayController, NSObjectController or a NSTreeController) presents. The best example is the selection key of NSArrayControllers, which contains the set of selected objects. What is confusing is the NSObjectController presents a 'selection' key too, although the

UIColor vs IB color (color profile issue)

别来无恙 提交于 2019-12-19 02:42:20
问题 I'm using XCode 8.2.1. I just learned about color profiles and that RGB values are not universal. But still can't understand how to make it right in code. In Interface Builder I selected predefined "Dark Gray Color" for a label. It is (85, 85, 85) in Generic RGB profile. Also in code I set another label color to [UIColor darkGrayColor]. I expected them to have the same color, but they are different. I used method - (BOOL)getRed:(nullable CGFloat *)red green:(nullable CGFloat *)green blue:

How can I bring a view in front of another view, in Swift?

旧城冷巷雨未停 提交于 2019-12-18 18:53:31
问题 Below are how my views are organized in IB, top->bottom when the app is started. The user can do something to make "Category Table View Header" temporarily expand over "Name View" - however once doing so, the .TouchDown action assigned to "Category Table View Header" no longer works wherever it overlaps with "Name View" (i.e., the user can tap the header anywhere it doesn't overlap with name view and it still works). I know that may be confusing, so I drew out some boxes. On the left is the

How can I bring a view in front of another view, in Swift?

妖精的绣舞 提交于 2019-12-18 18:53:09
问题 Below are how my views are organized in IB, top->bottom when the app is started. The user can do something to make "Category Table View Header" temporarily expand over "Name View" - however once doing so, the .TouchDown action assigned to "Category Table View Header" no longer works wherever it overlaps with "Name View" (i.e., the user can tap the header anywhere it doesn't overlap with name view and it still works). I know that may be confusing, so I drew out some boxes. On the left is the

Xcode: Why does “User Interaction Enabled” appear twice?

时光总嘲笑我的痴心妄想 提交于 2019-12-18 18:41:26
问题 This question applies to Xcode 3 and 4: Why does this checkbox appear twice? (under the Identity inspector and also under the Attributes inspector). And more important, howcome changing the value of one doesn't affect the other? 回答1: The User Interaction Enabled in the Identity Inspector is referring to the Accessibility protocol. Here is a link to the Accessibility Programming Guide You tick different traits to modify how the elements responds to the Accessibility systems on the device. On