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都會執(zhí)行

  • 使用場景

可以在底層給每個button加一些統(tǒng)一的事件處理,比如點(diǎn)擊的時候打點(diǎn)

Position, AnchorPoint

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

  • frame是相對于父視圖
  • frame是個虛擬的概念,是可以隨著position,anchorPoint而變化
  • 如果改變anchorPoint,position是不會變得,所以只能變frame,其實(shí)就是將anchorPoint放到position的位置

Xcode

Objective-C

如下 2 個結(jié)構(gòu)體 SampleA 和 SampleB 在內(nèi)存上是完全一樣的,原因是結(jié)構(gòu)體本身并不帶有任何額外的附加信息

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
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容