storyboard

Using pkrevealcontroller on existing Xcode storyboard

人盡茶涼 提交于 2019-12-21 02:52:05
问题 I am trying to integrate the pkrevealcontroller sliding menu into an existing iOS project that has an existing storyboard with segues, etc. I extended UINavigationViewController and linked my new class to the Nav Controller on the storyboard. In my app delegate I do the following: MainNavViewController *frontViewController = [[MainNavViewController alloc] initWithRootViewController:[[myRootViewController alloc] init]]; UIViewController *rightViewController = [[menuViewController alloc] init];

how to use Objective-C project in my Swift project

南笙酒味 提交于 2019-12-20 20:29:33
问题 Note: I know How to call Objective-C code from Swift, but I don't know below, I want to use this EsptouchForIOS's Demo in my project. The demo is write in OC, it has a storyboard and controller. I want to know how to integrate the demo in my swift project, and use that storyboard and it's controller in my swift project. 回答1: I'll start writing from the very beginning. Suppose you have a project in Objective-C and now you want to continue your project's development in Swift. Follow the below

how to use Objective-C project in my Swift project

筅森魡賤 提交于 2019-12-20 20:29:09
问题 Note: I know How to call Objective-C code from Swift, but I don't know below, I want to use this EsptouchForIOS's Demo in my project. The demo is write in OC, it has a storyboard and controller. I want to know how to integrate the demo in my swift project, and use that storyboard and it's controller in my swift project. 回答1: I'll start writing from the very beginning. Suppose you have a project in Objective-C and now you want to continue your project's development in Swift. Follow the below

How to check if a Storyboard exists in a specific NSBundle

江枫思渺然 提交于 2019-12-20 20:20:09
问题 I'm making an app that makes use of a framework that I'm creating. The framework contains storyboards but in some cases the project making use of the framework will need to override the storyboard by providing a new one. So my goal is to check if a storyboard with a given name exists in [NSBundle mainBundle] , if not then I will get the base version from my framework. I have tried getting the storyboard from the main bundle and checking for the result being nil but it throws an exception if

How To Add Dynamic Font Size about Multi Device in Xcode Story Board

柔情痞子 提交于 2019-12-20 15:32:44
问题 I added autoLayout in storyBoard (w: Any, h: Any) But because of fixed font size, The font size is same in all of devices (4, 4.7, 5.5 inch) It looks nice in 4 inch. But in 5.5 inch, That's too small I want to dynamically inclease and decrease UIlabel font size in any devices. Any Ideas? 回答1: I Found Solution I Made one Class class UILabelDeviceClass : UILabel { @IBInspectable var iPhoneFontSize:CGFloat = 0 { didSet { overrideFontSize(iPhoneFontSize) } } func overrideFontSize(fontSize:CGFloat

Launching a login view before the tab bar controller is displayed

我们两清 提交于 2019-12-20 15:23:11
问题 I have an ios5 app developed using storyboards that currently displays a tab bar controller view on initial launch. I would like to display a login screen before the tab bar controller is displayed. The user would enter his username & password, the system would then authenticate the user and then if successful, display the tab bar controller. I have tried the following 3 options with no luck.. any ideas ? (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:

自定义UITableViewCell

本小妞迷上赌 提交于 2019-12-20 14:07:49
自定义UITableViewCell有三种方式自定义单元格: XIB Storyboard 代码 注意: 通过XIB或者Storyboard自定义单元格时,需要指定单元格的可重用标示符 如果使用XIB方式,需要在viewDidload方法中,注册XIB文件 UINib *nib = [UINib nibWithNibName:@”bookCell" bundle:[NSBundle mainBundle]]; [self.tableView registerNib:nib forCellReuseIdentifier:@”cell"]; UITableView性能优化补充 1. 在Storyboard中直接自定义单元格会注册单元格原型 2. 用XIB方式自定义单元格需要注册NIB UINib *nib = [UINib nibWithNibName:@”bookCell" bundle:[NSBundle mainBundle]]; [tableView registerNib:nib forCellReuseIdentifier:@”cell"]; 3. 用代码方式自定义单元格需要注册类 [tableView registerClass:[MyCell class] forCellReuseIdentifier:CellIdentifier];

Storyboard: Dismissing Popover using delegate/protocol method

限于喜欢 提交于 2019-12-20 12:26:40
问题 I've read tons of stuff on this and while most seems to be in regards to the non-storyboard approach, I thought I had pieced bits together and figured it out. However, the following code does not result in my popover being dismissed. The dismissPopoverButtonPressed button in the Popover executes but a breakpoint in the dismissPopover method in the delegate never hits. Would very much appreciate someone casting an eye over the code to spot mistakes. Thanks In the following,

Xcode won't show my textfield placeholder text in storyboard

痴心易碎 提交于 2019-12-20 11:15:49
问题 When I assign my textfield's placeholder value in the attributes inspector, it won't show in the storyboard, however, when I run a simulator of the application is is there. Is there a setting I'm missing? I just want to be able to see the placeholder text in the editor. Below is a screenshot of xcode and one of the simulator 回答1: I am having the same issue, fortunately I run a MacBook with Xcode 9.1(9B55) and an iMac with Xcode 9.2(9C40b) On my MacBook all placeholders show up but on iMac

What is the proper way to dismiss a modal when using storyboards?

孤街醉人 提交于 2019-12-20 11:00:12
问题 Using storyboards, what is the proper way to dismiss a modal? using IBAction and writing code to dismiss after a button click? using segue and notify the parent view controller after a button click? 回答1: See Here Dismissing a Presented View Controller about halfway down When it comes time to dismiss a presented view controller, the preferred approach is to let the presenting view controller dismiss it. So you should use an IBAction and writing code to dismiss after a button click 回答2: