Open in app

Sign In

Write

Sign In

Stephen Huang
Stephen Huang

15 Followers

Home

Lists

About

Published in

彼得潘的 Swift iOS App 開發教室

·Jul 21

#34 MacOS App — Document Types

如何在 MacOS APP 中挑選能開啟APP的副檔名檔案。 在MacOS中檔案會以預設的開啟App Icon當作檔案Icon。 這些設定都是在 App/TARGETS/Info 項下 Document Types, Exported Type Identifiers, Imported Type Identifiers. ㄧ、Document Types — 可輸入現存的UTI或是自創的UTI 1 現存UTI — 以Png為例: 步驟一、取得png檔案的UTI: 在終端機terminal 輸入 mdls 指令,以找到檔案的UTI(Uniform Type Identifiers)。 以png為例,在kMDItemContentType即為UTI: “public.png” mdls 檔案路徑 步驟二、在 Document Types 輸入:

Macos App

4 min read

#34 MacOS App — Document Types
#34 MacOS App — Document Types
Macos App

4 min read


Published in

彼得潘的 Swift iOS App 開發教室

·Jun 23

#33 Mac Terminal PATH 終端機路徑

終端機基本命令可參考這篇: [第一週] Command Line - Terminal、基本指令介紹 有別於一般人習慣的圖形化介面 (GUI),其實可以實現一樣的動作,差別在於 GUI 是別人 設計規劃出容易理解的介面,像關閉檔案的按鈕大部分都是紅色 X 作為識別,通常是用滑鼠操作。而 Command Line 則是 透過純文字…yakimhsu.com shell收到命令,就會去找該命令的執行檔, 環境變數PATH就是指定shell應該去哪裡找執行檔。 若安裝的執行檔不再PATH裡,就會造成command not found的錯誤。 一、確認PATH內容: echo: 將資訊輸出到螢幕。 可以用echo查看現在的PATH包含什麼 $echo $PATH which: 尋找執行檔位置 $which brew(替換命令開頭) 若不在PATH中,會顯示 brew not found 二、加入新的PATH:

Mac

2 min read

#33 Mac Terminal PATH 終端機路徑
#33 Mac Terminal PATH 終端機路徑
Mac

2 min read


Published in

彼得潘的 Swift iOS App 開發教室

·Jun 18

#32 UILaunchScreen 沒有作用

最近遇到 UILaunchScreen 的運作 Bug。 前情提要: 我上架了一個App並使用了 LaunchScreen.Storyboard 載入開頭Logo App相容版本:iOS 13.0 問題: 切換為 iOS 14.0 以後才出現的 UILaunchScreen 然後更新App,卻造成在「模擬機」、「實機」甚至「TestFlight」下載到手機上顯示的開頭Logo都顯示錯誤(一片空白 or 圖片比例怪異)。 在Info.plist中新增Launch Screen 項目,並加入 Image Name: MyPhoto 更新App後,MyPhoto沒有如預期般出現,開頭畫面一片空白。 若是新安裝的使用者則能正常顯示。 — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — 在 Stack Overflow 找到解法:

Launch Screen

2 min read

#32 UILaunchScreen 沒有作用
#32 UILaunchScreen 沒有作用
Launch Screen

2 min read


Jun 15

#31 MacOS — 在 Xcode 專案使用 serial port 錯誤 Operation not permitted

在專案中尋找entitlement檔案 手動加上 Key: com.apple.security.device.serial Value 設定為 YES

Macos

2 min read

#31 MacOS — 在 Xcode 專案使用 serial port 錯誤 Operation not permitted
#31 MacOS — 在 Xcode 專案使用 serial port 錯誤 Operation not permitted
Macos

2 min read


Published in

彼得潘的 Swift iOS App 開發教室

·May 26

#30 SwiftSoup 解析HTML

