iOS 杂谈

作者: sjtupt | 来源:发表于2017-08-24 10:45 被阅读7次

    页面刷新的时候,会停止动画。

    iPhone X 适配

    iPhone X 适配

    ViewController

    • ViewControllernavigationController是父controllernavigationController

    Button

    • 如果给button的同一个事件添加两次handler是什么情况?覆盖还是都能够捕获呢?
    [button addTarget:self action:@selector(handler1) forControlEvents:UIControlEventTouchUpInside];
    [button addTarget:self action:@selector(handler2) forControlEvents:UIControlEventTouchUpInside];
    

    答案是两个handler都会执行

    • 使用场景

    可以在底层给每个button加一些统一的事件处理,比如点击的时候打点

    Position, AnchorPoint

    the center and position both represent the location of the anchorPoint relative to the superlayer

    • frame是相对于父视图
    • frame是个虚拟的概念,是可以随着position,anchorPoint而变化
    • 如果改变anchorPointposition是不会变得,所以只能变frame,其实就是将anchorPoint放到position的位置

    Xcode

    Objective-C

    如下 2 个结构体 SampleA 和 SampleB 在内存上是完全一样的,原因是结构体本身并不带有任何额外的附加信息

    struct SampleA {
        int a;
        int b;
        int c;
    };
    struct SampleB {
        int a;
        struct Part1 {
            int b;
        };
        struct Part2 {
            int c;
        };
    };
    

    MongoDB

    • brew services start mongodb
    • brew services stop mongodb

    相关文章

      网友评论

        本文标题:iOS 杂谈

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