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

サーバーサイドエンジニアのためのiOSアプリ開発入門

typester
August 22, 2015

 サーバーサイドエンジニアのためのiOSアプリ開発入門

YAPC::Asia 2015

typester

August 22, 2015
Tweet

More Decks by typester

Other Decks in Technology

Transcript

  1. JOTUBODFWBSJBCMF package Dog;
 use Moose;
 
 extends ‘Animal’;
 
 has

    ‘name’ => (
 is => ‘rw’,
 isa => ‘Str’,
 );
 
 1;
  2. MB[Z package Dog;
 use Moose;
 
 extends ‘Animal’;
 
 has

    ‘name’ => (
 is => ‘rw’,
 isa => ‘Str’,
 lazy => 1,
 default => sub {
 “John”;
 },
 );
 
 1;
  3. MB[Z class Dog: Animal {
 @lazy var name: String =

    {
 return “John”
 }()
 }
  4. JOJUJBMJ[FS package Dog;
 use Moose;
 
 extends ‘Animal’;
 
 sub

    BUILD {
 my ($self) = @_;
 # . . .
 }
 
 1;
  5. JOTUBODFGVODUJPO package Dog;
 use Moose;
 
 extends ‘Animal’;
 
 sub

    print_info {
 my ($self) = @_;
 printf ‘name=%s\n’, $self->name;
 }
 
 1;
  6. JOTUBODFGVODUJPO class Dog: Animal {
 var name: String = “”


    
 func print_info() {
 println(“name=\(self.name)”)
 }
 }
  7. 1FSMͰΑ͘΍Δϛε my $t = AnyEvent->timer(
 after => 10,
 cb =>

    sub {
 $self->do_something;
 },
 );
 Scalar::Util::weaken($self);
  8. *OTXJGU var t = Timer(10, cb: {
 () -> Void

    in
 self?.do_something()
 })
  9. *OTXJGU var t = Timer(10, cb: {
 [weak self] ()

    -> Void in
 self?.do_something()
 })
  10. ϙΠϯλ w ੲͱ͕ͪͬͯ৘ใ͕ͦΖ͍ͬͯΔͷͰ
 ͋Μ·Γۤ࿑͠ͳ͍͸ͣ w ެࣜνϡʔτϦΞϧ
 4UBSU%FWFMPQJOHJ04"QQT 4XJGU  w

    Ұ෦೔ຊޠʹ΋ͳͬͯ·͢
 IUUQTEFWFMPQFSBQQMFDPNKQEPDVNFOUBUJPO w ϐϯϙΠϯτʹ΍Γ͍ͨ͜ͱɾ࢖͏ϑϨʔϜϫʔΫ໊ͰάάΔ
 ˠ4UBDLPWFSqPX RJJUB