storyboard

Sorting Scenes in Xcode Interface Builder

*爱你&永不变心* 提交于 2019-12-10 02:11:58
问题 So I'm not sure what to call it, but its that bar on the left in Storyboard Editor in Xcode that displays all of the different scenes. I love using storyboards, but my biggest pet peeve with them is that the scenes are organized in that list in an utterly random fashion. Every time I add a new view controller to the storyboard it gets inserted into a seemingly random place on the list. Two nearby views are not at all nearby in the scene listing. So my question is this: Is it possible to

Swift: Become First Responder on UITextField Not Working?

只谈情不闲聊 提交于 2019-12-10 01:59:05
问题 I've created a custom UIViewController with one UITextField on Storyboard. On viewDidLoad , I set the UITextFIeld to becomeFirstResponder , nothing happened (no keyboards popped up). I then tried calling resignFirstResponder() , but it returned false. Next I tried to find who the first responder is through looping all the subviews using the code over @ Get the current first responder without using a private API. It turns out none of the sub views are the first responder. My ViewController in

How to set number side as default (while keyboard is open) of name phone pad keyboard type

回眸只為那壹抹淺笑 提交于 2019-12-10 01:48:00
问题 Right now when the keyboard launches on my application it defaults to the letter side showing an alphabetical keyboard. Question will be listed below images Refer to image below: This is good . Clicking 123 will show the number side. The Question: However, I want to by default show the number side and still be able to switch back to the letter side later WHEN THE KEYBOARD IS OPEN. How do I do this? Setting the keyboard programmatically to a different type is NOT the answer! For example: User

How can I show ViewController in UITabBarController?

泄露秘密 提交于 2019-12-09 19:05:05
问题 I have a UITabBarController and all my other view controllers are connected to it. Now I want to show one my controller as: let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc: ViewController = storyboard.instantiateViewControllerWithIdentifier("ViewController") as! ViewController but when I tried to: let rootViewController = self.window?.rootViewController as! UINavigationController rootViewController.pushViewController(vc, animated: true) it gave me the next error: Could not

storyboard segue from a tablecell an its Detail Disclosure Button

余生颓废 提交于 2019-12-09 18:33:51
问题 I want to segue from a tablecell to two different viewcontrollers if clicked in the cell or clicked on the cells Detail Disclosure Button. If I ctrl-drag the second segue, the first is deleted. What am I doing wrong? Tnx Mica 回答1: I don't think you can link a specific detail disclosure button w/ a segue. My storyboards are extremely programatic b/c I use alot of custom CGRect etc.. so I tend to use something like this: -(void)tableView:(UITableView *)tableView

Xcode 7 Could not find a storyboard named

半世苍凉 提交于 2019-12-09 15:53:41
问题 After update Xcode to 7 version, can't build my application. This error is every time when I build in simulator's other versions, and device. After clean project I can run on device, but if I want run again, the error is back. *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle </private/var/mobile/Containers/Bundle/Application/43A262C3-81D4-4CF3-B727-AE670906234E/someexample.app> (loaded)' *** First

Design app that supports both iOS8 and iOS7

大兔子大兔子 提交于 2019-12-09 15:16:12
问题 Suppose I want to design a master detail application, Xcode6 master-detail project template for universal app includes UISplitViewController and splitViewController is new in iOS8. I want to support app for iOS7 also. In general What is the best way to design an universal app using Xcode6 storyboard that support both iOS8 and iOS7 ? Is it better to use separate story board for different OS version ? What are the best practices we should follow to make app compatible with both OS? 回答1: The

NSInvalidUnarchiveOperationException with ContainerView

时间秒杀一切 提交于 2019-12-09 14:50:02
问题 Using a ContainerView with an embed seque I'm getting this: * Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named UIStoryboardEmbedSegueTemplate' My searches didn't provide a lot, so: Does this mean "Sorry, only on iOS6" ? 回答1: Yes, this really seems to be a "iOS 6 only"-feature. I did not see it in iOS 5 either... But didn't find it in the Docs so far. 来源: https://stackoverflow.com/questions/12868255

UIView的常见属性

落爺英雄遲暮 提交于 2019-12-09 14:03:19
//@property(nonatomic,readonly) UIView *superview; //获得自己的父控件对象 //@property(nonatomic,readonly,copy) NSArray *subviews; 获得自己的所有子控件对象 //@property(nonatomic) NSInteger tag; //控件的ID\标识,父控件可以通过tag来找到对应的子控件 //@property(nonatomic) CGAffineTransform transform; //控件的形变属性(可以设置旋转角度、比例缩放、平移等属性) //@property(nonatomic) CGRect frame; //控件所在矩形框在父控件中的位置和尺寸(以父控件的左上角为坐标原点) //@property(nonatomic) CGRect bounds; //控件所在矩形框的位置和尺寸(以自己左上角为坐标原点,所以bounds的x\y一般为0) //@property(nonatomic) CGPoint center; //控件中点的位置(以父控件的左上角为坐标原点) //在UIKit中,坐标系的原点(0,0)在左上角,x值向右正向延伸,y值向下正向延伸 //- (void)addSubview:(UIView *)view; //添加一个子控件view

How to open view controller from didSelectRowAtIndexPath within storyboard?

妖精的绣舞 提交于 2019-12-09 12:46:28
问题 I have a storyboard with tabbarcontroller. One of tab bar has a tableview and I want that when the user tap in a row from tableview open a detail view. The problem is when I open detail view tab bar and navigation bar hides... In the storyboard I create the detail view as a new view controller, then I create a new file and referred it to the class of detail view . The code in didselectrowatindexpath: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {