第3回:iPod touchで動作するテキストエディタはこう作る!

#import "editor.h"
#import <UIKit/UIKeyboard.h>

@implementation EditorApplication

- (void) applicationDidFinishLaunching: (id) unused
{
    struct CGRect screenRect = [UIHardware fullScreenApplicationContentRect];
    screenRect.origin = CGPointZero;

    /* ウィンドウ生成 */
    UIWindow *window;
    window = [[UIWindow alloc] initWithContentRect: screenRect];
    [window orderFront: self];
    [window makeKey: self];
    [window _setHidden: NO];

    /* 表示領域の設定 */
    struct CGRect mainRect = [UIHardware fullScreenApplicationContentRect];
    mainView = [[UIView alloc] initWithFrame: screenRect];

    /* キーボードの大きさ */
    struct CGSize keyboardSize = [UIKeyboard defaultSize];

    /* テキスト入力欄 */
    textView = [[UITextView alloc]
        initWithFrame: CGRectMake(0, 0, screenRect.size.width,
        screenRect.size.height-keyboardSize.height)];
    [textView setEditable: YES];
    [textView setTextSize: 14];

    /* ソフトウェアキーボード */
    UIKeyboard *keyboard = [[UIKeyboard alloc]
        initWithFrame: CGRectMake(0, screenRect.size.height-keyboardSize.height,
        screenRect.size.width, keyboardSize.height)];

    /* ウィンドウに表示領域を設定 */
    [window setContentView: mainView];

    /* 表示領域にテキスト入力欄を設定 */
    [mainView addSubview: textView];

    /* 表示領域にキーボードを設定 */
    [mainView addSubview: keyboard];
}
@end
end

人気記事トップ10

人気記事ランキングをもっと見る

企画広告も役立つ情報バッチリ! Sponsored

サーバやOSの保守期限、VMware環境の見直しといった節目に考える、Oracle AI Databaseの次期基盤。オンプレ継続・AWS・OCIそれぞれの特性と留意点を整理するWebセミナー 11月19日 16:00 AIエージェントの“見えないリスク”に備えてアイデンティティを「関係」で統制する 11月17日 6:25 AI生成コードをどう安全に使うか――決定論的検証とAutoFixで築く品質保証ワークフロー 11月16日 6:30 デジタル主権時代、データとモデルの持ち方は企業が主体的に定める 11月13日 6:25 ClickHouse Cloudが実現した広告運用SaaS「ATOM」のデータ基盤革新、パフォーマンスを向上しながら、運用負荷とコストを削減 11月11日 6:20 AIで開発が加速する時代、品質保証はどう変わる? Tricentisが示すAIエージェント活用の実像 11月9日 6:45 悪用までの猶予が「1分」に迫るフロンティアAI時代に開発と本番を貫く脆弱性管理が必要 10月29日 8:30 欧州CRA対応とSBOM運用。AI生成コードのOSS混入問題の対策とは ――スニペット単位で検出する「FossID」「Insignary Clarity」によるSBOM運用 9月16日 6:40 PostgreSQLからTiDBへ、稼働中SaaSで進める段階的DB移行の実践と再設計への展望 9月7日 6:30 機能安全開発におけるGoogleTestの活用を支援!「Parasoft C/C++test CT」で実現する効率化&AI連携 4月14日 6:30