ObjecTips

Swift & Objective-C で iOS とか macOS とか

Xcode の Fonts & Colors

Xcode の Fonts & Colors の設定一覧を調べた
太字のところが色とフォントの設定が反映される箇所

Source Editor 適用箇所の例
Plain Text メソッド名、ファンクション名、クラス定義など
- (void)method;
void func();
@interface MyObject : NSObject
@implementation MyObject
Comments // comment
/*
comment
*/
Documentation Comments /*!
comment
*/
Documentation Comment Keywords /*!
comment
@param ...
@return ...
/*
Strings 文字列全般
#import <UIKit/UIKit.h>
#import "MyObject.h"
NSString *string = @"string";
char *string = "string";
Characters 文字
char c = 'c';
FourCharCode code = 'aapl';
Numbers 数字とNSNumber, NSArray, NSDictionaryのリテラル
int i = 123;
NSNumber *number = @(value);
NSArray *array = @[value];
NSDictionary *dictionary = @{@"key": value};
Keywords 予約語など
@interface MyObject : NSObject
@property (nonatomic, readonly) BOOL flag;
@end
@implementation MyObject
- (instancetype)init
{
  self = [super init];
  if (self) {
  }
  return self;
}
@end
Preprocessor Statements #import
#include
#define
URLs // http://www.example.com
Attributes XMLのattribute(__attribute__やpropertyのattributeではない)
<?xml version="1.0" encoding="UTF-8"?>
<name attribute="value"></name>
Project Class Names プロジェクト内で定義したクラス名
MyObject *object = [MyObject new];
Project Function and Method Names プロジェクト内で定義したメソッドとファクション名
[self method];
func();
Project Constants プロジェクト内で定義した定数
typedef NS_ENUM(NSUInteger, MyEnum) {
  MyEnumValueA,
  MyEnumValueB,
  MyEnumValueC,
};
switch (value) {
  case MyEnumValueA:
  case MyEnumValueB:
  case MyEnumValueC:
    break;
  default:
    break;
}
Project Type Names プロジェクト内で定義した型
typedef int MyType;
MyType type;
Project Instance Variables and Globals プロジェクト内で定義したインスタンス変数とグローバル変数、プロパティ変数も含む
static int valueA;
@interface MyObject : NSObject
{
  int valueB;
}
@property (nonatomic) int valueC;
@end

@implementation MyObject
- (void)test
{
  valueA = 0;
  valueB = 0;
  self.valueC = 0;
}
@end
Project Preprocessor Macros プロジェクト内で定義されたマクロ
#define kMyDefine 0;
kMyDefine;
Other Class Names プロジェクト外で定義されたクラス名
@interface MyObject : NSObject
NSString *string;
NSNumber *number;
Other Function and Method Names プロジェクト外で定義されたメソッドとファンクション名
NSObject *obj = [[NSObject alloc] init];
CFAbsoluteTime time = CFAbsoluteTimeGetCurrent();
Other Constants プロジェクト外で定義された定数
NSStringEncoding encoding = NSUTF8StringEncoding;
Other Type Names プロジェクト以外で定義された型
NSStringEncoding encoding = NSUTF8StringEncoding;
Other Instance Variables and Globals プロジェクト外で定義されたインスタンス変数とグローバル変数、プロパティ変数も含む
NSUInteger length = @"string".length;
NSString *name = NSUserDefaultsDidChangeNotification;
Other Preprocessor Macros プロジェクト外で定義されたマクロ
NSTimeInterval time = NSTimeIntervalSince1970;
CGFloat max = CGFLOAT_MAX;


Source Editor 適用箇所
Background Color 背景色
Selection Color 選択領域の背景色
Cursor Color カーソル(キャレット)の色
Invisibles Color メニューの Show Invisibles を選択すると space が ␣ と表記されるのでそれの事だと思うけど、Xcode 6では色を変更しても反映されない。


Console 適用箇所
Debugger Console Prompt デバッガのプロンプト
(lldb) po self
Debugger Console Input デバッガの入力
(lldb) po self
Debugger Console Output デバッガの出力
(lldb) po NSStringFromClass([NSObject class])
NSObject
Executable Console Input 実行時の入力
OS X の Command Line Tool の作成時に scanf などでユーザ入力を行う場合に使用する
Executable Console Output 実行時の出力
NSLogやprintfの出力


Console 適用箇所
Background Color 背景色
Selection Color 選択領域の背景色
Cursor Color カーソル(キャレット)の色
Instruction Pointer Color デバッガで実行を止めた時の現在の実行位置(緑色のバー)だと思うけど、Xcode 6では色を変更しても反映されない。