SwiftSoup 是一個很方便的swift library,用來解析HTML。 GitHub - scinfu/SwiftSoup: SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery… SwiftSoup: Pure Swift HTML Parser, with best of DOM, CSS, and jquery (Supports Linux, iOS, Mac, tvOS, watchOS) - GitHub…github.com 一、建立URLRequest if let url = URL(string: "網址") { let request = URLRequest(url: url) } 二、取得網址內的html let task = URLSession.shared.dataTask( …

Swift

3 min read

Swift

3 min read


Published in

彼得潘的 Swift iOS App 開發教室

·Jan 18

Git — Mac 遷移/移動git專案到新網址

在Mac環境下如何將 git 專案移動到新的git網址? 一定要先確定專案已經clone到電腦中!! 避免git失敗或錯誤資料遺失,請一定要備份。 在終端機terminal內 cd 移動到專案資料夾後: 查看專案的遠端位置 $ git remote -v 2. 指定新的位置 $ git remote set-url origin 新遠端位置(網址) 3. 若新的遠端位置沒有任何commit,就可以直接push上去,完成。 但是! 如果在新遠端位置url已經有commit 的時候,會出現錯誤「fatal: refusing to merge unrelated histories」 How to fix 'fatal: refusing to merge unrelated histories' Git error The fatal: refusing to merge histories error is a fairly common Git error. It appears when a developer tries to merge…komodor.com

Git

2 min read

Git

2 min read


Published in

彼得潘的 Swift iOS App 開發教室

·Dec 12, 2022

#28 Swift — 各式 keyboardType 圖示

Swift 的 UITextField 之 UIKeyboardType 圖示。 以下展現每個鍵盤種類在模擬器上的畫面截圖,共12種: 1 — default 2 — asciiCapable

Swift

2 min read

#28 Swift — 各式  keyboardType  圖示
#28 Swift — 各式  keyboardType  圖示
Swift

2 min read


Published in

彼得潘的 Swift iOS App 開發教室

·Dec 2, 2022

#27 Swift — macOS 跳出 NSAlert 視窗

創造一個 macOS 專案,Xcode會import Cocoa, 而非平常熟悉的UIKit 在這個Cocoa裡面,他的警告視窗是NSAlert Apple Developer Documentation Edit descriptiondeveloper.apple.com 一、那如何呼叫NSAlert呢 let alertController = NSAlert() // 設置警告圖案 alertController.icon = NSImage(systemSymbolName: " …

Nsalert

4 min read

#27 Swift — macOS 跳出 NSAlert 視窗
#27 Swift — macOS 跳出 NSAlert 視窗
Nsalert

4 min read


Published in

彼得潘的 Swift iOS App 開發教室

·Nov 3, 2022

Xcode tips 實用編輯按鍵

統整Xcode 常用的快速鍵使用方式 一、鍵盤快速鍵 1「control + shift + 滑鼠點擊」 => 指定多個輸入點。 2「option + 滑鼠拖曳」 => 已矩形方式選取文字。 3「cmd + control + E」 => 選取所有同參數/變數。 4「control + I」 => 反白區域自動整理縮排。 5程式中輸入「#warning」,可顯示醒目的黃色錯誤提醒。輸入 「#error」,則會出現紅色錯誤,不解決就不能Build。 6「cmd + shift + K」 => Clean 所有錯誤 7「cmd + B」 => 快速Build,try error。 8「cmd + shift + O」 => 快速搜尋並開啟選定的頁面。 9「cmd + option + /」 => 為function自動生成註解(在指定function 上方一行使用)。 10 「option + 編輯器右上圖示」=> 可向右或向下多加一個顯示頁面。

Xcode

3 min read

Xcode tips 實用編輯按鍵
Xcode tips 實用編輯按鍵
Xcode

3 min read


Oct 22, 2022

#26 Swift — UITabBarController外觀(item, tintColor, badge, TextAttribute)

對swift原生UITabBarController的研究。 Xcode版本:13.2.1, iOS版本支援13以上。 UITabBarController 為一個TabBarController及底下的item組成, 每個item可連接到一個ViewController(也可以是UITableViewController之類的)。 我們將三個畫面都連接到各自的controller,並命名為 TabBarViewController TabItem1ViewController TabItem2ViewController

Uitabbarcontroller

5 min read

#26 Swift — UITabBarController外觀(item, tintColor, badge, TextAttribute)
#26 Swift — UITabBarController外觀(item, tintColor, badge, TextAttribute)
Uitabbarcontroller

5 min read

Stephen Huang

Stephen Huang

15 Followers

Wish me luck on the way become iOS app developer!

Following
  • Michael Long

    Michael Long

  • 彼得潘的 iOS App Neverland

    彼得潘的 iOS App Neverland

  • Michal Malewicz

    Michal Malewicz

  • AlysssaDeutschland

    AlysssaDeutschland

  • 燮羽(will)

    燮羽(will)

See all (41)

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams