一 關於螢幕大小
#pragma mark - 螢幕寬高#define screen_bounds ([uiscreen mainscreen].bounds)
#define screen_width ([uiscreen mainscreen].bounds.size.width)
#define screen_height ([uiscreen mainscreen].bounds.size.height)
三 關於顏色
#pragma mark - rgb顏色///------ 10進製 ------
#define rgba(r, g, b, a) ([uicolor colorwithred:(r)/255. green:(g)/255. blue:(b)/255. alpha:a])
///------ 16進製制 ------
#define hexcolor(hex, a) [uicolor colorwithred:((float)((hex & 0xff0000) >> 16)) / 255.0 green:((float)((hex & 0xff00) >> 8)) / 255.0 blue:((float)(hex & 0xff)) / 255.0 alpha:a]
///------ 隨機顏色 ------
#define randomcolor ([uicolor colorwithred:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0 alpha:1])
四 關於字型
#pragma mark - 字型大小(常規/粗體)#define boldsystemfont(fontsize) [uifont boldsystemfontofsize:fontsize]
#define systemfont(fontsize) [uifont systemfontofsize:fontsize]
#define font(name, fontsize) [uifont fontwithname:(name) size:(fontsize)]
///------ 系統預設10~20號字型 ------
#define systemfont_10 systemfont(10)
#define systemfont_11 systemfont(11)
#define systemfont_12 systemfont(12)
#define systemfont_13 systemfont(13)
#define systemfont_14 systemfont(14)
#define systemfont_15 systemfont(15)
#define systemfont_16 systemfont(16)
#define systemfont_17 systemfont(17)
#define systemfont_18 systemfont(18)
#define systemfont_19 systemfont(19)
#define systemfont_20 systemfont(20)
#define systemfont_21 systemfont(21)
#define systemfont_22 systemfont(22)
#define systemfont_23 systemfont(23)
#define systemfont_24 systemfont(24)
五 關於內聯函式
#pragma mark - 靜態內聯函式#define ryjkit_static_inline static inline
六 關於沙盒路徑
#pragma mark - 沙河路經#define pathuserdefaults [nsuserdefaults standarduserdefaults]
#define pathtemp nstemporarydirectory()
#define pathdocument [nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes) objectatindex:0]
#define pathcache [nssearchpathfordirectoriesindomains(nscachesdirectory, nsuserdomainmask, yes) objectatindex:0]
總結專案中常用到得一些巨集定義
是否首次啟動 define first launched firstlaunch 是否 ipad define ispad uidevice currentdevice respondstoselector selector userinte ceidiom uidevice currentdevi...
專案中常用的註解
data 應用場景 實體類不用手動新增get set 方法 匯入 idea中需要新增lombok外掛程式 noargsconstructor 自動生成無引數建構函式。allargsconstructor 自動生成全引數建構函式。select 和 selectprovider的區別 select 後直...
專案中常用的linux命令
1.du sm sort n 把當前目錄下的檔案 或目錄 按大小排序,看下哪個地方占用最多 2.pwd 獲取當前目錄路徑 3.tail f file path 顯示檔案最後幾行內容 若檔案內容變動,會動態更新後面幾行 4.pgrep process name 獲取程序id 5.ps ef grep ...