fabiochiu/medium-articles huggingface dataset:
Integration Unity project as a Library in native iOS app
By: Krishna Kushwaha
Tags: Unity, iOS, Xcode

I have unity project and just wanna make as a library ( framework )simply.

Here few points make sure you noted steps by steps

Unity Project : Create unity project or use any exiting but UnityFramework supported only unity 2019.3 or later version. Hope you remove Unity ads framework from unity package manager. set valid bundle Id and signing profile team. uncheck Auto Graphics API , set script IL2CPP. Build platform section select iOS with Xcode version or default, put anywhere. NOTE : if you wana communication b/w native ios to unity or vise versa then create iOS/plugin and c# script in Unity project C# Script and iOS/plugin . you can change file name, function, parameter and 3d model game object according you. Embed Unity project : open unity export ios Build in xcode (Unity-iPhone.xcodeproj) and before Run check UnityFramework is there or not? Make Data folder target membership to UnityFramework, iOS/plugin(.mm,.h file) file to UnityFramework as a public (dropdown option). Add few line in Unity-iPhone/MainApp/main.mm file in main function after declare ufw [ufw setDataBundleId: “com.unity3d.framework”]; Export UnityFramework: if everything setup ready then run Unity-iphone on Real Device. if successfully run then you will get auto generated UnityFramework.framework so you can keep or Export in your system. How to use UnityFramework.framework in native ios App : create or exting iOS native app then Import and drag and drop in your app.

create .swift file for embedded unity put these file code or use this file

NOTE: three functions are import in embedded unity swift for call unity ShowUnity/HideUnity/sendUnityMessageToGameObject

6. Final Launch: in native ios you can call UnityEmbeddedSwift.showUnity() in viewDidLoad or launch after button press

@objc func onButtonPressed(_ sender: UIButton) { UnityEmbeddedSwift.showUnity() }

References

Here are some other tutorials that I have found to be useful. If you still need help, try these resources or project:

integration unity as a library in native ios app

Final Project from Github

Embedded Unity iOS swift

Unity Project in Swift Project

Thanks for reading….

https://www.linkedin.com/in/krishna-kushwaha/
Xcode UI Tests for SalesForce, Facebook and Twitter login screens in WKWebView
By: Seyit Kaya
Tags: Salesforce, Test Automation, iOS, Xcode, Swift

Xcode UI Tests offers us many solutions for testing the app from the service side to some automated scenarios varies jumping to a view via picker etc.

Testing on development make your life is easy

If your app has a login WebView page rather than native iOS Login view, your accessibility identifiers on text fields or buttons wouldn’t recognize. Yeah this is an issue which you need handle and find an another approach.

Using Selenium can help you with a few lines of Python codes but this is another story and this article not about it.

I worked on Salesforce login but you can use for Facebook, Twitter just with very little coordinate adjustments. Main point is exactly same.

SalesForce Login Screen opened by WKWebview with Simulator

Okay let`s begin. First of all, set a breakpoint and write the code below and pick the positions which you need just like a sniper. You should write that code to your debug area;

po print(XCUIApplication().debugDescription)

Or you can use Debug > View Debugging > Capture View Hierarchy to see where you are going to shoot 🙂

That works seems like you have to deal with some HTML code but believe me that is not a big deal. You should have been detected positions before the Xcode UI process which we will use below.

After the detected vector positions instantiate it and turn it to XCUICoordinate object.

You can use pretty straight forward extensions which I used below for some delay to control the login process.

Finally, the method which you will trigger by pressing the baklava shape button just on the line number for ready. Yeah baklava shape, don`t you agree with me ? 🙂

Most lovely image for XCTests 🙂

Get your coffee and run the code. XCTest will be handling the login process for you. If you wish to enhance your automatization scenario; go head and add right after the login method.

You can find all codes in the sample project file, Have a nice coding.

https://github.com/seyitcodeit/SalesForce-Login-with-XCodeUI-Test
Bermain dengan Access Control pada Swift
By: Auriga Aristo
Tags: Restrictions, Access Control, iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
使用 Storyboard 實作歌詞 App (part. 2)
By: Terence Tw
Tags: iOS, Storyboard, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
iOSアプリ開発 UI実装であると嬉しいレシピブックシリーズに関するアップデート情報
By: Fumiya Sakai
Tags: iOS, Uikit, Xcode, UI, Swift

Alamofire/Alamofire

