Skip to content

Latest commit

 

History

History
174 lines (113 loc) · 3.27 KB

swift.md

File metadata and controls

174 lines (113 loc) · 3.27 KB

Swift

Contents

Entire UITabbar, code @ Appdelegate.swift

tintColor
UITabBar.appearance().tintColor = UIColor.white
barTintColor
UITabBar.appearance().barTintColor = UIColor.white
backgroundColor
UITabBar.appearance().backgroundColor = UIColor.white

Specific ViewController UITabbar, code @ ViewController.swift

tintColor
self.tabBarController?.tabBatbar.TintColor = UIColor.white
barTintColor
self.tabBarController?.tabBatbar.barTintColor = UIColor.white
backgroundColor
self.tabBarController?.tabBatbar.backgroundColor = UIColor.white

Make UIWebView support http

  • Method 1

    • Right Click on info.plist

    • Select Open As > Source Code

    • Copy & Paste

       <key>NSAppTransportSecurity</key>
       <dict>
       	<key>NSAllowsArbitraryLoads</key>
       	<true/>
       </dict>
  • Method 2

    • Select info.plist
    • Right Click & Choose Add Row
    • Select App Transport Sercurity Settings
    • Click the arrow to make it down as a Dictionary
    • Press + & Choose Allow Arbitary Loads
    • Set the boolean value from default NO to YES
  • Under Development

When developing in Swift, we often use some hardware devices.

We should set up the permission in the info.plist file

Right click on info.plist & select Open As > Source Code

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>Allow to access camera</string>
<key>NSMicrophoneUsageDescription</key>
<string>Allow to access microphone</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Allow to add media into photo album</string>
<key>NSPhotolibraryusageDescription</key>
<string>Allow to access photo album</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Allow to access user location</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Allow to access user location</string>