Sign in

A passionate  iOS developer. Write to record my learning and share the knowledge.

Packet sniffing tutorial for beginners: how to capture the packets sent and received by iOS Apps on your Mac

Photo by Kevin Ku on Unsplash

I’m recently doing an IoT project. Sometimes I have to investigate more complex problems that potentially happen in the network layer, so I use Wireshark to capture the network traffic between my iOS apps and IoT hardware.

Let’s see how to start packet sniffing using Wireshark!

Install Wireshark

Wireshark is free and open-source. You can download Wireshark from its official website https://www.wireshark.org/.

After completing the installation, you should see a screen like this, showing all the capture interfaces:


Write clean code with @propertywrapper in Swift

Photo by Christin Hume on Unsplash

“A property wrapper adds a layer of separation between code that manages how a property is stored and the code that defines a property.” — Swift documentation

It encapsulates extra logic to properties and limits access to the available property values.

@propertyWrapper was introduced to Swift in Swift 5.1. Now you can implement a wrapper and use a wrapped property in a more natural way without noticing the wrapper layer, as if it was a normal property. Let’s see how to work with this new syntax.

Imagine you are creating a Customer type that represents each customer’s data.

struct Customer…


Azure AZ-900 exam preparation guide and experience sharing

The city I live in is experiencing its worst moment of the pandemic and has been under quasi-lockdown since mid-May. I have got more spare time since working from home saves a lot of time commuting to the office. So I took this opportunity to take AZ-900 Microsoft Azure Fundamentals Exam!

The exam was updated on 9 November 2020. Some information and practice tests I found when preparing for the exam are outdated.

I have no experience of using Azure, and I have little knowledge of cloud computing service before studying for this exam. …


The 3 most commonly used skills of working with dates you must learn

Photo by Markus Spiske on Unsplash

Do you feel hard to get your head around Date(), DateFormatter(), DateComponents(), and other date-related types, but you just want your code to work as expected? This article will save you the trouble!

In this article, I will be focusing on the 3 most commonly used skills of manipulating dates:

  1. Create Date object with specific dates and times
  2. Parse an ISO 8601 value or a timestamp to a Date object
  3. Display date in a certain format

First, I will introduce how to create a Date object. …


Make a Trello board-style CollectionView and pass data to the TableView embedded in the CollectionView

Photo by Christina @ wocintechchat.com on Unsplash.

Inspired by Trello, I tried to make a Trello board-style CollectionView that presents a different data set in a different CollectionView cell. The demo below shows the final result:


Enrich your chart and emphasise the important information

Photo by Firmbee.com on Unsplash

In my recent article [Swift] Set Up a Basic Bar Chart Using iOS-Charts, I demonstrate how to set up a basic bar chart using a widely-used third-party library iOS-Charts.

Today we are going to take it to the next level. By adding some simple pieces of code, we can make the user catch the important information on your chart at once.

Since this article focuses on how to add a custom marker to the iOS Chart, I assume you already the prerequisite knowledge of building an iOS Chart and creating a custom view from xib. I will skip chart view…


iOS-Charts is a very flexible, easy-to-use third-party library, allowing you to highly customise your chart.

Photo by Lukas Blazek on Unsplash

I recently use iOS-Charts at work. It’s a very flexible, easy-to-use third-party library, allowing you to highly customise your chart.

This library is around 95% similar to its Android counterpart, making developing apps for both platforms much easier.

Here I use some high-income countries' birth rate data to demonstrate how to set up a basic bar chart using iOS-Charts.


Finally, I finished this eight-week course. As an iOS developer, naturally I chose iOS track.

Assignment 1: Pokedex

Specs:

Add searching function.

Add a button to keep track of which Pokémon have been caught and save the state in UserDefaults.

Create structs with types that match the keys and types returned by the API. Parse the JSON data and display Pokemons’ image and description

Some structs are added to help parse the JSON data. I have done some practices of this skill in Music App, so it didn’t take me much time to finish the parts of displaying pokemon image and description.

To…

Penny Ng

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store