Alamofire is an HTTP networking library written in Swift. In order to keep Alamofire focused specifically on core…
使用 Storyboard 實作歌詞 App (part. 1)
By: Terence Tw
Tags: iOS, Storyboard, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
UILabel裡的Line Breaks、Autoshrink、Shadow
Tags: Uilabel, Xcode

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
設定App Icon
Tags: Icon Design, iOS, Xcode

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
The 6 Swift Extensions I Use in Every iOS Project
By: Mats Bauer
Tags: iOS, Xcode, Mobile, Programming, Swift

1. Dropping Shadow Under UIView

When implementing modern designs, dropping a shadow under a UIView is often required. Instead of having to write multiple lines of code for each view, I use an extension:

Of course, every project might require some minor changes to the shadow style, but that can be changed in a central place.
SwiftUI 產生 Binding 的各種方法
By: 彼得潘的 Ios App Neverland
Tags: iOS, Swift, Xcode, Swiftui

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Fastlane + Xcode Server 一鍵打包上傳App(iOS)
Tags: Developer, Fastlane, iOS, Xcode, App

Fastlane

首先，Fastlane是一個持續整合工具，他可以幫我做完一連串需要人工處理的事情，比如說

我要將開發好的 App 上傳到 iTunes Connect

要做到這件事情我需要…

開啟專案資料夾 按下指令 git pull 最新程式 接著按下指令 pod install Xcode開啟專案 按下Product>Archive等待打包完成 接著在Organizer介面一陣操作，上傳到iTunes Connect

上面這些步驟應該很熟悉吧？在這些步驟中，有很多是需要等待它完成後，然後操作它下一步，不然就會停在那邊等。

所以會使用Fastlane原因是，只要將配置檔案設定完成後，只要一行指令就可以做到自動化打包

安裝Fastlane

Fastlane官網

***請安裝在作為Server的那一台上面***

設定Xcode for Fastlane，在Terminal輸入

xcode-select --install

跟著指示安裝完成後，接下來安裝Homebrew，複製下方指令貼到Terminal執行

接著用brew安裝Fastlane

brew install fastlane

初始化專案

cd {你的專案路徑}

fastlane init

執行初始化一開始會需要選取你的目的，這邊先選擇2. Automate beta distribution to TestFlight，選項的差別只有一開始設定檔預先填寫的內容而已，後面會提供完整的設定檔，所以先選擇2就好

再來要輸入你的Apple ID 和密碼，登入是用於上傳到App Store的憑證

接著，會詢問是否要幫忙在App Store新增App，這邊都選擇否，後續請到iTunes Connect自己新增，這邊不要讓Fastlane幫你設定。

看到這個畫面，代表你已經設定完成。

看看你的專案底下，應該會出現一個fastlane的資料夾，底下有一個Fastfile，這個檔案會依序執行你想要的功能(例如git commit 或 上傳app store)，詳細設定可以來這邊看看，相當多功能可以使用

打開Fastfile，會看到下面這一段

default_platform(:ios) platform :ios do

desc "Push a new beta build to TestFlight"

lane :beta do

build_app(scheme: {你的專案scheme})

upload_to_testflight

end

end

這邊的lane :beta，這個就是指令的名稱，就是要在Terminal輸入fastlane beta後面的名稱，輸入fastlane beta後就會執行下方兩行build_app、upload_to_testflight。

這兩行的意思是：

build_app會執行Archive產生ipa

upload_to_testflight會將ipa上傳app store

其他更多指令就這邊看看

接著把下方的設定貼到Fastfile

default_platform(:ios) platform :ios do before_all do reset_git_repo(force: true) git_pull() cocoapods() end after_all do |lane| end lane :release do ipa = build_ios_app( scheme: "{專案scheme}", workspace: "{專案名稱}.xcworkspace", output_directory: "./build/release", clean: true, silent: true, configuration: "Release" ) pilot( team_name: "{Signing team name}", username: "{Apple ID}", skip_waiting_for_build_processing: true, ipa: ipa ) slack( message: "App upload successfully", channel: "{channel name}", slack_url: "" ) end error do |lane, exception, options| slack( message: "Build Error", pretext: "Exception: #{exception}", success: false, channel: "{channel name}", slack_url: "" ) end end

解釋一下上面這段

這邊的 before_all 就是在執行前會觸發的區域，整個執行流程如下

