LoginSignup
4
5

More than 5 years have passed since last update.

XCodeでクラス拡張categoryを作る手順(Objcetive-C)

Last updated at Posted at 2016-01-04

UIImage+Addition.m, UIImage+Addition.hというカテゴリーを作りたい場合

File -> New -> File -> Source -> Objective-C Fileで新規ファイル作成
FileTypeSelect.png

File: Addition
FileType: Category
Class: UIImage
に設定する
FileOptionSelect.png

下記のようなソースが生成される

UIImage+Addition.h
#import <UIKit/UIKit.h>

@interface UIImage (Addition)

@end
UIImage+Addition.m
#import "UIImage+Addition.h"

@implementation UIImage (Addition)

@end
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5