Interface Builder Tips/Tricks Useful for a Beginner [closed]

≯℡__Kan透↙ 提交于 2019-12-18 09:47:48

问题


What are some useful tips/tricks for Interface Builder that would be relevant for a beginner?


回答1:


Here is the greatest tip ever in all of iOS programming. It takes everyone bloody years to figure this out.

Open something in IB. Now click on say a view - that's a UIView - in your xib.

Now open up the inspector. If you do not know how to do that yet, use the "Help - Search' menu item and type in "Inspector".

So you are looking at the inspector, for your UIView.

the inspector has FOUR (count them) panels. Click on the RIGHT-MOST panel which has a little "i" symbol in a circle.

NOW LOOK AT THIS - at the extreme top right it will show you the Class of the UIView. OK, so it just says "UIView". So now you're saying to yourself, big deal.

But note, that is exactly where you CHANGE the class. That's it! The most important functionin all of human science and engineering! If YOU have made a new subclass of UIView (say "YourClassyView") ... THAT IS WHERE YOU CHANGE IT!!!

Change the object in IB from being a normal boring UIView, to your YourClassyView, right there!

That's a big secret, hope it helps.



来源:https://stackoverflow.com/questions/4262182/interface-builder-tips-tricks-useful-for-a-beginner

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!