Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Xcode6のFramework Templateについて

haranicle
October 31, 2014

Xcode6のFramework Templateについて

haranicle

October 31, 2014
Tweet

More Decks by haranicle

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ w !IBSBOJDMF w J04ΞϓϦ։ൃ ٕज़ࢧԉ w ͨ·ʹαʔόαΠυ (SBJMT 

    w ͱ͖Ͳ͖"OESPJE ಛघจࣈ ແྉҐ ϕετ৽ண"QQ 23ίʔυ Ϧʔμʔ ͑΋ελϯϓ ͨ΂Χϝϥ
  2. 'SBNFXPSL5FNQMBUF1SPKFDU w ҎԼʹ'SBNFXPSLϑΝΠϧ͕ग़ྗ͞ΕΔ w 6TFSTϢʔβ໊-JCSBSZ%FWFMPQFS9DPEF %FSJWFE%BUBϓϩδΣΫτݻ༗ͷϥϯμϜͳจ ࣈྻ#VJME1SPEVDUT w ͷ഑Լʹʜ w

    %FCVHJQIPOFPT4VTIJ,JUGSBNFXPSL w %FCVHJQIPOFTJNVMBUPS4VTIJ,JUGSBNFXPSL w γϛϡ༻ͱ࣮ػ༻ͷGSBNFXPSLϑΝΠϧ͕ w ผʑʹͰ͖ͪΌ͏ʂ ࣮ػ༻ʹϏϧυͨ࣌͠ γϛϡ༻ʹϏϧυͨ࣌͠
  3. w ࣮ػ༻ͱγϛϡ༻ͦΕͧΕʹ9DPEFͰϏϧ υͨ͠ޙʹ w 6TFSTϢʔβ໊-JCSBSZ%FWFMPQFS 9DPEF%FSJWFE%BUBϓϩδΣΫτݻ༗ͷ ϥϯμϜͳจࣈྻ#VJME1SPEVDUT w ഑ԼͰԼهεΫϦϓτΛ࣮ߦ͢Δͱ 6OJWFSTBM'SBNFXPSLΛ࡞੒Ͱ͖Δ

    #!/bin/sh FrameworkName="SushiKit" rm -rf ./Debug mkdir ./Debug cp -r ./Debug-iphoneos/${FrameworkName}.framework 
 ./Debug/${FrameworkName}.framework lipo -create ./Debug-iphoneos/${FrameworkName}.framework/${FrameworkName} ./Debug- iphonesimulator/${FrameworkName}.framework/${FrameworkName} -output ./Debug/$ {FrameworkName}.framework/${FrameworkName} MJQPίϚϯυ IUUQTHJTUHJUIVCDPNIBSBOJDMF FEFBFEBF
  4. &NCFEEFE'SBNFXPSL w ΞϓϦ಺Ͱ
 ෳ਺ϓϩδΣΫτͰڞ༗Ͱ͖ͳ͍ 
 'SBNFXPSL࡞ͬͯخ͍͠ͷ  w ಉ͡ϓϩδΣΫτ಺ʹෳ਺ݸͷϓϩμΫτ ͷλʔήοτ͕͋Δͱ͖ʹ༗༻

    w ͭ·Γʜ"QQ&YUFOTJPO $POUBJOJOH"QQͷλʔήοτ "QQ&YUFOTJPOͷλʔήοτ &NCFEEFE'SBNFXPSLͷλʔήοτ YDPEFQSPK ࢖༻
  5. 4VTIJ#VUUPOI #import <UIKit/UIKit.h> IB_DESIGNABLE @interface SushiButton : UIButton @property(nonatomic) IBInspectable

    CGFloat borderWidth; @property(nonatomic) IBInspectable UIColor* borderColor; @property(nonatomic) IBInspectable CGFloat cornerRadius; @property(nonatomic) IBInspectable UIColor* ellipseColor; @end -JWF3FOEFSJOH͍ͨ͠ Ϋϥεʹ͚ͭΔ -JWF3FOEFSJOH͍ͨ͠ ϓϩύςΟʹ͚ͭΔ
  6. 4VTIJ#VUUPON - (void)setBorderWidth:(CGFloat)borderWidth { self.layer.borderWidth = borderWidth; } // தུ

    - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); // ӨΛඳը CGContextSetFillColor(context,CGColorGetComponents(self.ellips eColor.CGColor)); NSInteger padding = 20; CGRect frame = self.bounds; frame.origin = CGPointMake(padding, frame.size.height * 0.7); frame.size = CGSizeMake(frame.size.width - padding * 2, frame.size.height * 0.2); CGContextFillEllipseInRect(context, frame); }