OC Masonry笔记和Array数组的API

数组

[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];
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容