美文网首页
OC Masonry笔记和Array数组的API

OC Masonry笔记和Array数组的API

作者: cry_0416 | 来源:发表于2016-09-26 20:15 被阅读138次

    数组

    [array[i] isEqual:array2[i]]
    判断两个数组元素是否相等

    [array[i] == array2[i]]
    判断两个元素地址是否相等

    [array componentsJoinedByString:@"."]
    将所有元素之间加入.连接成字符串

    enumerateObjectsUsingBlock快速遍历

    sortedArrayUsingComparator排列

    reverseObjectEnumerator.allObjects将数组倒过来(排序)


    Masonry

    更新的约束要在指定的方法中

    // this is Apple's recommended place for adding/updating constraints
    - (void)updateConstraints {
    
        [self.growingButton updateConstraints:^(MASConstraintMaker *make) {
            make.center.equalTo(self);
            make.width.equalTo(@(self.buttonSize.width)).priorityLow();
            make.height.equalTo(@(self.buttonSize.height)).priorityLow();
            make.width.lessThanOrEqualTo(self);
            make.height.lessThanOrEqualTo(self);
        }];
        
        //according to apple super should be called at end of method
        [super updateConstraints];
    }
    

    相关文章

      网友评论

          本文标题:OC Masonry笔记和Array数组的API

          本文链接:https://www.haomeiwen.com/subject/cawqyttx.html