reset_git_repo （先將專案git先重置） git_pull (git抓取目前最新程式) cocoapods (有用到cocoapod，他會下指令pod install，如不用可以刪除) build_ios_app (重點這行，打包app) pilot (重點，上傳到app store) slack (成功後slack發一則訊息，如不用也可刪除)

error那行就是在執行中碰到任何錯誤會觸發的區域，這邊有錯誤使用 slack發送訊息

請依照需求調整設定，接著在專案底下輸入

fastlane release

順利的話跑一段時間後，就會看到TestFlight跟你說上傳成功可測試了！

有任何錯誤看一下錯誤訊息google去一個個修正喔

Photo by Jason Wong on Unsplash
在 SwiftUI 如何將 array 的成員變 Binding
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift, Swiftui

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
利用 delegate 讓不同元件溝通，以資料回傳到前一頁 controller 為例
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
How to Create a Revolut-Esque Cards Collection View on iOS
By: Burhan Shakir
Tags: iOS, Xcode, Mobile, Programming, Swift

How to Create a Revolut-Esque Cards Collection View on iOS

Photo by Arnel Hasanovic on Unsplash.

This article is to help you understand how you can customize a UICollectionView layout by subclassing a UICollectionViewFlowLayout .

We’ll get into insets and line spacing to customize the spacing around the cells and use the UIScrollView protocols to add a snapping behavior to each cell when a user scrolls. We’ll also add in a scaling animation to the cells when the user is swiping over them to give it a bouncy feel.

We’ll be creating an In-App Wallet that is similar to what Revolut has (i.e a collection of credit cards that the user can swipe through, centering the selected card and displaying a small part of other cards):

This is what you will achieve by the end of this article.

Let’s break down the problem into three parts:

Add spacing between cards such that a part of the previous and the next card is visible (centered pagination).

Add a snap-on-scroll behavior so that only one card is in the center of the screen.

Scale down the selected card when the user starts scrolling and scale up the new card on scroll end.

So let’s get started. 🥳
研究 UIImageView 的 Content Mode
Tags: Content Mode, Uiimageview, Xcode

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
將資料回傳到前一頁 controller 的問題
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
10 Different Ways to Loop in Swift
By: Mark Lucking
Tags: iOS, Xcode, Mobile, Programming, Swift

Ten Ways to Loop

The humble loop

This does what you might expect it to do: print out the directions one at a time on different lines.

The humble loop, again

This of course does the same but uses a more Swiftish syntax, certainly one that will get you set up for thinking in coding in SwiftUI.

A sort of stacked loop

This is an interesting variation on the idea. Imagine I want to loop through my directions, not in nanoseconds as I have been doing, but on demand. Of course, this version will loop automatically (in nanoseconds) because I used a repeat/while — but I am sure you get the idea.

The recursive loop

This one loops through our directions using recursion. I cannot help being a little nervous about recursion. It uses more resources than a simple loop and should not be used unless it really makes sense.

Simple skipping loop

Of course, maybe you don’t want to print every direction out. Here is an unusual use of the guard statement to select even ones only.

One more simple loop I missed

This loop uses a while condition to check each time it prints out an element in our array. This one is special because, using it, you could change the contents of the directions array without worrying. In all the previous cases, that simply isn’t an option.

The indexed loop

OK, but what if you need the index too? This will do the trick.

The indexed loopII

Same again, but this one uses a Swift function to extract the index values.

The indexed loop, less code

Again, an arguably more Swiftish version. Of course, you don’t need the loop for enumerated ; you can simply use it on its own.

Another version of a loop with an index

This one, like the last, is a nice efficient, short piece of code.

One more I found on Stack Overflow

An interesting approach, although I am not sure how obvious its implementation is ultimately.
Setting up React Native Vector Icons for IOS
By: Semih Durmus
Tags: React Native Vector Icons, Xcode, React Native

First of all always remember to see the official document for React Native Icons. This article will guide you specifically for IOS, and in an simple way that everybody can follow easily.

Step-1: Installing the package

Add a new terminal in VS Code and type one of the following codes according to your choice between npm or yarn.

$npm i react-native-vector-icons or $yarn add react-native-vector-icons

After the installation, it is better to check the package.json file if the react-native-vector-icons package is installed successfully.

See the dependencies section

Step-2: Copying font files to Xcode

Open Xcode by opening the file in the following path:

project-name-folder/ios/project-name.xworkspace

