-
Notifications
You must be signed in to change notification settings - Fork 22
Settings
This singleton class stores all the settings for the apperance of your debugViews and debugDescriptions.
You only need this class if you want to change the look of your debugViews. You can either set some properties in code or load them from a plist.
- (void)loadSettings:(NSURL *)url
Use this method if you want to load settings from a plist file. You will find a complete list of supported keys on the end of this page. You can also use one of the default settings files in this repository. They all have different styles (inspired by the Xcode themes):
- com.kladek.CocoaDebugKit.settings.default.plist
- com.kladek.CocoaDebugKit.settings.dusk.plist
- com.kladek.CocoaDebugKit.settings.basic.plist
- (void)saveSettings:(NSURL *)url
Currently not supported.
This property stores the color for all textfields.
@property (nonatomic) NSColor *textColor;
This property stores the Font of all Textfield.
@property (nonatomic) NSFont *textFont;
The following Settings are for highlighting Keywords.
Currently the following keywords are highlighted:
- nil, NULL, @"(null)"
- YES, NO
@property (nonatomic) BOOL highlightKeywords;
This property stores the color of all keywords.
@property (nonatomic) NSColor *keywordColor;
This property stores the Font of all keywords.
@property (nonatomic) NSFont *keywordFont;
If set numbers will be colored in a different color.
@property (nonatomic) BOOL highlightNumbers;
This property stores the Color of all numbers.
@property (nonatomic) BOOL numberColor;
This property stores the font of all Numbers
@property (nonatomic) NSFont numberFont;
Propertynames (Keys) are drawn at the left side, while values are displayed on the right. Usually they have a lighter color so they are visually subtile while keys are stronger and a litle darker.
This property stores the Color of all properties.
@property (nonatomic) NSColor *propertyNameColor;
This property stores the font of all Property Names
@property (nonatomic) NSFont propertyNameFont;
This property stores the color of the title. Please keep in mind that this color and the color of the frame should have a high contrast.
@property (nonatomic) NSColor *titleColor;
This property stores the font of the Title
@property (nonatomic) NSFont *titleFont;
Now here comes the magic. Lets say you have an NSData property (which represent an image). To inspect the image/data you have to write some code, rebuild and navigate where you left. Or you could name your variable something like imageData
and add image
to the searchlist. Now every NSData object with image
in its propertyName will be displayed as image and not as raw data.
To enable this feature this property must be set to TRUE.
@property (nonatomic) BOOL convertDataToImage;
Furthermore this array must contain at least one entry otherwise the conversation won´t work.
@property (nonatomic) NSArray *propertyNameContains;
This property limits the size of an image. Use a resonable value or you are wasting a lot of space.
@property (nonatomic) NSSize imageSize;
Only for DebugDescription.
You can cut a data objects lenght so it won´t produce a lot useless information. Just set the maxDataLenght
property to a reasonable value.
@property (nonatomic) NSNumber *maxDataLenght;
With this keys you can change the look of your views. For example change the Framecolor or Backgroundcolor.
This property stores the line space. The textfields are aligned vertically with linespacing
in between.
@property (nonatomic) NSInteger lineSpace;
This property stores the background color information of the view.
@property (nonatomic) NSColor *backgroundColor;
This property stores the Frame Color from which the frame gradient is created. The Gradient uses the frame color plus the same color with 20% more white. So it´s better to use some darker colors.
@property (nonatomic) NSColor *frameColor;
Colors are rendered as follows:
Because NSColor saves each rgb-channel as a float value we have to calculate the 8bit value. If you are using something other than a 8 bit colorspace you shoudld change this. You can set this property to 0 so the color channels are displayed as float values.
@property (nonatomic) NSInteger numberOfBitsPerColorComponent;
This property stores the dateFormat for the dateFormatter.
@property (nonatomic) NSString *dateFormat;
For Documentation you can also save each view automatically.
This property stores if the view is saved or not.
@property (nonatomic) BOOL save;
This property store the filepath where the view is saved. The File Structure look something like this
debugView/
Document Root
debugView/1.0
App Version
debugView/1.0/123
App Build Number
Because of the naming structure you should use a automated versioning tool. See Chapter Automated Versioning
@property (nonatomic) NSURL *saveUrl;
This property decides if the saved file is a pdf or a png file.
@property (nonatomic) BOOL saveAsPDF;
Here is a list of all supported keys.
debugView.keywords.highlight
debugView.keywords.color
debugView.keywords.font
debugView.keywords.size
debugView.numbers.highlight
debugView.numbers.color
debugView.numbers.font
debugView.numbers.size
debugView.text.color
debugView.text.font
debugView.text.size
debugView.propertyName.color
debugView.propertyName.font
debugView.propertyName.size
debugView.title.color
debugView.title.font
debugView.title.size
debugView.image.size
debugView.image.dataToImage
debugView.image.propertyNameContains
debugView.appearance.lineSpace
debugView.appearance.backgroundColor
debugView.appearance.frameColor
debugView.appearance.numberOfBitsPerColorComponent
debugView.appearance.save
debugView.appearance.path
debugView.appearance.usePDF
debugView.NSDate.format
debugDescription.NSData.cutLenght