親子日記APP
|
免費申請
|
登入
mini box 迷你盒子
這裡是工程師的筆記資料.
部落格
相簿
APP日記
書籤
標籤:nidBox 中所有
swift
相關日記
swift3學習:作業9:周星星問答
mini
題目畫面上顯示2個label,一個問題label,一個答案label。 2個button,一個”下一題”button,一個”顯示答案” button。全部10個問題,問題會循環。一開始答案label空白,點選”顯示答案”button後才會顯示答案。進�...
swift3學習:作業8: 研究 UIAlertController
mini
上了彼得潘的iOS App程式設計入門 課程才發現原來很多的 iOS 上的效果,Apple早就幫你準備好了,在 Storyboard 或是簡單的程式就可以做出來不需再寫個幾百、幾千行的程式來處理一堆的 UI 效果,只要專心於程式的核心的開發這次�...
Swift: 判斷 App 是在 iPhone 實體機執行,還是在模擬器中
mini
#if (arch(i386) || arch(x86_64)) && os(iOS)...模擬器#else...iOS 實體機 #endif Detect the watchOS simulator#if (arch(i386) || arch(x86_64)) && os(watchOS)...模擬器#else ...watchOS 實體機#endifDetect the tvOS simulator#if (arch(i386) || arch(x86_64)) && os(tvOS)...#...
swift 3/4 筆記/備忘
mini
以 Safari 瀏覽器開啟一個 URL:guard let url = URL(string: "http://mini.nidbox.com") else { return}if #available(iOS 10.0, *) { UIApplication.shared.open(url, options: [:], completionHandler: nil) //If you want handle the completion block than: //UIApplication.shared.open(url, ...
swift 3/4 將訊息轉貼到 Line (呼叫 Line App)
mini
Info.plist 必須新增 <key>LSApplicationQueriesSchemes</key> <array> <string>line</string> </array> 不然會出現錯誤 http://www.jianshu.com/p/631bd7f12a38 error: "This app is not allowed to query for sc...
swift3學習: UILabel 屬性:Line Break & Auto shrink
mini
使用 Lable 在顯示文字時,若文字太長(超過 Lable長度時) 那該怎麼處理?例如顯示一個很長的網址 (就像medium 的中文網址又臭又長)要去頭去尾來顯示? 縮小來顯示? 還是…可以試試 Line Break 或 Auto Shrink 這兩個屬性:Line BreakLable 的...
Swift: "設定" 畫面的製作
mini
設計 iPhone "設定畫面" 的效果首先在 Story Borard 中加入一個 Table View Controller接著Content 設定為 Static CellsSections 設定為 3 (或需要的區塊數目)Style 改為 Grouped如下圖在各個 Cell 放上 Label 或其它你需要的物件 (再設定適當的 co...
Swift: 在鍵盤上加上按鈕
mini
程式大概就這樣沒太多需解釋的地方 override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. emailTxt.keyboardType = .emailAddress emailTxt.clearButtonMode = .whileEditing num...
swift: navigation bar 設定背景圖片
mini
# 1nav_bg.png 320x44 (@x1)//// ViewController.swiftimport UIKitclass ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() //nav_bg.png 320x44 navigationController?.navigationBar.setBackgroundImage(UIImage(named: "nav_bg.png"...
Swift: 動態更改 initial viewcontroller
mini
App 的設計常常會有的狀況:啟動 App 後 已經登入 --> 直接跳掉 App主功能畫面 尚未登入 --> 先顯示登入畫面但 Storyboard 中已經將 Initial View Controller 指向「登入 View」時如何在已登入狀況下,直接、馬上顯示主功能畫面?--> �...
[Swift] status bar 的高度計算
mini
當接聽電話或是開啟熱點 (Hotspot) 時會像這樣多了一列 高度20pt 的提示列某些情境,沒注意的話 會造成畫面異常dropboxnavigation bar 被遮住navigation bar 多了 20pt 的空白以上是舊款 iPhone 5~8若是 iPhone X 系列,則不會增加一條 20pt 的提�...
Swift: 讀取 iOS 設備的型號/版本資料
mini
Swift: 讀取 iOS 設備的型號/版本資料 let dictionary = Bundle.main.infoDictionary!let app_version = dictionary["CFBundleShortVersionString"] as! Stringlet app_build = dictionary["CFBundleVersion"] as! Stringlet app_dDisplayName = dictionary["CFBundleDisplayName"...
Swift: Facebook SDK 登入錯誤訊息
mini
Facebook SDK 登入時出現的錯誤:2017-07-07 22:43:47.353693+0800 album[24122:4694784] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles2017-07-07 22:43:47.357594+0800 album...
Swift筆記: 多個 Alamofire request 同步 Sync(依序) 執行
mini
多個 http request,但希望各個 request 能依序、同步Sync 執行 ,而不要 非同步Async 執行例如我希望第一個 request 取的 server 給的 id 後,後面其它的 upload request 都要帶入(post/get) 此 id利用雙層 DispatchGroup var id:Int = 0let group1 = DispatchGrou...
note: iOS Facebook 登入
mini
iOS 專用 Facebook 登入 - 快速入門https://developers.facebook.com/docs/facebook-login/ios/要特別注意的是 【設定 Info.plist】在 Info.plist 中要加這段 (也可不加) <key>LSApplicationQueriesSchemes</key><array> <string>fbapi</string> <string&...
Swift: 讀取相片 Exif
mini
How to get Exif data from .. 讀取專案中的相片Exif ( IMG_5087.JPG )import UIKitimport ImageIOclass ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. let...