…or you can just start the Xcode and open your project folder.

Open a project or file

Now, right click on the folder with the project name (in the example below the project name is workspace) and choose ‘New Group’. Then rename the file you’ve just created as ‘Fonts’.

Open your main project folder and go through node_modules/react-native-vector-icons/Fonts. You will see the listed fonts as in the screenshot below.

From the list of .ttf files drag and drop the vector icon fonts of your choice(s) to the Fonts folder you created at Xcode. It’s wise to decide on the icons to use before, and upload just the font families including those icons. You can find the list of icons in the react native vector icons directory.

Once you drag the selected font files, make sure that ‘Copy items if needed’ and ‘Create folder references’ alternatives are selected. Then click ‘Finish’.

Adding font files to Xcode

Step-3: Setting up the Xcode

Find and click on the ‘Info.plist’ file under the project-name folder. Then click the ‘+’ button on the top row (Information Property List) and choose ‘Add row’ from the list. Rename the created row as ‘Fonts provided by application’. It should be an auto-completed text, but no worries if it is not.

Add a row -> Fonts provided by application

Click on the + button next to the ‘Fonts provided by application’ row and create as many items as the number of fonts you wish to use in the app. Write the full name of the font file (i.e. MaterialCommunityIcons.ttf) to the value section of each item.

Writing the name of the font file to value section

Step-4: Pod Installing

Now it’s time to update the pod. From the bash terminal in VS Code, run the following codes:

$cd ios

$pod update

$cd ..

Go back to Xcode. From the menu bar above, select ‘Product’ > ‘Clean Build Folder’ then Run the app.

Clean Build Folder and Run

Step-4: Use the Icons

Pick the name of the icon from the icons directory.

Name of the icon

Then use it as shown in the code below.

An example use of the vector-icons

You can see many more options for using vector icons in the document.

Step-6: Enjoy the icons

Thanks for reading. You might want to check Clarusway blog pages for more informational articles.
用 GIPHY Capture 簡單錄製 iOS App 操作過程
By: Terence Tw
Tags: GIF, iOS, Giphy, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Knowing when your iOS app’s provisioning profile is going to expire
By: Chris Mash
Tags: iOS, Provisioning Profile, Swift, Xcode

As iOS devs I’m sure we’ve all come across the problem of the development version of our app suddenly failing to launch for our testers.

For an app that’s actively in development it may not be a hugely common issue as your latest build will always have your latest certificate and profile, so when that gets renewed it goes straight into your app. But if you’re like me and have a number of your own personal apps on your device that aren’t actively in development and will perhaps never make it to the App Store then it can be very annoying when they’re working one day and without warning they stop working because their provisioning profile has expired.

I started wondering if there was a way to get a warning when your profile is getting close to expiring, so you can get it sorted before you get locked out of your app.

If you have a snoop in the .app produced by Xcode you can see there’s a embedded.mobileprovision file, which is the provisioning profile the app was build with. If you open it up in TextEdit (or similar) you’ll see there’s a load of unreadable data but a fair amount of XML and an entry for ExpirationDate .

This file is fully accessible for you to load from your bundle at runtime, so your app can load it and parse out the expiration date.

N ote: when running on the simulator the provisioning profile isn’t there (because it’s only required for a real device) so you won’t be able to read it from the app’s bundle unless you’re using a real device.

With an app able to get its profile’s expiry date it can do things like:

Display the expiry date somewhere for user’s to check

Show a warning alert on launch if the expiry date is within a certain amount of time

Schedule a local notification for a certain amount of time before expiry, so user’s don’t even need to run the app to get their warning

I also played around with a Run Script build phase to check the provisioning profile’s expiry date so that a build warning could be generated if it was expiring within a certain number of days. It can be annoying for anyone receiving an ad hoc build of your app to only have a few days to play with it!

N ote: when building on the simulator the provisioning profile isn’t there so the warnings won’t appear in Run Script build phases unless you build for a real device or at least the ‘Any iOS Device’ build target.

This all works on iOS, watchOS, tvOS and macOS!

I’ve bundled all this up into a Swift Package on GitHub that you can feel free to use if you see benefit in this!
利用 Airtable 製作 iOS App 連結的後台資料
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
將 AirTable 不同的 table 做關聯
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
學習Swift之旅#9 — 串接第三方 API，解析 JSON 資料，轉換成自訂型別顯示
By: Vivienne Chen
Tags: Swift, Xcode

