interface-builder

Many tutorials describe methods for adding multiple child view controllers in the Storyboard, why don't they just add multiple container views? [closed]

China☆狼群 提交于 2019-12-11 17:54:50
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . Many tutorials, such as this one go over how to add multiple child view controllers via the Storyboard. But this tutorial just adds multiple container views in the Storyboard. Why is the first tutorial (and many others) going through such hoops to create multiple child view

iPhone SDK: IBAction

▼魔方 西西 提交于 2019-12-11 16:37:57
问题 I have a situation where I'd like a button to respond to two different IBAction methods. Is there a way that I can force a particular method first? When I look at the buttons connections in IB they are in the correct order, but they consistently perform in the opposite order. 回答1: I don't believe so, but why not just call one action from the other? 回答2: Deleting all the connections in IB then reconnecting in the order I require seemed to work. 来源: https://stackoverflow.com/questions/632309

Using a scroll view to zoom in an image with Swift

落爺英雄遲暮 提交于 2019-12-11 14:49:51
问题 I'm learning Swift from Apple's "App Development in Swift". I'm having problems with constraints, especially on the "I Spy" lab at page 593. It basically wants you to create a scroll view with an image view inside it and make it so you can zoom in an image and scroll it, like in the Photos app when you open a photo. The book says to make both the scroll view and the image view as big as the screen with constraints, so I add top, bottom, leading and trailing constraints to 0, and it works fine

Tab Bar and Nav Controller: Where did I go wrong in my Interface Builder wiring?

烂漫一生 提交于 2019-12-11 14:09:40
问题 I've been working on an iPhone application in XCode and Interface Builder of the Tab Bar project type. After getting a table view of topics (business sectors) working fine I realized that I would need to add a Navigation Control to allow the user to drill into a subtopics (subsectors) table. As a green Objective-C developer, that was confusing, but I managed to get it working by reading various documentation trying out a few different IB options. My current setup is a Tab Bar Controller with

Why am I seeing a black screen? Did I not alloc something?

半世苍凉 提交于 2019-12-11 14:08:59
问题 In xcode, this is one of the views I have created: If I run the program in the simulator, I can see this view fine. However, if I create a UIViewController class and hook it up with this view (I confirmed this view is a UIViewController), this is what I get in the simulator: Why do I get this blank screen? How can I get the screen that looks like the first image? Edit: code #import "EnterLevelViewController.h" @interface EnterLevelViewController () @end @implementation

Initialization of controls in custom uiview

早过忘川 提交于 2019-12-11 13:49:52
问题 I've created a custom uiview in IB and set the class for it. #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> @interface myView : UIControl { IBOutlet UITextView *textView; } @end #import "myView.h" @implementation myView - (void)commonInit { [textView setText:@"lajsdfklasdfjl"]; } - (id)initWithCoder:(NSCoder *)aDecoder { if (self = [super initWithCoder:aDecoder]) { [self commonInit]; } return self; } -(id)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { [self

size class for table row height in iOS storyboard

你。 提交于 2019-12-11 13:49:16
问题 I develop an iOS app with Swift and storyboard. I placed a table and I need to change table cell height depending on screen class, but I can't find such option in table options. I see that cell height is defined by Table View / Row height option, but it doesn't support class sizes. This problem happens because I set fonts of labels in the cell prototype using size classes, so for bigger screens fonts are bigger, but row height can't be changed per size class. I need a higher row for bigger

Showing views in interface builder outside viewcontroller hierarchy in xcode5

岁酱吖の 提交于 2019-12-11 13:46:27
问题 I often make use of views in interface builder that live outside of the viewcontroller hierarchy (see screen grab below for simple example). Before upgrading to Xcode5 I could get this view to appear on the storyboard by writing an IBAction outlet and dragging a connection from the code to the view in the storyboard. If you paused over the button for a moment it would flash and then open up as a view on the storyboard that is then a lot easier to work with. Since upgrading this function no

Toolbar items in sub-nib

匆匆过客 提交于 2019-12-11 13:46:01
问题 This question has probably been asked before, but my google-fu must be inferior to everybody else's, cause I can't figure this out. I'm playing around with the iPhone SDK, and I'm building a concept app I've been thinking about. If we have a look at the skeleton generated with a navigation based app, the MainWindow.xib contains a navigation controller, and within that a root-view controller (and a navigation bar and toolbar if you play around with it a little). The root-view controller has

How to get San Francisco font into Xcode?

自闭症网瘾萝莉.ら 提交于 2019-12-11 12:25:58
问题 I just download and installed the SF fonts. I see them in Sketch and the Font Book but not Xcode (Interface Builder). I've restarted Xcode but the SF or San Francisco fonts still do not show up in the text tool. Does anyone know if something special is required to get them working in Xcode? OS X 10.11.1 Xcode 7.1.1 回答1: All you have to do is to add your (.ttf) file to resources. You can drag and drop it and then a dialogue box will appear after that check the checkbox for your application and