Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have start programming a simple game. I don't use sprite Kit because it's very simple to use sprite Kit. But I have a problem with the levels. For now I'm using a lot of UIviews for levels, if level 1 is completed the next UIView with the second level is shown. Are UIViews a good idea for Levels ? Or is there a better way to add levels in simple game ?
It's rather a very bad idea to use UIViews as adding subviews and removing them can make your game sloppy. Instead what you should do is create a new ViewController and according to the levels you can set the level and other properties in the prepareForSegue method. I am listing some links here which will help you to learn about the topics :
Multiple ViewControllers
Segues
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i want to ask about the methode used to reload a sorted table view instead of reloading the normal one using swift. I know that I have to use the segmented control to represent the categories in the table but what is the logic how is the code ?
I put a picture showing what I mean
Edit: my question was about using two table views in one view controller in swift with segmented control that is used to display the first table when the 0 segment is clicked and the second table when the 1 segment is clicked and I found the answer for any one interested :
1- add two table views to your view controller.
2- make one of them hidden.
3- in viewDidLoad func load both tables and fill their cells.
4- use the segment control to change the hidden property of the first table to true while the other table is false when the first segment is selected and vice versa when the other segment is selected.
hope that helps.
try:
segmentControl create in new UIView and self.tableView.tableHeaderView = newView on viewDidLoad() method.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
A quick one - I know that this has been asked a number of times but I can't find the answers on here. I have started a new project in Xcode and when I resize objects they resize from the other side of themselves, the controller moves with it etc. I know it is a simple setting somewhere but I can't find it - any helpers?
Your view controller is probably has auto layout enabled. When you resize one view, the others are resized according to their constraints.
To turn off auto layout: Select the view controller in IB, and in the properties pane on the right, open the first tab, and uncheck the Auto Layout checkbox.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
This is a newbie question!
How to Create And Display a Custom Sheet in Cocoa? (like "Add Bookmark" sheet in Safari - see below)
What are the steps involved in the task?
How to accomplish each step?
Can you point out a good step-by-step article?
alt text http://grab.by/2oWw
All you need to do is make a nib file containing an NSWindow that you want to use as the sheet, and load it up. Check out Using Custom Sheets in the docs.
NSApplication has a method to let you load the sheet up:
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo:
This page has some more information and what I'd consider an easier way to set up the sheet - making it a panel or window inside the same nib file as your document window.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
What are some uncommon or "hidden" features of Interface Builder you wish you would have known about when first learning Xcode + Interface Builder?
Edit:
Xcode specific tips here.
This question is specifically concerned with the GUI and not so obvious features of Interface Builder. And only tangentially related to Xcode.
Sometimes it gets quite difficult to select an interface element that's buried in a deeply nested hierarchy of other elements (like a cell in a table column in a table view in a scroll view in the content view of a window).
Pressing shift while right-clicking on a view displays a nicely sorted stack of items to select.
You can use the mouse to measure the distance in pixels between interface elements: Select an element, like a button, then hover the mouse over another element and press option. This also works for subviews, like scrollers in a table view.
After customizing a view or building a view hierarchy you can drag that view back to the library to save it in the current state. You give it a name and description. It will show up in a "Custom Objects" section and can be reused in other nibs.
I only found the Xcode User Defaults Reference the other day. It has a good number of things not available in the preferences UI.
Interface builder has plugin architecture for custom views.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to create analog of program conky. What is the best way to draw information on a OS X desktop?
NSWindow has a method, setLevel:, that lets you control how the window is positioned compared to other windows. From my own experience, you might want to try feeding it kCGDesktopIconWindowLevel, and calling setHasShadow:NO to implement the look you want. To actually do the drawing you would put a custom NSView subclass in your window, and create the window without a frame (see NSBorderlessWindowMask) and transparent ([window setBackgroundColor:[NSColor clearColor]], [self setOpaque:NO];).
You might also want to take a look at this article to keep your window pinned to the desktop during an Expose event.
Have you tried GeekTool? Maybe you don't even have to write the app. ☺
You need to take a look at using NSWindowLevel with a transparent window.