Overview
Extension methods for NSString.
Instance Methods | |
(NSString *_Nonnull) | - trimWhitespace |
Trim whitespace from the string More... | |
(BOOL) | - isEqualToStringCaseInsensitive: |
Do a case insensitive compare More... | |
(CGSize) | - sizeWithFont:constrainedToSize: |
Find the size of the string More... | |
Instance Method Documentation
◆ trimWhitespace()
- (NSString * _Nonnull) trimWhitespace |
Trim whitespace from the string
- Returns
- Trimmed string
◆ isEqualToStringCaseInsensitive:()
- (BOOL) isEqualToStringCaseInsensitive: | (NSString *_Nullable) | s |
Do a case insensitive compare
- Parameters
-
s String to compare to
- Returns
- YES if equal
◆ sizeWithFont:constrainedToSize:()
- (CGSize) sizeWithFont: | (UIFont *_Nonnull) | font | |
constrainedToSize: | (CGSize) | size | |
Find the size of the string
- Parameters
-
font Font to use size Size to constrain to
- Returns
- Text size
Overview
Extension methods for NSTimer.
Class Methods | |
(NSTimer *_Nonnull) | + scheduledTimerWithTimeIntervalUgi:repeats:block: |
Create a timer to run a block repeatedly – added in iOS 10, so added "Ugi" to the name to not clash More... | |
Instance Method Documentation
◆ scheduledTimerWithTimeIntervalUgi:repeats:block:()
+ (NSTimer * _Nonnull) scheduledTimerWithTimeIntervalUgi: | (NSTimeInterval) | seconds | |
repeats: | (BOOL) | repeats | |
block: | (nonnull void(^)(void)) | block | |
Create a timer to run a block repeatedly – added in iOS 10, so added "Ugi" to the name to not clash
- Parameters
-
seconds Internval between runs repeats YES to repeat block Block to run
- Returns
- The timer
Overview
Extension methods for UIColor.
Class Methods | |
(UIColor *_Nonnull) | + colorFromHexString: |
Make a color from a hex string More... | |
Instance Methods | |
(UIColor *_Nonnull) | - moreTransparent: |
Make a color more transparent More... | |
(UIColor *_Nonnull) | - lighten: |
Make a color lighter More... | |
(UIColor *_Nonnull) | - darken: |
Make a color darker More... | |
(double) | - luminance: |
Get the perceived luminance of a color More... | |
(NSString *) | - toHexString |
Convert color to a hex string. More... | |
Instance Method Documentation
◆ colorFromHexString:()
+ (UIColor * _Nonnull) colorFromHexString: | (NSString *_Nonnull) | hexString |
Make a color from a hex string
- Parameters
-
hexString The string
- Returns
- New color
◆ moreTransparent:()
- (UIColor * _Nonnull) moreTransparent: | (float) | degree |
Make a color more transparent
- Parameters
-
degree Degree to make the color more transparent
- Returns
- New color
◆ lighten:()
- (UIColor * _Nonnull) lighten: | (float) | degree |
Make a color lighter
- Parameters
-
degree Degree to lighten: 0 = white, 1 = no change
- Returns
- New color
◆ darken:()
- (UIColor * _Nonnull) darken: | (float) | degree |
Make a color darker
- Parameters
-
degree Degree to darken: 0 = black, 1 = no change
- Returns
- New color
◆ luminance:()
- (double) luminance: | (float) | dummy |
Get the perceived luminance of a color
- Parameters
-
dummy Unused parameter required to defeat a strange iOS/Objective-C bug
- Returns
- Luminance (between 0 and 1)
◆ toHexString()
- (NSString *) toHexString |
Convert color to a hex string.
- Returns
- hex string for the color
Overview
Extension methods for UIImage.
Instance Methods | |
(UIImage *_Nonnull) | - colorImageWithColor: |
Fill all the non-transparent parts of an image with a color More... | |
(UIImage *_Nonnull) | - scaleImageToSize: |
Scale an image More... | |
(UIImage *) | - scaleImage: |
Scale an image More... | |
(UIImage *) | - scaleImageForDevice |
Scale an image to the device scale More... | |
Instance Method Documentation
◆ colorImageWithColor:()
- (UIImage * _Nonnull) colorImageWithColor: | (UIColor *_Nonnull) | color |
Fill all the non-transparent parts of an image with a color
- Parameters
-
color Color to fill with
- Returns
- New image
◆ scaleImageToSize:()
- (UIImage * _Nonnull) scaleImageToSize: | (CGSize) | size |
Scale an image
- Parameters
-
size New image size
- Returns
- New image
◆ scaleImage:()
- (UIImage *) scaleImage: | (CGFloat) | scale |
Scale an image
- Parameters
-
scale Scale factor
- Returns
- New image
◆ scaleImageForDevice()
- (UIImage *) scaleImageForDevice |
Scale an image to the device scale
- Returns
- New image
Overview
Extension methods for UINavigationController.
Instance Methods | |
(NSArray< UIViewController * > *_Nullable) | - popToViewControllerOfClass:animated: |
Pop view controllers until a specific class is encountered More... | |
(BOOL) | - canPopToViewControllerOfClass: |
See if there is a view controller of a specific class on the stack More... | |
Instance Method Documentation
◆ popToViewControllerOfClass:animated:()
- (NSArray<UIViewController *> * _Nullable) popToViewControllerOfClass: | (nonnull Class) | viewControllerClass | |
animated: | (BOOL) | animated | |
Pop view controllers until a specific class is encountered
- Parameters
-
viewControllerClass View controller class to stop at animated YES to animate
- Returns
- View controllers popped
◆ canPopToViewControllerOfClass:()
- (BOOL) canPopToViewControllerOfClass: | (nonnull Class) | viewControllerClass |
See if there is a view controller of a specific class on the stack
- Parameters
-
viewControllerClass View controller class to look for
- Returns
- YES if there is a view controller of the specific class
Overview
Extension methods for UITableView.
Instance Methods | |
(void) | - setNeedsDisplayForAllVisibleCells |
Call setNeedsDisplay for all visible cells | |
(void) | - scrollToBottom |
Scroll to the bottom of the table | |
(UITableViewCell *_Nonnull) | - appendRow: |
Append a row to the table More... | |
(void) | - deleteRowAtIndex: |
Delete a row from a table More... | |
Instance Method Documentation
◆ appendRow:()
- (UITableViewCell * _Nonnull) appendRow: | (BOOL) | scrollToBottom |
Append a row to the table
- Parameters
-
scrollToBottom YES to scroll to the bottom of the list (to display the appended row)
- Returns
- UITableViewCell appended
◆ deleteRowAtIndex:()
- (void) deleteRowAtIndex: | (int) | index |
Delete a row from a table
- Parameters
-
index Row to delete
Overview
Extension methods for UIView.
Instance Methods | |
(nonnull id) | - showModal: |
Show this view as a modal dialog More... | |
(void) | - hideModal: |
Show this view after it has been shown with showModal: More... | |
(void) | - hideModal:withCompletion: |
Show this view after it has been shown with showModal: More... | |
(nullable id) | - findFirstResponder |
Find the view's first responder More... | |
(nullable id) | - superviewOfClass: |
Find the first superview view of a specific class More... | |
(nullable id) | - subviewOfClass: |
Find the first subview view of a specific class More... | |
(float) | - setWidthConstraint: |
Set or modify the width constraint for a view More... | |
(float) | - setHeightConstraint: |
Set or modify the height constraint for a view More... | |
(void) | - constrainToParentLeft:top:right:bottom: |
Constrain a view to its parent More... | |
(nullable id) | - traverseSubviews:withCompletion: |
Enumerate all subviews More... | |
(void) | - updateThemeColorsInChildren |
Update any child views that use the theme colors | |
(void) | - logViewTree:firstArg: |
Log the tree of subviews, for debugging More... | |
(void) | - logViewParents:firstArg: |
Log the chain of superviews, for debugging More... | |
Types | |
typedef _Nullable id(^ | UgiTraverseSubviewsCompletion) (id _Nonnull subview, int depth) |
Completion for traverseSubviews: | |
Protected Types | |
enum | UgiShowModalAnimationTypes { UgiModalBottom, UgiModalCenter, UgiModalCenterWithKeyboard } |
Type passed to showModal for the type of transition and the placement. More... | |
Instance Method Documentation
◆ showModal:()
- (nonnull id) showModal: | (UgiShowModalAnimationTypes) | animationType |
Show this view as a modal dialog
- Parameters
-
animationType Type of animation
- Returns
- id to pass to hideModal:
◆ hideModal:()
- (void) hideModal: | (nonnull id) | idFromShowModal |
Show this view after it has been shown with showModal:
- Parameters
-
idFromShowModal ID returned by showModal
◆ hideModal:withCompletion:()
- (void) hideModal: | (nonnull id) | idFromShowModal | |
withCompletion: | (nullable void(^)(void)) | completion | |
Show this view after it has been shown with showModal:
- Parameters
-
idFromShowModal ID returned by showModal completion Block to run when completed
◆ findFirstResponder()
- (nullable id) findFirstResponder |
Find the view's first responder
- Returns
- First responder
◆ superviewOfClass:()
- (nullable id) superviewOfClass: | (nonnull Class) | viewClass |
Find the first superview view of a specific class
- Parameters
-
viewClass View class to look for
- Returns
- The view
◆ subviewOfClass:()
- (nullable id) subviewOfClass: | (nonnull Class) | viewClass |
Find the first subview view of a specific class
- Parameters
-
viewClass View class to look for
- Returns
- The view
◆ setWidthConstraint:()
- (float) setWidthConstraint: | (float) | width |
Set or modify the width constraint for a view
- Parameters
-
width New width (or -1 to remove width constraint)
- Returns
- Previous width constraint constant
◆ setHeightConstraint:()
- (float) setHeightConstraint: | (float) | height |
Set or modify the height constraint for a view
- Parameters
-
height New height (or -1 to remove height constraint)
- Returns
- Previous height constraint constant
◆ constrainToParentLeft:top:right:bottom:()
- (void) constrainToParentLeft: | (float) | left | |
top: | (float) | top | |
right: | (float) | right | |
bottom: | (float) | bottom | |
Constrain a view to its parent
- Parameters
-
left Constraint for left, or -1 for none top Constraint for left, or -1 for none right Constraint for left, or -1 for none bottom Constraint for left, or -1 for none
◆ traverseSubviews:withCompletion:()
- (nullable id) traverseSubviews: | (BOOL) | recursive | |
withCompletion: | (nonnull UgiTraverseSubviewsCompletion) | completion | |
Enumerate all subviews
- Parameters
-
recursive YES to recurse completion Block to run for each subview, if the return is not nil, enumeration is aborted and this value is returned
- Returns
- Value returned by completion or nil
◆ logViewTree:firstArg:()
- (void) logViewTree: | (BOOL) | logConstraints | |
firstArg: | (NSString *_Nullable) | firstArg | |
, | ... | ||
Log the tree of subviews, for debugging
- Parameters
-
logConstraints YES log all the constraints firstArg List of names of parameters to log for each view
◆ logViewParents:firstArg:()
- (void) logViewParents: | (BOOL) | logConstraints | |
firstArg: | (NSString *_Nullable) | firstArg | |
, | ... | ||
Log the chain of superviews, for debugging
- Parameters
-
logConstraints YES log all the constraints firstArg List of names of parameters to log for each view
Enumeration Documentation
◆ UgiShowModalAnimationTypes
|
protected |
Overview
Extension methods for UIViewController.
Instance Methods | |
(nullable id) | - parentViewControllerOfClass: |
Find the first parent view controller of a specific class More... | |
Instance Method Documentation
◆ parentViewControllerOfClass:()
- (nullable id) parentViewControllerOfClass: | (nonnull Class) | viewControllerClass |
Find the first parent view controller of a specific class
- Parameters
-
viewControllerClass View controller class to look for
- Returns
- The view controller
Copyright © 2012-2017 U Grok It, Inc. connect@UGrokIt.com U Grok It and the U Grok It logo are registered trademarks of U Grok It, Inc. All other trademarks and copyrights are the property of their respective owners |