Mac Cocoa |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Nov 12, 2008 9:20 pm Post subject: Controls & Widgets |
|
|
MF - Programmatically creating GUI's in Cocoa?
"Take a look at the GNUStep tutorials. They do a pretty good job at basic
interface building through the API." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun Jan 04, 2009 4:07 am Post subject: |
|
|
SO - Adding Date Picker to view programatically?
"Try the UIControls example provided in the iPhone SDK sample code. That
shows you how to add almost any control programatically." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun Apr 05, 2009 5:02 am Post subject: |
|
|
Apple Discussions - flaky hit detection, especially of the info button
"Has anyone experienced flaky hit detection of the info button in their ap-
plications using the "main view/flip side view" template." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Mon Apr 06, 2009 3:16 pm Post subject: |
|
|
Just show me how to do it! - iPhone SDK Examples
"This site is meant for the relatively new iPhone Developer who just wants
simple examples to common tasks."
Anothere take at the "Info button" case:
"Increase the touchable area on the Info button, so it's easier to press." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Mon May 18, 2009 2:16 pm Post subject: |
|
|
chris-software - Creating a nice glass buttons
"There is a simple way to achieve results similar to the Stopwatch application.
All you have to do is to get rid of UIButton and use UISegmentedControl." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue May 26, 2009 12:06 am Post subject: |
|
|
iphonedevsdk.com - What does "Auto-enable Return Key" mean in IB?
"For a UITextField, what does "Auto-enable Return Key" mean in the
Interface Builder's "Text trait's" section for configuring the text field?" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat May 30, 2009 4:45 pm Post subject: |
|
|
iPhone Development Blog - How To Create A Data Entry Screen
"One of the more tedious things in iPhone development is to create functi-
onal data entry screens. The challenge is to fit the necessary text fields on
the screen and deal with the keyboard that pops up and covers roughly h-
alf the screen. There is surprisingly little support for this in the SDK."
Code: | - (NSArray *)entryFields {
if (!entryFields) {
self.entryFields = [[NSMutableArray alloc] init];
NSInteger tag = 1;
UIView *aView;
while (aView = [self.view viewWithTag:tag]) {
if (aView && [[aView class] isSubclassOfClass:[UIResponder class]]) {
[entryFields addObject:aView];
}
tag++;
}
}
return entryFields;
} |
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat May 30, 2009 6:28 pm Post subject: |
|
|
osmorphis - A General Purpose Table Form Editor
"The TableFormEditor class is intended to be used within a UINavigation-
Controller. In other words, you allocate a TableFormEditor instance, configu-
re it, then push it on top of the navigation stack.
The TableFormEditor will create a grouped table and the first section will con-
tain rows with UITextField objects to display and allow editing of data. These
rows can optionally contain labels that identify what each row represents, or
you can have no labels..." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Wed Sep 30, 2009 5:57 pm Post subject: |
|
|
SO - iPhone Style Buttons
"Is there a standard/accepted way of making image buttons the “iPhone”
style? i.e. with the gloss highlight and rounded corners." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Mar 29, 2010 1:30 am Post subject: |
|
|
Jeff LaMarche - Irregularly Shaped UIButtons
"You probably know that UIButton allows you to select an image or back-
ground image with alpha, and it will respect the alpha." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed May 19, 2010 12:44 am Post subject: |
|
|
Jeff LaMarche - Programmatic Gradient Buttons
"All you have to do is override three methods to specify the gradient to use
when the button is in its normal state, the gradient to use when the button
is in highlighted (pressed) state, and the corner radius. Here's what the al-
ert-style button looks like now..." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun May 23, 2010 9:16 pm Post subject: |
|
|
Jeff LaMarche - Gradient Buttons Yet Again
"I added two more button styles to the iPhone Gradient Buttons project and
made stroke color and stroke weight configurable options. The two new
styles look exactly like the old Black and White style, only the highlight state
is a blue gradient." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Tue Jun 08, 2010 4:30 pm Post subject: |
|
|
MF - iPhone 4 - Retina Screen Implications
"In some of our apps some buttons are pre-rendered (including the
text) and some are native... so I'm thinking - This will look a bit odd
on the iPhone 4". |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Oct 11, 2010 10:25 am Post subject: |
|
|
so - iPhone SDK: Creating a big, red UIButton
"Using the iPhone SDK, how would I go about creating a red "delete" button
similar to the one used when deleting contacts on the iPhone? Anyone have
a green one?" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Nov 11, 2010 5:25 pm Post subject: |
|
|
MF - Custom Button Image Sizes?
"What is the image size needed to add a custom image to a round rect button
for Mac? Are there default back, forward, and refresh buttons similar to what
iOS has?
...
Go here, then scroll down..." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Mar 08, 2011 9:52 pm Post subject: |
|
|
so - How to correctly subclass UIControl?
"The key is to listen for both the sender and the event so that you can find
out more information about the actual event (such as the location of where
the event occurred)." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Wed Oct 16, 2013 3:30 pm Post subject: |
|
|
infragistics.com - Using CAShapeLayer to Create a Switch
"CALayers are extremely powerful for rendering primitives and geometry,
then animating out changes to the geometry or visual properties such as
color. In this blog post we'll expand on the flat indicator view post that uses
a CAShapeLayer to create a switch similar to UISwitch found in iOS 7." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Dec 21, 2018 12:22 pm Post subject: |
|
|
github - Re-Engineering UISwitch
"You often see non-native control elements in these designs. Some, such as
checkboxes, have no native counterpart in UIKit while others like switches are,
except they're nearly impossible to customize. You cannot even change the size
of a UISwitch. What if you need to implement a completely custom designed
switch for your app. Where would you start?"
https://medium.com/@nathantannar4/re-engineering-uiswitch-9a82f270edfd |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Sun Mar 10, 2019 1:17 pm Post subject: |
|
|
https://instabug.com/blog/creating-ui-elements-programmatically-using-purelayout/
Creating UI Elements Programmatically Using PureLayout
Welcome to part two of Creating UIViews Programmatically Using PureLayout. In the first part, we built a simple mobile application's UI completely in code without the use of Storyboards or NIBs. In this tutorial, we will cover some of the most used UI elements in all applications:
UINavigationController/Bar
UITableView
Self-sizing UITableViewCell |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Fri Nov 01, 2019 2:52 pm Post subject: |
|
|
How to implement a down arrow / caret (like in the iOS 9 Music app) in an iOS Swift project?
Code: | let workout = NSMutableAttributedString(string: "Workout", attributes: [NSFontAttributeName: UIFont(name: "Verdana", size: 14)!])
let arrow = NSMutableAttributedString(string: "\u{2304}", attributes: [NSFontAttributeName: UIFont(name: "Verdana", size: 37)!])
let combination = NSMutableAttributedString()
combination.append(workout)
combination.append(arrow)
sender.setAttributedTitle(combination, for: .normal) |
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Sun Dec 26, 2021 7:04 pm Post subject: |
|
|
Kuba Suder's blog - A guide to NSButton styles
"The list below describes the button styles in the same order as in the Xcode
panel, and for each button it includes: the Xcode name, the constant name,
screenshots of how it looks on Yosemite (on the left) and on Mavericks (on the
right), and some guidelines I found about how it's supposed to be used, or how
it's actually used by Apple in their apps." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Sun Jul 30, 2023 7:17 pm Post subject: |
|
|
so - How to determine whether an NSSearchField/NSTextField has input focus?
"AppKit uses a 'field editor' (which is an NSTextView) to handle the actual
editing in an NSTextField (or an NSSearchField or an NSSecureTextField).
While your text field has keyboard focus for its window, it has the field editor
as a subview, and the window's first responder is the field editor.
So in general, you can check whether the text field has a field editor:"
Code: | if textField.currentEditor() != nil {
// textField has the keyboard focus
} else {
// textField does not have the keyboard focus
}
|
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Sun Jul 30, 2023 7:49 pm Post subject: |
|
|
so - Focus a NSTextField
a) [yourTextField becomeFirstResponder];
b) [[self window] makeFirstResponder:[self yourTextField]]; |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3049 Location: Europe
|
Posted: Mon Aug 21, 2023 4:53 pm Post subject: |
|
|
so - Cocoa: How to make multiline NSTextField?
"There is no way to specify this behavior solely in Interface Builder. You can
do it with a delegate message as described in this tech note QA1454."
Code: | if (commandSelector == @selector(insertNewline:)) {
// new line action:
// always insert a line-break character and don't cause the receiver to end editing
[textView insertNewlineIgnoringFieldEditor:self];
result = YES;
} |
|
|
Back to top |
|
|
|