uistoryboard

UITableView “selection” triggered segue

只谈情不闲聊 提交于 2019-12-04 19:25:16
问题 I am using Storyboard and UITableView without UINavigationController . When tapping on any cell, it should bring user to a detail page. I can of course implement didSelectRowAtIndexPath: But I wished to try something fairly different. I want to do it with a storyboard segue . I use prototype cell, and I can simply config a triggered segue on the cell. I can implement prepareForSegue: , but here's the problem, how can I know what cell has been selected? 回答1: The prepareForSegue:sender: method

Xcode cannot find referenced Storyboard using Cocoapods

末鹿安然 提交于 2019-12-04 18:44:02
问题 I'm trying to create a Pod using CocoaPods and I want to bundle a "Demo" Storyboard that I can reference to from the Main Storyboard from my example application. The problem is that Xcode gives me the following compiler error when I do so: Did not find storyboard named "Demo" referenced from Main.storyboard See: In my Podspec, I included: s.resource_bundles = { 'StoryboardAssets' => ['Pod/Assets/*.{storyboard,png}'] } You can find the demo repository that I created using the "Using Pod Lib

How to select background views in a storyboard or xib

£可爱£侵袭症+ 提交于 2019-12-04 16:03:17
问题 If I select a view with my mouse in a storyboard or xib, Xcode will select the front most view. I know that I can select the other views in the document outline, but if I want to grab a background view to move it with my mouse, the front most view gets selected again when I click in the storyboard. I think there is a way to cycle through the views and select the ones in the back by holding down on some keys, but I can't find what it is. Does anyone know? I'm using Xcode 4.6. I know that I can

dynamic UITableView in static UITableViewCell

本小妞迷上赌 提交于 2019-12-04 14:51:35
问题 Following setup causes trouble: In my storyboard I have a standard table view controller, containing a table view with three static cells as content. One of the cells contains another table view with dynamic content and a prototype cell in it. Both table views' delegate and datasource are set to the same table view controller. In the delegate and datasource methods I determine which tableview has called the method and handle the response appropriately. However, if the dynamic table view

Best practice for modifying storyboard auto layout constraints in code?

风流意气都作罢 提交于 2019-12-04 14:39:22
问题 I've always done my UIs in code but have decided that I should use storyboards and auto layout for a current project. Everything had been going well until I built a complex scene with about 50 views with lots of hierarchy and some grid of views. The problem is that my auto layout is getting muddled on some devices and orientations. I'm finding it challenging to use IB to try fixing the dozens (hundreds?) of constraints or to track down the problems and resolve them. The situation is such that

how to apply condition based custom segue in storyboard

混江龙づ霸主 提交于 2019-12-04 13:22:06
问题 i am working on storyboards which has couple of views on first view a condition is placed i want if the condition satisfies then only navigation should happen For this i have used Custom segue but no matter my condition satisfies or not it navigates to new view. I have created method in custom segue class - (void) perform{ NSLog(@"source %@",self.sourceViewController); NSLog(@"dest %@",self.destinationViewController); UIViewController *sVC=self.sourceViewController; UIViewController *dVC=self

How to change speed of segue between ViewControllers

♀尐吖头ヾ 提交于 2019-12-04 12:12:40
Is it possible to control segue speed? I have checked the documentation but there is no given method by Apple. But I am more looking for ideas to hack in and change lower level code to make segueing in slow motion . Below code is of custom segue, and you can set duration of transition in code. - (void)perform { UIViewController *src = (UIViewController *) self.sourceViewController; UIViewController *dst = (UIViewController *) self.destinationViewController; [UIView transitionFromView:src.view toView:dst.view duration:3.0 options:UIViewAnimationOptionTransitionFlipFromLeft completion:NULL]; }

How to move back to the root view controller in storyboard?

谁说我不能喝 提交于 2019-12-04 11:37:57
问题 What I want to do seems pretty simple, but I can't find any answers on the web. I have the login screen as the root view controller and then tab bar controller and in every tab I have a navigation controller. I have used storyboard and the hierarchy is described below, Root VC | --- tabbar controller | ---Navigation Controller | --- VC1 Requirement is to navigate back to the root view controller from VC1. How can we achieve this? 回答1: I got the resolution to the issues using the "Unwind

Child content view controller view has wrong bounds size from Storyboard?

て烟熏妆下的殇ゞ 提交于 2019-12-04 11:03:43
This document outline from my sample Storyboard shows what I'm working with. I have a custom container view controller and two content view controllers connected via embed segues. Here is the storyboard itself. ZetaViewController has to create some programmatic views (within ZetaView, of course). I noticed when I was centering these programmatically created views they seemed really off center. ZetViewController is centering things by examining self.view.bounds.size.height and self.view.bounds.size.width and doing some appropriate arithmetic. When I added debug logging to ZetaViewController, I

How to hide the initial window on start with OS X storyboards

核能气质少年 提交于 2019-12-04 10:43:44
问题 I am creating an OS X status bar application, so I want the application to start hidden . I have created a "storyboard" application, and the initial window always shows up, even if "Visible at launch" is unchecked (was unchecked by default). Note: if I disable " Is initial controller " then the app correctly starts without any window, but my (now orphan) window seems to never be added to the storyboard: var mainWindow = NSStoryboard(name: "Main", bundle: nil)?