Swift 的 Access Control, 人人有責!

Journey on programming
1 min readApr 11, 2017

--

在我知道Access Control這個名詞之前,我只知道在寫程式的過程當中,不同程度的宣告,可以決定讓宣告的這個變數可使用的範圍為何。可是直到我透過 CocoaPods 來安裝一個module,結果發現無法順利匯入之後,逼得我非得面對這個課題~~

可以參考一下下方這個網頁,其針對swift3與之前版本的access control說明得還算清楚明白~

因此,我為了讓匯入的module可以使用,所以我搜尋了我匯入的swift檔案中,並且將所有的private, internal全都取代掉,修改完之後,的確我匯入的module就可以去做使用了,分享給大家參考~

註:我不確定這是不是一個正確的處理方式,但是如果以可以順利compile為前提的話,至少我是成功了…XDD

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Journey on programming
Journey on programming

Written by Journey on programming

Software Developer at 91APP. If you like my articles, please clap and follow me on Medium. Never stay still, never plateau!

No responses yet

Write a response