Suggestions for a Crossword Board [closed] - iphone

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am new to iOS, although I have been with the basics and now I am trying developing a crossword app. Any suggestion where to start.
What problem I am facing the most, is to develop the 15 X 15 checkered board. I thought of two possible solutions -
To put 15 TextFields in each 15 rows, and according to the requirement I am going to disable the textfields and add black background color. But also there are two question, since the a crossword box has a number to the upper left corner, how can I put it? And the second is is it going to affect my performance since there are so many text fields.
Another possible solution I have thought of is coding a the board with CGRect and CGContextAddRect to the specified positions. But I am having problem on how to interact with the CGRect, that is when clicked it will bring up the key board and user can type the letter.
Please help, I don't know to where to start from. Other solutions are also acceptable.

I would suggest a UICollectionView. This is similar to a UITableView but with multiple rows and columns. Each UICollectionViewCell should consist of a UITextField.
For the numbers, you could either do that statically, i. e. you do it in your story board (place a UITextField for each number, the remaining space will be the UICollectionView.
Or (what I would prefer, but requires more logic) you make a 16x16 board and the 0th section and every 0th row in a section will be used for the numbers, the rest is for the actual crossword.

A best way is to use UICollectionView is you are targeting for iOS6+ or AQGridView if targeting older versions. Every cell is eventually a UIVIew.
Having custom textfield might make things complicated. Use UIKeyboard and set delegate as your collection view. In didselectrowAtIndex show your keyboard. Any keyboard delegate will return you character which you can set to Label at that box
There are few advantages for this over textfield approach
1) You can easily customize UIView/UILabel as compared to UITextField.
2) Labels can have custom fonts and attributed strings .
3) It's difficult to hide cursor in UITextField. which shows an editing mode.
Cons: Need Keyboard settings for Label. (However you can overcome with alternative controls like pickerview)
Also, make sure that you don't store any values in your views. Always refresh view from your data-structure (A 2-d array of characters).

Just a grid of views with labels in them should work. You might think its a good idea to be able to enter each character in place but it isn't. The user will have t tap Ana square type, type on another square, type...
So if you use labels you can have a different UI that let's the user enter a string in now go and then you can put the characters int the correct labels.

Related

How should I approach building this 'my messages' mockup - swift [closed]

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 1 year ago.
Improve this question
apologies still relatively new to programming/swift. I've created a concept for a messaging app that has sliding buttons to filter/scroll messages but I can't work out the best way to achieve this functionality, so after some guidance on the best way to approach this.
I've considered:
Hacking a tab bar so it sits along the top (to switch between sent/received views etc)
Using a horizontal scroll view (not sure how to jump between the views using a button)
Using buttons to show and remove views programatically
I'm thinking of showing the individual message tiles using a collection view rather than a table view.
I'm also wondering if the design I've came up with is actually completely wrong as I can't seem to find any UI elements that behave in the way I expected (like the slider switches on my mock) and if I should completely rethink the layout. I'm open to that option if that's the case.
Any help/suggestions welcome!
You're asking a lot of questions - your post should focus on one task. Review How to Ask
But, to give you a couple ideas...
Take a look at UISegmentedControl. Here's an example only slightly customized:
A little searching will show you how to do that, or how to customize it even more (making the round-ends appear more like your mockup).
Below those, you could put two table views in a horizontal UIStackView. When you select a "Received / Sent" segment, animate the stack view to show the corresponding table view.
When you select a segment on the lower control, filter your data and reload the table view.
What you want to do, though, is just get started on it.
Begin with learning about UISegmentedControl and how to customize the appearance.
Then work on putting two views side-by-side and learn about animating their positions.
Then work on filtering your data source.
At each step along the way, if you run into a specific problem/question, come back and make a new post about that issue.

Customising iPhone App Interface [closed]

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
I am building a basic app interface which will have a mixture of text, inputfields and buttons. In order to get a working version for project deadline, I thought I would use the default Interface Builder (IB) components for the first iterations and then if there is suffiecient time, I would like to 'jazz up' the interface by adding customised components..
How easy is it to swap over IB components with customised ones at a later stage?
It depends on what you mean exactly by swap over IB components, but in general I would say that IB has full support for customization of your UI within its own conceptual framework. On the other hand, it is pretty obvious that defining your UI programmatically will give you all the customization possibilities you might think of.
In a sense, you can see IB as a way to declare graphically the elements of your UI, their relationships, and have them automatically instantiated for you when the IB xib file is loaded. This is a very flexible mechanism in itself and allows you plenty of possibilities.
Say, for example, that you have a button somewhere in your IB view. In a first release, you could set the class of that button to a plain UIButton; later, you simply specify that that button class is actually a YourCustomClass and you have it, your UI will use your custom button without you having to change much of code (maybe one line or two apart from the custom button implementation). The same holds true for many other kinds of UI elements.
Besides that case, there are classes, like UITableView, that I think are better customizable outside of IB (i.e., by specifying the customization, e.g., the custom cell, programmatically). But still in this case, having the interface defined in IB in the first place is not a big hindrance either, and you simply add the code that you need to your program.
Anyway, there are some customization that are not easily possible with IB. One example could be having more control on how and when your UI components are allocated; so, say, you are restricted to your xib file to be instantiated all at once, while programmatically you could trick every aspect of that. Or, there might be UI elements that are intrisically better suited for a programmatically definition (say, a scrollable grid of pictures), so IB would not fit the bill, or give little support for that (but you would not be able to define that UI elements with it in the first place).

