xib

How to create project without story board in xcode 6 (swift)?

假装没事ソ 提交于 2019-12-04 17:31:50
Can any one has practiced creating project in xcode6 (swift) without storyboard. I am able to implement func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool { // Override point for customization after application launch. self.window = UIWindow(frame: UIScreen.mainScreen().bounds) self.window!.backgroundColor = UIColor.whiteColor() self.window!.makeKeyAndVisible() var viewController: ViewController? = ViewController(nibName: "ViewController", bundle: nil) self.navigationController = UINavigationController(rootViewController:

Loaded nib but the view outlet was not set - Swift edition

99封情书 提交于 2019-12-04 16:52:43
问题 I have a project that is all in Objective C, except for my view controller, which is in Swift. When I run it, i get the error Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "..." nib but the view outlet was not set.' So I opened up my nib file, look at "File's Owner", and I see that the view does not even show up as an outlet at all. For my old view controller (objective c), the view outlet

How to auto size UITableViewCell with underlying WKWebKit, so it respects the content of the web view?

梦想与她 提交于 2019-12-04 16:08:00
In my iOS app I want to display several items that contain some HTML. For this I've build a NewsListViewController that contains a UITableView . For that UITableView (outlet: newsListTableView ) I created a custom UITableViewCell called NewsTableViewCell that will be load into it via delegates. The NewsTableViewCell holds a WKWebKit control that will display my HTML. This is my code: NewsListViewController.swift import UIKit class NewsListViewController: UIViewController { @IBOutlet weak var newsListTableView: UITableView! override func viewDidLoad() { super.viewDidLoad() self

Instantiate view from nib throws error

人走茶凉 提交于 2019-12-04 15:56:43
问题 I tried to make @IBDesignable UIView subclass following this (link) tutorial. First custom view goes fine. But when I try to make another one, I have errors. First I got failed to update auto layout status: the agent crashed and Failed to render instance of ... . Somehow I started to be able to biuld and run project with these errors, but then I get new error - EXC_BAD_ACCESS ... on line let view = nib.instantiateWithOwner(self, options: nil)[0] as! UIView . Here is whole method: func

Load (and display) a .XIB from the web

南笙酒味 提交于 2019-12-04 15:11:34
I want to be able to download (via a NSURLConnection request) a .XIB file, and have it presented in a view. I have implemented the NSURLConnection, and surely enough, when the connection completes, I am left with a NSString of XML data representing the XIB file. Example: (just the first few lines of many) <?xml version="1.0" encoding="UTF-8"?> <archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10"> <data> <int key="IBDocument.SystemTarget">800</int> <string key="IBDocument.SystemVersion">10D573</string> <string key="IBDocument.InterfaceBuilderVersion">762</string> <string

UIPopViewController not working

时光毁灭记忆、已成空白 提交于 2019-12-04 14:19:07
问题 I have an xib file with a .h and .m linked. In the xib there is a UIView with a textView. What I would like to do with that view is open it as a UIPopViewController when you click a button. Here is my code: - (IBAction)thisButton:(id)sender { popViewController *popVC = [[popViewController alloc] initWithNibName:@"popViewController" bundle:nil]; self.pop = [[UIPopoverController alloc] initWithContentViewController:popVC]; [self.pop setPopoverContentSize:CGSizeMake(220, 120) animated:YES];

Unable to load two nib (.XIB) for Single ViewController class in Xcode 4.5 [duplicate]

末鹿安然 提交于 2019-12-04 13:59:00
This question already has an answer here: iOS: Using device modifiers for loading xib files? 4 answers Trouble with loading a separate XIB for iPad or iPhone 3 answers Sorry Guys in advance, I know there are already plenty similar questions are available. I tried all solutions but didn't work any of them for me. I'm Using Xcode 4.5.2 and using two xibs for iphone5/ios6 1> RootViewController5 and for all other devices 2> RootViewController these both nib file has single ViewController named RootViewController .In both the nib file's File owner I have selected RootViewController class in Custom

Show ViewController from XIB-file-Button - Swift

柔情痞子 提交于 2019-12-04 13:42:13
问题 is there a way how to segue from a xib-file (custom TableViewCell) to another ViewController in the Main.storyboard. There's no possibility to drag a segue, like within the main storyboard. In the cell I've got a button, from where I want to change the view. How can I solve it? Thanks! 回答1: You can always instantiate a view controller from your Storyboard and present it on button tapped: let storyboard = UIStoryboard(name: "Main", bundle: nil) let vc = storyboard

Best pratice between storyboard xib/nib pure programming [closed]

允我心安 提交于 2019-12-04 13:12:15
Closed . This question is opinion-based. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it can be answered with facts and citations by editing this post . Closed 6 years ago . Being new to ios programming, I started of course with storyboard then I have read that it has its limitation when multiple developer comes to work on the same app, so I switched to pure code. But I guess xib / nib might be a good compromise. Can you give me a more mature point of view? Thanks a lot for your lights I'd vote against using storyboards. They're just

adding a custom view to a alert view

我只是一个虾纸丫 提交于 2019-12-04 13:03:00
问题 i have a problem like this: i want to show a customized view inside a alert view. so i create a separate xib file and designed my interface.and implemented the class for it too.but when i apply below code,it gives me an error. this is the code : UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Confirm your Action" message:@"Click OK to confirm" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Cancel",nil]; NSArray *subviewArray = [[NSBundle mainBundle] loadNibNamed:@