What Cocoa/Core Foundation helper functions do you wish you knew about 2 years ago?

前端 未结 7 1093
自闭症患者
自闭症患者 2021-01-31 00:20

I just discovered the NSRect helper functions in NSGeometry.h (i.e. NSMidX, NSMaxX, etc...)

These would have made some repetitive coding much easier. I knew about NSMak

7条回答
  •  一向
    一向 (楼主)
    2021-01-31 01:08

    Helper function to draw three part images with left cap, fill and right cap. Ideal for custom buttons

    void NSDrawThreePartImage(NSRect frame,
        NSImage *startCap,
        NSImage *centerFill,
        NSImage *endCap,
        BOOL vertical,
        NSCompositingOperation op,
        CGFloat alphaFraction,
        BOOL flipped
    );
    

    Also look for NSDrawNinePartImage

提交回复
热议问题