xib

Xcode 4 and Interface Builder: Editing Vertical Spacing Constraint (Anchor Top, not Bottom)

谁都会走 提交于 2020-01-21 04:31:20
问题 I've got a widget that is not laying out correctly on device (its looks OK in IB, but its not quite right). The widget is a label and its located about mid-screen. Interface Builder gave it a Vertical Space Constraint with a 'Bottom Anchor'. Here, bottom means bottom of the screen (rather than a widget below, or anchor to top screen). I'm in the inspector, but I don't see how to change to a top anchor (preferably, to the widget above). I tried reading Apple's docs and Editing Constraints in

How to create custom pin annotation view

萝らか妹 提交于 2020-01-17 14:51:48
问题 I have a map I'm populating with a list of food trucks, and I'd like to implement a custom callout like the one shown below, when an annotation is selected. Currently I have the standard annotation callout implemented with a title and subtitle. I've done some reading and am guessing it'll require a custom .xib file, but I don't really know anything about this as I only started developing for iOS as a recently. How would I go about creating this custom popup, and how can I make it perform a

How to add a UITableView as a subview to a UIView in xib?

可紊 提交于 2020-01-17 04:15:27
问题 I have a custom view that I built using xib file. In this custom view, there is a UIView where I would like to add a static UITableView as a subview. The UITableView to be shown here is present on the storyboard and associated to a UITableViewController . I did the following: let vc = (UIStoryboard(name: "Main", bundle: nil)) .instantiateViewControllerWithIdentifier("tableController") as! TableController vc.loadViewIfNeeded() table = vc.table // this is an outlet, I'm sure it is not nil table

How to add a UITableView as a subview to a UIView in xib?

空扰寡人 提交于 2020-01-17 04:15:14
问题 I have a custom view that I built using xib file. In this custom view, there is a UIView where I would like to add a static UITableView as a subview. The UITableView to be shown here is present on the storyboard and associated to a UITableViewController . I did the following: let vc = (UIStoryboard(name: "Main", bundle: nil)) .instantiateViewControllerWithIdentifier("tableController") as! TableController vc.loadViewIfNeeded() table = vc.table // this is an outlet, I'm sure it is not nil table

Swift - Connect Delegate to Custom Xib Cell

a 夏天 提交于 2020-01-15 05:04:02
问题 [SOLVED] Solution When created a Xib File , I hadn't deleted the start UIView. Whereas I had to delete this view and after add new CollectionViewCell in this xib. Reference: IBAction inside UITableViewCell not called in iOS 9 I use this structure so many times.When I write this delegate with using StoryBoard , it works properly but now it's not. Where is my mistake when use the xib files? print(indexpath) doesn't work! import UIKit class SearchVC: UIViewController { var searchUid:String? var

MainWindow.xib for ipad and iphone

点点圈 提交于 2020-01-14 05:47:08
问题 I am trying to build on this demo which contains both a MainWindow.xib and a ImageManipViewController.xib . But my app contains the following code in the AppDelegate.m and my app does not (yet?) contain a MainWindow.xib. Is it better/best for me to add 2 MainWindow.xib files (one for iPhone and one for iPad) too (that are called in my method, each calling its own xib file) or is are the MainWindow.xibs just extra? (Btw, if it turns out that the answer is that the MainWindow.xibs are redundant

How to make a custom MKAnnotationView with XIB

白昼怎懂夜的黑 提交于 2020-01-14 01:36:07
问题 I want to have a custom MKAnnotationView. I've created a xib file in IB and set its class to MyAnnotationView. class MyAnnotationView: MKAnnotationView { override init(annotation: MKAnnotation?, reuseIdentifier: String?) { super.init(annotation: annotation, reuseIdentifier: reuseIdentifier) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } @IBOutlet weak var textLabel: UILabel! @IBOutlet weak var busIcon: UIImageView! } Here's how the xib looks

Migrating project to Xcode 7.2 on OS X El Capitan breaks the build

我们两清 提交于 2020-01-13 02:16:12
问题 I was running OS X Mavericks before with Xcode 7.1, I just updated to OS X El Capitan and Xcode 7.2. My app was launching fine on the simulator and device without any kind of warnings for storyboard. Now I see a bunch of warnings for missing constraints in storyboard and the app crashes with this error: Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named IBNSLayoutConstraint' I also tried the solution posted on here :

Load custom UIView with XIB from a View Controller's view using IB

China☆狼群 提交于 2020-01-12 07:58:30
问题 I have a custom UIView ( MyCustomUIView ) which is built using Interface Builder. I'd like to place this custom view in MyViewController 's view, which is also designed using IB. I've placed an UIView as a subview in MyViewController 's XIB and set it's class to MyCustomUIView . The problem is, when I run the code, only a blank view appears. (When I instantiate MyCustomUIView in code, it displays well.) I'm only overriding the initWithFrame: method the following way in MyCustomUIView.m : -

iPhone UINavigationController inside UIViewController

假如想象 提交于 2020-01-10 20:12:04
问题 Steps: List item Create a project called Nav. Create a new UIViewController BaseViewController (with XIB) and FirstViewController (with XIB). In the NavAppDelegat.h define baseController variable @interface NavAppDelegate : NSObject <UIApplicationDelegate> { BaseViewController *baseController; } @property (nonatomic, retain) IBOutlet BaseViewController *baseController; In the NavAppDelegat.m add baseController to the window: @synthesize baseController; (BOOL)application:(UIApplication *