iOS開發(fā)部分總結(jié)

1.iOS開發(fā)相關(guān)尺寸

(1)應(yīng)用商城圖片和視頻尺寸

? ? 圖片Screenshot:https://help.apple.com/app-store-connect/#/devd274dd925

? ? 6.5inch-display? ? 1242x2688

? ? 5.8inch-display? ? 1125x2436

? ? 5.5inch-display? ? 1242x2208

? ? 4.7inch-display? ? 750x1334

? ? 4inch-display? ? ? 640x1136

? ? 3.5inch-display? ? 640x960

? ? 視頻APP preview:https://help.apple.com/app-store-connect/#/dev4e413fcb8

? ? 6.5inch-display? ? 886x1920

? ? 5.8inch-display? ? 886x1920

? ? 5.5inch-display? ? 1080x1920

? ? 4.7inch-display? ? 750x1334

? ? 4inch-display? ? ? 640x1136

(2)開發(fā)尺寸

? ? 375X667

? ? 414X736

? ? 375X812

? ? 320X568

? ? 320X480

? ?iPhone X/Xs375X812

? ? iPhone XR414X896

? ? iPhone XsMax414X896

(3)APP圖標(biāo)尺寸

? ? ? 1024X1024 40X40 60X60 58X58 87X87 120X120 180X180

2.使用GPX文件改版模擬器的地址

添加GPX文件在Xcode:Edit Scheme -->?Options -->?Default Location -->?Add GPX File to Project

百度網(wǎng)盤下載GPX文件只需要改對應(yīng)的經(jīng)緯度就可以使用:?

shengzhen.gpx_免費高速下載|百度網(wǎng)盤-分享無限制

3.收到通知后刷新界面視圖

-(void)getrongcloadNC:(NSNotification*)userinfor{

?????[self performSelectorOnMainThread:@selector(refreshthenew)withObject:nilwaitUntilDone:YES];}

-(void)refreshthenew{

?if(self.selectedIndex!=1) {

?self.newchatmark.hidden=?NO; }

?else{

?self.newchatmark.hidden=?YES;}

}

4.字符串和數(shù)組轉(zhuǎn)換

//字符串轉(zhuǎn)變?yōu)閿?shù)組1

NSMutableString* str=[[NSMutableString alloc] initWithFormat:@"1,1,1,1,1,1"];

//字符串轉(zhuǎn)變?yōu)閿?shù)組2

NSMutableArray* array=[NSMutable ArrayarrayWithArray:[str?? componentsSeparatedByString:@","]];

//替換數(shù)組中的某個值

[array replaceObjectAtIndex:4 withObject:@"2"];

//把數(shù)組轉(zhuǎn)換成字符串

NSString*ns=[array componentsJoinedByString:@","];

5.顯示和不顯示mac隱藏屬性的文件夾

warning:file is missing from working copy

SVN版本控制,刪除的文件仍然存在于隱藏文件夾里面。

顯示隱藏文件夾:

defaults write com.apple.finder AppleShowAllFiles -bool YES

不顯示隱藏文件夾:

defaults write com.apple.finder AppleShowAllFiles -bool NO

注:刪除源文件的.svn文件將會大大減小源文件

6.block傳值

@property(nonatomic, strong)void(^selectCell)(ListUserModel *userModel);

self.selectCell(model);

searchRTVC.selectCell = ^(ListUserModel *userModel) {

? ? [weakSelf showAlerViewtWith:userModel];

};

7.捕捉異常

@try

{

? ? // 業(yè)務(wù)邏輯

}

@catch(異常類型名1ex)

{

? ? //異常處理代碼

}

@catch(異常類型名2ex)

{

? ? //異常處理代碼

}

// 可以捕捉 N 個 異常 ...

@finally

{

? ? //回收資源

}

栗子

NSDictionary *paramer;

@try{

? ? paramer =@{@"pageSize": [NSNumber numberWithInteger:pageSize],

? ? ? ? ? ? ? ? @"page": [NSNumber numberWithInteger:page],@"masterUid":self.masterUid};


}@catch(NSException *exception){

? ? return;

}@finally{

}

8.刪除工程沒有使用的冗余文件

GitHub - li6185377/ClearUnusedImage: 刪除xcode項目中未使用的圖片

9.Xcode插件管理器Alcatraz的安裝

常用插件

BBUFullIssueNavigator? Show all issueinthe issue navigator.

執(zhí)行命令,卸載

$ rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin

$ rm -rf ~/Library/Application\ Support/Alcatraz/

重裝

$ curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install.sh|sh

$ sudo gem install update_xcode_plugins

$ update_xcode_plugins

$ update_xcode_plugins —unsign

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

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

  • 因為要結(jié)局swift3.0中引用snapKit的問題,看到一篇介紹Xcode8,swift3變化的文章,覺得很詳細(xì)...
    uniapp閱讀 4,852評論 0 12
  • 發(fā)現(xiàn) 關(guān)注 消息 iOS 第三方庫、插件、知名博客總結(jié) 作者大灰狼的小綿羊哥哥關(guān)注 2017.06.26 09:4...
    肇東周閱讀 15,043評論 4 61
  • Google的聯(lián)合創(chuàng)始人拉里·佩奇對一個好的品牌產(chǎn)品有如下看法: 一個好產(chǎn)品要像牙刷一樣,讓用戶每天都必須用上幾分...
    小野與玫瑰閱讀 2,033評論 4 6
  • JavaScript模塊里介紹了用模塊實現(xiàn)封裝的方式。傳統(tǒng)OO語言里還有兩個重要特性就是靜態(tài)和常量,但JavaSc...
    張歆琳閱讀 3,244評論 0 4
  • 文字:若木菡 攝影:若木菡 走進(jìn)四月,即走進(jìn)了溫煦,走進(jìn)了和暖,寒冷已盡,酷暑尚遠(yuǎn)。 走進(jìn)四月,即走進(jìn)了光潤,新葉...
    若木菡閱讀 507評論 37 36

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