彼得潘作業#15–4 研究有哪些回傳 JSON 格式資料的有趣第三方 API，讀取資料做一個 App 。

作業目的

學習利用 URLSession 抓取後台的 JSON 資料，利用 JSONDecoder 和 Codable 將 JSON 資料生成自訂型別。

流程

以 iTunes 搜尋 Taylor Alison Swift 當例子，API 的網址為

https://itunes.apple.com/search?term=TaylorAlisonSwift&media=music

後台回傳的資料利用網站 JSON Editor Online 顯示後如下:

按照 iTunes 回傳的 JSON ，第一層是 object，object key results 的資料是 array，array 裡裝了許多歌曲 object。

因此定義了型別 SearchResponse 對應第一層的 object， StoreItem對應歌曲的object，並將 property results 的型別宣告為 [StoreItem]，說明它是 array。

這裏將 SearchResponse & StoreItem 分開定義(也可寫一起定義)。

struct SearchResponse:Codable {

let resultCount: Int

let results: [StoreItem]

} struct StoreItem:Codable {

let artistName: String

let trackName:String // 曲名

let collectionName:String? // 專輯名稱

let previewUrl:URL

let artworkUrl100:URL // image url

let trackPrice:Double? // 價錢

let releaseDate:Date

let isStreamable:Bool?

}

其中，StoreItem 的部分 property 被宣告為 optional，因為 JSON 裡有些 key 不會每一筆資料都有，像是trackPrice，不是每首歌都可以買，所以不一定有 trackPrice。因此將不一定會有的 collectionName、trackPrice 及isStreamable 設為 optional。如果沒有設為 optional，到時候一旦發現沒有這些欄位，將造成轉換失敗。

從回傳的資料得知時間格式採用 iso8601

抓取網路資料，使用JSONDecoder將JSON轉換成SearchResponse型別的資料。

成果

顯示音樂清單

參考資料

之後補充

[作業 6: viewDidLoad，array & custom controller class] 6–2 : 模仿 iOS 的 Music App 製作情歌點唱機，可忽略進階功能
從 Playground 調色去背圖片
By: Boting Wang
Tags: iOS, iOS App Development, Xcode, Playground, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
利用 mask 設計特別形狀的圖片
By: Boting Wang
Tags: iOS, iOS App Development, Xcode, Playground, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
#135 利用 Airtable 開發 iOS App，比方電影 App
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
讓 present modally 全螢幕顯示下一頁
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
[iOS App Practice]#6 musicPlayer (parse iTunes API)
By: Serena Cheng
Tags: iPhone, Apps, iOS, Xcode, Swift

Practice:

* making an API call with URLSession and DispatchQueue

* using IBSegueAction to pass data to the next controller

* creating list with UITableViewController and UITableViewCell

When you enter the artist’s name, you are searching artist through the iTunes API, and the API returns the song that you can play. I skip the parse API part if you want to know you can refer to my GitHub at the bottom of this page.
訂飲料2.0版 - 簡述使用SheetDB來讀取/上傳資料. 使用SheetDB做Read功能
By: Andy Lin
Tags: iOS, Swift, Xcode

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Long Story Short: How to fix Xcode Data Model Inspector's graphic interface
By: Tugrul
Tags: iOS App Development, Swift, Xcode

Hey, I could write this on Stack Overflow, but wanted to write small nuggets like these on Medium to keep track. This series will be called Long Story Short. I aim to make stories where long stories of un-productivity become short.

So, as you know, XCode utilizes OODb (Object-Oriented Database) with Core Data, and provides a graphic interface to create entities, relationships etc. with ease.

However, I have been having this problem where the details of Entities were not visible. Unfortunately, I have not grabbed a screenshot, but if you are having a similar problem:

Try upgrading the OS.

Drop the beta version of Xcode.

Adjust the scale of your display to normal.

This worked for me. Let me know if you are having the same/similar problem with Xcode.
Xcode 12.3 模擬器的黃色問題
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
How do I clear more space on Mac and delete the incomplete download from App Store
Tags: Mac Disk Space, App Store, Cache, Mac, Xcode

first of all, take a look at your file system and how much space they occupy. type this command in a terminal:

Remove the indesirable files

du -sh *

then remove the files that you don’t need

rm -rf <directory-name>

or

rm file-name

Remove The caches.

type this command in a terminal:

