-->

2016年1月7日木曜日

Add-Hocで公開

最近作ったアプリをAd-Hoc版としてwebからインストールできるようにした! Provisioning周りを久しぶりにいじってたけど、完全に忘れていた、、、

導入としては、下記リンク先の概念図が非常にわかりやすいと思う
http://qiita.com/fujisan3/items/d037e3c40a0acc46f618

iOS devの操作→Google Driveを使ってAd-Hoc公開までの手順は、
忘れないうちにまとめておこう…

2015年12月19日土曜日

UILabel, UIView, UIButtonの角を丸くする

UILabelとUIViewの場合
 
UILabel *label =  [UILabel alloc]init];
label.clipsToBounds = true;
label.layer.cornerRadius = 3.0f;

UIView *view = [UIView alloc]init];
view.clipsToBounds = true;
view.layer.cornerRadius = 3.0f;
UIButtonの場合
 
UIButton *button = [UIButton alloc]init];
button.layer.cornerRadius = 3.0f;

2015年12月14日月曜日

Xcodeで使える特殊タグ

// TODO: ToDoリストを記述する

// FIXME: 修正項目などを記述する

// !!!: 重要項目を記述する

// ???: 不明点を記述する

#pragma mark
//メソッドの区切りに使う

#warning 警告メッセージ

#error エラーメッセージ

2015年12月7日月曜日

継承したクラスのdelegateメソッドを表示

Xcodeを使ってて今更知ったこと

例えば、UITableViewを継承したカスタムクラスを作ったときに、
必要なdelegateメソッドを知る方法


「UITableViewDelegate」をcommandキーを押しながらクリック


必須のメソッドは
@required

オプションのメソッドは
@optional
で書いてあります。

2015年11月28日土曜日

新しいXcodeでカスタムセルを作ろうと…

久しぶりにアプリを作り始める

UITableViewCellを継承したカスタムセル作るぞー

 
Next(ぽち)

ん…?なんか違うような…
 
Next(ぽち)

えっ!!



正しくはこちら




 



2014年10月13日月曜日

UINavigationBarのtitle、backButtonのフォントを変える

まず、「AppDelegate.m」の『- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions』に、
 
    UIFont *barButtonTitleFont = [UIFont fontWithName:@"mplus-2p-light" size:13];
    UIColor *barButtonTitleColor = [UIColor whiteColor];
    [[UIBarButtonItem appearance] setTitleTextAttributes:@{UITextAttributeFont:barButtonTitleFont, UITextAttributeTextColor:barButtonTitleColor} forState:UIControlStateNormal];
を記述。これで、BackButtonのフォントが変わる

次に、NavigationControllerの『ViewDidLoad』に、
    UILabel* label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 200, 44)];
    label.backgroundColor = [UIColor clearColor];
    label.font = [UIFont fontWithName:@"mplus-2p-light" size:22.0f];
    label.textColor = [UIColor flatWhiteColor];
    label.text = @"タイトル";
    label.textAlignment = NSTextAlignmentCenter;
    self.navigationItem.titleView = label;
を記述。これで、タイトルのフォントが変わる。

それはそうと、m+フォントってとても美しいよね

アプリ起動時に指定した画像を表示させる

アプリを起動した時に指定した画像を表示させる
(Twitterの公式クライアントアプリとかであるやつ)
  1. プロジェクト中にある「images.xcassets」を開いて、起動時に表示したい画像をドラッグアンドドロップで設定する。

    ちなみに、必要な画像サイズはinspectorに書いてある。


  2. 「info.plist」に「Status bar is initially hidden」 という項目を追加して、Boolean型のYESに設定する。


  3. 同じく、「View controller-based status bar appearance」という項目を追加して、Boolean型のNOに設定する。
     これで、起動時からステータスバーが表示されなくなる。


  4.  「AppDelegate.m」の-『 (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions』に、
    [NSThread sleepForTimeInterval:1.0];
    [UIApplication sharedApplication].statusBarHidden = NO;
    
    を記述する。


    これで、起動から1秒間、設定した画像が表示される
    あとは、フェードアウトするアニメーションを追加したい・・・