sauchye / iosdev_notes

iOS Dev Tips(一些零散的iOS知识tips)
19 stars 5 forks source link

Programming Style #18

Closed sauchye closed 5 years ago

sauchye commented 8 years ago

Objective C

   [self.view addSubview:({

        UIImage *image = [CDManager doneImage];
        UIButton *doneBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        doneBtn.frame = CGRectMake(SCREEN_WIDTH - image.size.width/3.5 - 10, 25, image.size.width/3.5, image.size.height/3.5);
        [doneBtn setImage:normal forState:UIControlStateNormal];
        [doneBtn addTarget:self action:@selector(doneButtonAction) forControlEvents:UIControlEventTouchUpInside];
        [doneBtn setImage:image forState:UIControlStateNormal];
        doneBtn;
    })];

http://weibo.com/p/10080852e0242ca7393837a6ecec8009daad5a?k=iOS%E7%9F%A5%E8%AF%86%E5%B0%8F%E9%9B%86&from=501&_from_=huati_topic#_rnd1465376916474