cd ~/Library/Caches

clear the purgeable area

create a huge file that will force macOS to clean purgeable files to free you space. type this command in a terminal:

dd if=/dev/zero of=~/hugefile bs=15m

It will create a file called hugefile in your home folder

This command takes a long time to allocate the memory, you can also stop it when it’s 5~10GB and duplicate the file CommandD to create copies and speed up the process.

Then, you just need to delete the files, obviously.

rm hugefile

That’s it :) … ˆ-ˆ
Entry, “:CFBundleIdentifier”, Does Not Exist
By: Amala Gopal
Tags: iOS, Xcode, React Native, Error

After updating Xcode to the latest version 12.x and running the App using react-native run-ios, received this error message:

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):

Failed to install the requested application

An application bundle was not found at the provided path. Provide a valid path to the desired application bundle.

Print: Entry, ":CFBundleIdentifier", Does Not Exist

error Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier

Print: Entry, ":CFBundleIdentifier", Does Not Exist

Looking at the error (screenshot above) I have noticed that the app path is different than it was built:

Build path: “/Users/MyUser/Library/Developer/Xcode/DerivedData/MyApp-eomrrfplnwdaolevrnjtypyrwyci/Build/Products/Debug-iphonesimulator/MyApp.app”

Installing path: “/Users/MyUser/Library/Developer/Xcode/DerivedData/MyApp-eomrrfplnwdaolevrnjtypyrwyci/Build/Products/Debug-iphonesimulator/MyApp Staging.app”

For some reason react-native cli is trying to install different name of the app than it supposed to be. A quick workaround is just to change Product Name under Packaging in the Build Settings of Xcode:

Product Name

The downside of this quick fix is that your app might not run on Xcode and you end up receiving some other issues. The proper solution is to update react-native cli to the latest version: https://github.com/react-native-community/cli#updating-the-cli

I have removed all entries of @react-native-community/cli from yarn.lock file, removed node_modules and run yarn install. In addition, I had to install @react-native-community/cli and react-native-community/cli-platform-ios packages using:

yarn add @react-native-community/cli

yarn add @react-native-community/cli-platform-ios

Just make sure you have installed the latest version of React Native CLI by running:

And do not forget to update pods with pod install in the ios folder.

Done, now the React Native CLI recognises the app path and is working again!
自訂 delegate 範例 — Develop in Swift Data Collections 重點整理
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Walkthrough/Onboarding
Tags: iPhone, Swiftui, Swift Programming, Xcode, Swift

Walkthrough/Onboarding SwiftUI Project

Walkthrough/Onboarding is an app created with swiftUI inside of Xcode.

What I learned

What I have learned from creating this demo project is, creating subview, the import of images, app architecture, and viewControllers.
定義 controller 的 init 設定 delegate
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Sticker View pada Chat app
By: Muhammad Alfiansyah
Tags: iOS, Xcode, Keyboard, Chat, Swift

Power is dangerous. It corrupts the best and attracts the worst. Power is only given to those who are prepared to lower themselves to pick it up-Ragnar Lothbrok
When com.apple.dt.SKAgent is hungry on your CPU
By: Mykola Bilovus
Tags: Xcode, Programming, Development, Macos, Productivity

So, you do a macOS development. And of course, you use the Xcode for your programming tasks.

Xcode often times starts indexing source files and run the com.apple.dt.SKAgent process in the background.

This process can be very hungry on your CPU, overtaking all the processing power from other applications. You experience the whole system slowdown and unresponsiveness, and annoyance might hit your productivity ;)

Since you need syntax hints while programming, simply killing the indexing process is not what you want.

Your silver bullet is to lower indexing process’s priority, thus allowing the system to serve processing power to your other lovely macOS apps.

Here is a single command to run in the terminal:

$ sudo renice 20 `pgrep com.apple.dt.SKAgent`

This will set com.apple.dt.SKAgent process’s priority to the lowest value.

That’s it.

Enjoy your coding!)
Dribbble: Social-App-Screen Part-4.1
Tags: Swiftui, Swift Programming, Dribbble, Xcode, Swift

I Want to Hear From You

Thank you for reading, I’d love to hear your feedback. Show me some love and give claps.
#134 數學運算小遊戲
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
練習調色大師：切換改變顏色
Tags: iOS, Swift, Xcode

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
從 RGB 判斷顏色深淺(dark/light)
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
iTMSTransporter: Could not create the Java Virtual Machine
By: Amala Gopal
Tags: Fastlane, React Native, iOS, Xcode, Error

