Access App Identifier Prefix programmatically

前端 未结 5 822
死守一世寂寞
死守一世寂寞 2020-11-28 20:15

How can I access the Bundle Seed ID/Team ID/App Identifier Prefix string programmatically? (These are all the same thing as far as I can tell).

I am using the UICKe

5条回答
  •  我在风中等你
    2020-11-28 21:05

    In swift3: (Based on @Hiron solution)

    Simply one line:

    var appIdentifierPrefix = Bundle.main.infoDictionary!["AppIdentifierPrefix"] as! String
    

    Given that in your Info.plist, add the following key-value property:

    key: AppIdentifierPrefix

    string-value: $(AppIdentifierPrefix)

提交回复
热议问题