iPhone - Proper UI controls for calculations

I am pretty new to iPhone development and currently working on an application which includes a view that performs a simple numerical calculation. In particular, the user enters 3 or 4 values into text fields and the view displays the result. Something along the lines of http://www.moneychimp.com/calculator/compound_interest_calculator.htm
What is the nicest way to achieve this? I am currently using simple UITextFields and a UILabel for the result but it doesn't look nice or "native-like". What UI object would be best to use?
Thank you!
It's entirely up to you. You're using the right classes for actual input- it comes down to how you choose to style those classes. I'd suggest looking at the documentation for UIView and CALayer (youView.layer, and include QuartzCore framework in your project).
A good start might be to choose a color scheme, a background for your app, and the look and feel you're shooting for- this will inform your styling. Try looking for apps that you think are elegant and attractive, and boil down what they do and what you like about them.
I'd say;
use a grouped table style (with the white tables with round corners on a blueish striped background)
embed settings values directly in the cell (aligned to the right) as much as possible
you can show a relevant keyboard (text, numbers) or picker view to let the user pick values, directly when they tap the cell. Use sliders and switches where relevant.
You may want to take a look at http://www.inappsettingskit.com/, we are currently investigating it for the same purpose and it seems to do the job
You can use either a UISlider or a UIPickerView if some of your values have limits.
You can use UISwitch for toggles.
You can also switch the default keyboard for your textfields to be numeric.
Other than that you seem to be on the right track.
Also, sometimes putting a view inside a scrollview makes things seem cooler even if its only one page. The auto bounce on scrollviews is kind of cool.

UILabel and images in it [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I would like to show some text with an image. But I would like the text to flow around the image. How can this be done? I've seen I can add views to a label, but I think just adding an image and then text it will not work. Can you point me to the right way please?
The best way to go about this is to create a UI Label for the side of the image, then another UI label below the image - then calculate the height of the first label a word at a time from your original text, once you have gone past the height of the UIImageView put the rest of the text in the bottom UILabel.
If you would like some example code, please email me at kendall.gelner AT kigisoftware.com (I tried to look for a way to email or DM you, but could not find one on this site).
Based on your sample image, this would be a custom object that you would have to create as a subclass of UIImage ..or you could go the easier route just make it as a view in Interface Builder that you add as a subview.
An example of subclassing UIImage would be like creating a helper method:
#interface UIImage (Labels)
- (UIImage*)toSize:(CGSize)size withLabel:(NSString *)label1 andSecondLabel:(NSString *)label2;
#end
but you would have to then implement drawing it all by yourself.
Instead, I would probably say go the route of creating a view in Interface Builder that has:
(1) UIImageView
(6) UILabels
that you can use as a subview and then you'd set them to whatever values like normal in code.
I am not sure, but Three20 is the most powerful project that I have ever seen in Iphone to support text and stylesheet. You may want to take a look

iPhone User Interface Design [closed]

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 4 years ago.
Improve this question
I've just had a nagging question for a while regarding iPhone app user interfaces. For example, consider WeightBot's User Interface. I am wondering, how are most of these user interfaces created? In general, of course.
Is there a way to simply design controls (that is, the images) in a program like Photoshop, then use that 'skin' for controls in UIKit? I realize that there are some controls that are probably created by the programmer (custom controls), but I'm referring to the ready-made ones that come in UIKit.
In other words, is the concept similar to 'splicing' web site designs? Where a designer draws out the design of the website in something like Photoshop, and then it is cut up into pieces which can be applied to form the actual website? I know this can be done for UIButtons, can this also be done for other controls, and is this how it is usually done?
Or perhaps this is done with Core Animation? I've heard this from time to time, so does this mean that the User Interfaces are 'hard-coded'? Or is Core Animation only used for the 'effects', such as applying the glowing effect to the numbers in WeightBot?
If there are any resources you can point me to I would really appreciate it.
I've asked myself the same question and just like you i couldn't find any examples. After playing around i've managed to create a similar control. You can check it out on github http://github.com/kompozer/HorizontalSliderControl
Its very simplistic but i hope you get an idea. Basically its a UIScrollView, not much core animation needed.
I can't think of any written resource about this practice. But you are on the right track about Photoshop. Designers create assets visuals for the different controls in some design app such as Photoshop. Developer then assigns these assets to controls, e.g different states of a button are loaded as images, and maybe text added in code.
Looking at WeightBot UI and the big blue glowing numbers, I can think of two ways doing them:
1) precreate all the digits 0-9 in photoshop, and put them together at runtime (just load UIImageViews into UIView, calculating the sizes and positions at runtime)
2) create the text with something like UILabel and then apply effects to it programmatically at runtime.
Both ways are fine and both have different tradeoffs about app size, code maintenance, developer/designer skill required, performance etc. It is also common to mix these all over the place, especially with something like a fancy background image + text created at runtime on top of it.
You are correct that all of this is quite similar to web slicing and requires you to think about what elementary pieces the interface consists of and how to composit them together.