iOS 杂谈

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

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

推荐阅读更多精彩内容