xib

What's the difference between custom class and file's owner setting in xib file?

99封情书 提交于 2019-12-03 06:20:59
问题 In a custom xib file, what's the difference between the two following setting methods shown in the images below? 回答1: please check this link : What is the File's Owner (in Interface builder)? confused difference between Custom Class for an Object and for the File's Owner and steps via IB in first screen shot : you should set the custom class of your View . and in the second screen shot ( files owner ) you can Set the file's owner to your UIView subclass so that you can connect outlets to it

Cocoa app without a MainMenu.xib

不打扰是莪最后的温柔 提交于 2019-12-03 05:46:31
For iOS (Cocoa Touch), it's possible to go to your main.m and replace the fourth argument in UIApplicationMain(int argc, char *argv[], nil, nil) with the class name of your app's delegate, which would then construct the views as needed. However, Cocoa (Mac) projects have the following in main.m: return NSApplicationMain(argc, (const char **)argv); So the question is basically: how do you hand over an app's delegate to Cocoa apps without a MainMenu.xib? You can use setDelegate method of NSApplication instance. Here is a sample: AppDelegate * delegate = [[AppDelegate alloc] init]; [

“Also create xib file” button disabled

无人久伴 提交于 2019-12-03 05:14:51
I have this problem with creating UIView's subclasses. Creating, for example, UIViewControllers or UITableViewCells is okay. Why this happens? I create view using cmd+N and Xcode Version 7.3.1: You can add custom Xcode template that will fix this issue or add an existing template. Read more how to create and add it to Xcode here . Template can be found here . Create the View and the Cocoa Touch Class separately, but with the same name, then set the Class of the xib to the name of the file. Yes as per @PRECover, the xib check mark button is disabled always to help you more I am describing the

Segue from Storyboard to XIB

别等时光非礼了梦想. 提交于 2019-12-03 01:47:29
I have a storyboard View Controller, which is the first screen in my app. The rest of the app is designed with xib's. I want to segue from a button in the storyboard's VC to a XIB file. I know how to do this from a xib to storyboard, but how about this ? Thanks in advance ! yasirmturk From xib to storyboard UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil]; UIViewController *initViewController = [storyBoard instantiateInitialViewController]; then [self.window setRootViewController:initViewController]; or [self.navigationController

How To: Self-Sizing Custom-View from XIB with StackView View in iOS

左心房为你撑大大i 提交于 2019-12-03 01:24:10
I've recently started diving into iOS development with Swift again and am now looking into a custom UIControl. For layout and flexibility this custom view is built using a StackView. What I want to achieve ... ... is basically to simply have the same functionality with the StackView that I usually have when I drag it directly into the storyboard - where it resizes to fit no problem. This essentially the same as self-sizing tableview cells. Showcase I can reduce my CustomView to a simple example: It's a StackView with three labels in it, Alignment set to Center , Distribution Equal Centering .

XIB File opens like an XML in XCode but opens correctly with Interface Builder

你离开我真会死。 提交于 2019-12-03 01:03:45
When I double-click my file StartWindow.xib in Xcode 4, it does not open into the integrated Interface Builder; it opens like a XML file. I can open all other xib files and they display as expected. I can open it with the old Interface Builder via "Open with". What can I do to open it with the integrated Interface Builder? Go to the File Inspector after selecting the nib file. Under Identity and Type , select the drop down list for File Type and choose the topmost element Default - com.apple.... Had this happen to me awhile ago. I had to go to File -> Close myfilename.xib and then reopen it

Cell from Xib with Swift 3

僤鯓⒐⒋嵵緔 提交于 2019-12-02 23:33:59
I already read and saw some videos about this subject but i can't get this to work. Im trying to a cell from a xib instead of the storyboard. This is my ViewController (where i have the Table View). import UIKit class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { @IBOutlet var tableView: UITableView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } func

How to add new xib files

半腔热情 提交于 2019-12-02 23:19:29
I have to develop an app with multiple screens. I have automatically generated xib file, but for my other screen I need another xib file. How do I create another xib file? (Assuming XCode 4) In the "File -> New File..." menu dialog, there is a subsection called "User Interface." You will notice in the description of each of the sub-items, it says "An Interface Builder Document." Those are various types of nibs. If you're creating a new ViewController specifically, you can also choose the "Cocoa Touch" section and select the "UIViewController subclass" item. There is a checkbox in the next page

Show view from bottom with options

匆匆过客 提交于 2019-12-02 23:00:00
问题 When I navigate to a certain viewcontroller, I want a view from bottom with options like so... How can I have such a view...? EDIT 1 I have tried to achieve as suggested in the link using a tableview instead of collection view. And this is what I have... And dragging down the view gives me this view... But I come to the view, I don't want the slide up view to cover the entire length of the view, but it should only be of the same size as given in the 1st screenshot. How can I achieve that..?

How to disable Interface Builder document versioning from auto updating?

為{幸葍}努か 提交于 2019-12-02 21:44:05
This question is still getting a lot of upvotes. So look at Update3. once you have upvoted, commented, answered, please please please file a radar Viewing a nib / xib, modifies the file, forcing me to either commit the change or undo the change. This is not an issue, until there are merge conflicts. Detail: I work in a team of 5 iOS developers, and the last few versions of XCode, we are experiencing an issue with the .xib / nib files getting touched / modified when anyone opens the file (without making any changes). If one developer thinks "screw it, let me checkin whatever modifications xcode