Think that the first major in the school is. NET, came to the company, immediately into Java development, and then jump to the development of iOS, it is really good ~ ~ Days of accidents, clouds and unpredictable hey, nonsense over,let ' s go~
Newly developed iOS development, has been thinking of a problem, IB can be a graphical design interface, for the hair is not directly to the design of the interface directly reuse it? Baidu a lot, found that most are dependent on the controller to achieve, to set the file Owner, sister's, the elder brother just want to reuse a simple view good, to your sister's controller ah, so then search, the result is no God horse big results, mainly his lazy hands to practice, Today decided to try it yourself, the results can still be returned.
Customize a Xib view,
Then in the place where you want to load the code, I use the swift,oc myself looking at the same
Self.title = "Test" = Nsbundle.mainbundle (). loadnibnamed ("Wsuitableviewforloaddata", Owner:self, Options:nil) = objects.last as wsuitableviewforloaddata = "What's the situation Here" = CGRect (x:0, Y:64, Width:self.view.bounds.width, height:self.view.bounds.height) self.view.addSubview (view)
Command + R, Direct:
Over, you crossing, the text in lb successfully changed, then you can reuse it ~ ~ ~
IOS loads a custom view from Xib