Swift iOS 使用程式碼設定Tab

Mario tsai
1 min readAug 3, 2020

--

Setting tab path & image with code

Tab的使用頻率很高,設定上我們常常是用StoryBoard拉線、設定等等。

有時候線一多就有點煩躁。我們其實可以從code做到。

By MarioTsai

首先在 func 裡面設定 陣列

加入StoryBoard,使用關鍵字.tabBarItem,再設定點選的圖片。最後append進去就可以了。

有一個以上的tabBar就繼續 if let下去就可以了。

Coding Swift 順利

--

--

Mario tsai

Major in physical education. Football referee. And high interest in looking the world through the numbers.