After updating Xcode to the latest version (12.x) I received the following message during Fastlane deployment:

[10:51:13]: [iTMSTransporter] -Djava.ext.dirs=/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Versions/A/itms/java/lib/ext is not supported. Use -classpath instead. [10:51:13]: [iTMSTransporter] Error: Could not create the Java Virtual Machine. [10:51:13]: [iTMSTransporter] Error: A fatal exception has occurred. Program will exit. [10:51:13]: iTunes Transporter output above ^ [10:51:13]: The call to the iTMSTransporter completed with a non-zero exit status: 1. This indicates a failure.

The first thing which I have done was to delete a cache folder of iTMSTrasnporter — ~/Library/Caches/com.apple.amp.itmstransporter and then update the Fastlane to the latest version:

sudo gem install fastlane

Success! The app deployment works again:
@available 裡的 deprecated: 100000.0 是什麼意思
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift, Swiftui

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
SwiftUI List içindeki çizgileri(line seperator) kaldırma
By: Batuhan Baran
Tags: iOS, Xcode, Swiftui, Swift Programming

Batuhan Baran - Atılım Üniversitesi - Güvenevler Mah., Ankara Province, Turkey | LinkedIn

View Batuhan Baran's profile on LinkedIn, the world's largest professional community. Batuhan has 2 jobs listed on…
Implementing Dark Mode for iOS: attributed labels workaround
By: Tim Velichko
Tags: Dark Theme, Interface Builder, Nsattributedstring, Xcode, Swift

As you may see on the screenshot above, Xcode’s Interface Builder doesn’t associate Named colors with the color editing menu for attributed labels.

It only opens the system palette for RGB or other standard color formats. That’s why such a preset doesn’t provide us automatic colors change when switching iOS theme. Quick research didn’t bring anything rather than moving all the formatting to Swift code and subclassing UILabel. But for our various label styles, it required substantial efforts. Especially as for a pet-project :)

A lazy developer inside me aimed to find a quicker solution. And… spoiler… it was found!

My idea was based on the fact that automatic color change work for Plain labels and all other UI controls. So it might be just a limitation of Interface Builder. I opened Storyboard’s source code to check color implementation for Plain labels and compare it to Attributed ones. A color tag of the Plain label had a name attribute with the specified color name. However, the Attributed label contained text color definition with RGBA and a couple more attributes (see screenshot below).
選擇 iOS App 執行或預覽的裝置
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
iPhone Biometric (FaceID) do not work in several apps which used same code base. Some notes for Apple Sign-in Flutter.
By: Nghia Tran, Silas
Tags: Flutter App Development, Flutter, Iphone Faceid Issue, Xcode, Apple Sign In

Some notes for Apple Sign-in

And let’s move on some things you should keep in mind when dealing with Apple Sign-in.

You just have only one opportunity to retrieve user’s apple email.

It was already clearly noted in dependency but I thought there are still some developers (like me 🙄) have skipped this. So I highly raise up this issue such a way to let other one does not silly ask why credential.email after execute SignInWithApple.getAppleIDCredential is always null . ( I thought it would have no one else except me 😵).

For security issue, Apple will only provide email on the first authorization, Up further times, userIdentifier will be the only data you got when sign-in again, so you should store this data securely and carefully on your server.

Face ID will not work in multiple installed apps if those are built from one code base

In some cases, we need to build a lot of different apps by using one code base. So you will face an issue like: App A, B, and C used 1 code base and installed in device, but just App C works with device Face ID, the others will keep staying at the grey icon below with no detection.

Face ID was freeze with Apple Sign-in

… so for this case, let's create a new XCode Target for it !

Revise how to create XCode Target

Guess you all know about how to duplicate current target.

How to create Target in XCode Flutter

And remember to use the correct Info.plist file for corresponding target.

Update Pod File after that

When you run Flutter project, it will re-run pod install , so if you didn’t change your Pod file to your new Target, its framework will be lost and caused crash after then.

Update

target 'Runner' do

use_frameworks!

use_modular_headers!



flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

end

To

def shared_pods

use_frameworks!

use_modular_headers!



flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

end



target 'Runner' do

shared_pods

end



target 'Runner-Copy' do

shared_pods

end

Create shared_pods to make sure Pod will apply only one config to all targets you have.

These are some experience in me when playing around Apple Sign-in in Flutter, if you think there is something more interesting, let’s bring up here.

Happy coding!
Xcode 專案名稱不要取的幾種名字
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Xcode: 8 SwiftUI Keyboard Shortcuts That Will Make You Even Faster
By: Manuel Schulze
Tags: Swiftui, Xcode, Mobile, Programming, Swift

Xcode: 8 SwiftUI Keyboard Shortcuts That Will Make You Even Faster

Photo by Aryan Dhiman on Unsplash.

As software developers, we not only love to build applications, but we also love to find and use the best tools available in order to do so.

As iOS developers, we are very lucky. With Swift, we have a modern programming language in our tool belt. Additionally, Apple released a brand new, modern, and declarative UI framework in 2018 called SwiftUI.

That means we are well prepared for the future with the instruments we have.

However, we also love to work efficiently with the technologies we have. One easy way to increase our productivity and get more code written is to use keyboard shortcuts.

Sadly, there are not that many keyboard shortcuts available for SwiftUI (or they are not documented that clearly). Nevertheless, getting to know the ones that are already available is a good way to prepare for the future while having more time for the things that really matter.

You can accomplish the following things with keyboard shortcuts:

Resume the preview feature of SwiftUI. Show/hide the preview pane. Open the library of controls, modifiers, etc. Open the Quick-Actions menu. Show the inspectors of the SwiftUI view. Get quick access to the attribute inspector of a view. Select the preview destination (devices). Switch to the previous or next preview destination.

There are tons of helpful Xcode shortcuts out there that can be used when creating UIKit and SwiftUI views. However, this article will cover the ones that are specific to SwiftUI.
APP練習－Storyboard 動物森友會
Tags: iOS, Swift, Xcode

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Slider 練習: DISNEY風格
Tags: iOS, Swift, Xcode

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Easy Initializers #XcodeExplore
By: Alireza Eram
Tags: Initializer, Swift Programming, Xcode, Decodable, Swift

We can create initializer in 2 steps instead of writing all those boring repeated codes:

click on class name + cmd

2. Click on Generate Memberwise Initializer and here we have it:

Xcode is smart enough to differentiate between stored and computed properties. While writing unit tests for Codables this is very handy and saves time.

have fun ;)
練習製作下雪動畫：聖誕節快樂
Tags: iOS, Swift, Xcode

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
練習漸層 CAGradientLayer的設計
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
iOS SDK 的繼承例子
By: 彼得潘的 Ios App Neverland
Tags: iOS, Xcode, Swift

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
So he was sexually assaulting women.
Tags: Sexual Assault, Life

So he was sexually assaulting women. Can’t say I feel bad about his death. At least the women in that vicinity no longer need to worry about being sexually assaulted by him. I have a zero sympathy approach when it comes to this type of men. He should’ve been in prison a long time ago.
Hunker for Flesh- Poem
By: Campbell Christensen
Tags: Sex, Women, Sexual Assault, Relationships, Poetry

It is so bizarre looking at your own body as a piece of meat for a man to devour.

To see him look at you the way a lion looks at a dead animal.

His feast is about to begin.

He looms over his catch and begins to feed.

His fangs dig deeper into your skin.

His hands run higher up your thigh.

Your flesh is ripped clean off the bone.

His meal is over and he cleaned his plate.

His hunger has been satisfied… and you are left there

alone.

The meat for the man with its purpose served on silver bed sheets

with blood stains left from the mess he did not want to clean up.
But He Wouldn’t Do That.
By: Lidya Saliba
Tags: Open Letter, Sexuality, Sexual Assault, Culture, Sex Positivity

There wasn’t something going around.

But I see why he’d say that.

Because it’s easier to call them rumours than to pay closer attention.

The thing going around was women sharing stories of their experiences with him. Either in bed or soon after with messages the next day demanding he not be spoken to like a rapist.

“Look at it from my perspective”

“Look at it from mine”

Said the man who took his clothes off first.

Calling them rumours might ease your own concerns and pave the way for the next casualties but I hope your eyes dart when you see him talking to a woman at the bar. And feel a drop in the pit of your stomach when he brings up a girl he fucked.

You said I’m not a liar then what does that make the truth going around?

Because if what that girl told me was true then your friend’s a fucking rapist.

And maybe you don’t know him as well as you thought you did.