Swift

Command Pattern in real-life

Command Pattern in real-life

Learn How To Use Command Pattern in Swift

Recently I have a problem in my team whereas the analytics function become scattered. Some other team create their own function and handling their own caching for tracking the events, and some even create multiple similar function across the modules only for analytics, until then a problem arises. Recently I have had a problem in my team whereas the analytics function becomes scattered. Some other team create their function and handling their own caching for tracking the events, and some even create multiple similar functions across the modules only for analytics, until then a problem arises.

Analyze HTTP Traffic with new HTTP Instrument

Understanding new HTTP Instrument Xcode

WWDC21 has been finished last week with over 200 sessions. Most of the time we heard about SwiftUI session or about Async Await. However there are also interesting session about debugging that has been described by Keith Harrison here. In this article I would like to focus on one of the underrated session which is Analyze HTTP Traffic in Instruments. I also write this article in WWDC Notes. All content copyright © 2012 – 2021 Apple Inc.

Testing In-App Purchases Locally in Simulator

Implementing Store Kit in Swift

During development, we will come into a phase where we would like to test out our In-App Purchases. However, most likely we ever heard a myth that IAP only works with devices to test it out with an internal tester account. Turns out during the process of the creation of Tripzy, I found a way to test our IAP in a simulator without any hassle. Keep in mind there will be some limitations of course if we are testing against the simulator.

Enhance Factory Pattern capabilities for DI in Swift within 3 minutes

Implementing Factory Pattern in Swift

Factory pattern is one of the common patterns in a programming language. It is one of the creational design patterns that provide a high level of flexibility for your code. One of the interesting use cases that could make Factory pattern become a handy tool to use is Dependency Injection. Normally whenever we want to inject an interface as a dependency on an object, we could easily pass it through the initializer or set it from the property.

Understanding Proxy Pattern in Swift within 5 minutes

Implementing Proxy Pattern in Swift

The proxy pattern is one of the few underrated patterns that nobody really talks about in iOS. A proxy pattern is one of the structural design patterns that lets you provide a substitute or placeholder for another object. A proxy has total control and access to the original object, and let the proxy object do some magical stuff with the original object and restrict the access to it, however, the one who uses a proxy object, won’t have any knowledge behind the scene.

Fun Debugging in iOS — Understanding the GUI in 3 minutes

Learn how to use easily debug in Xcode

After we have understood the basic concept of LLDB commands now it is taking time to understand the full GUI of Xcode debugging. Let see the picture above. Once you have put a breakpoint on any lines of code in your applications, you will see a similar screen as above. The top one is our code panel, which indicates where is our breakpoint located The bottom left panel is our quick look panel, we can see our current state of the object in either class or function level at the moment the code is being halted

Fun Debugging iOS — Basic Part (LLDB) in 3 minutes

Learn understand basic concept of LLDB in Xcode

Have you ever wonder how to debug your entire code in the proper way? But sometimes we don’t know in-depth detail about how does it work behind the scene? In this multiple series of articles, I am trying to spread multiple articles into specific chunks of debugging part, start with the basic / foundation part of debugging in iOS. Normally we will have multiple topics covering all areas, start with LLDB debugging and end with Logging.

Xcode handy “Move and Share” breakpoint in 2 minutes

Learn how to easily debug in Xcode

Do you know that we can actually simply share our breakpoints with our colleagues at work? Xcode provides us with the capability to share it. This share function is very handy if we want all colleagues to have a similar breakpoint. Some breakpoints that worth sharing are Exception breakpoint, Runtime breakpoint, and some Symbolic breakpoints. Let see how it works Go to your debug navigator panel on the left panel

Symbolic Breakpoint Xcode in 2 Minutes

Use Symbolic Breakpoint for debugging

Once upon a time, while I was debugging my code, I found out an annoying warning comes up like below [TableView] Warning once only: UITableView was told to layout its visible cells and other contents without being in the view hierarchy (the table view or one of its superviews has not been added to a window). This may cause bugs by forcing views inside the table view to load and perform layout without accurate information (e.

Fun usage of Generic implementation in Swift

Implementing Generic in Swift

Most of us know that generic in programming means we able to do something not limited to one specific type but has more wide selection on the same basis. The most common examples are Queue or Stack use cases. Let say we would like to implement an implementation of both problems not limited to one type of data type, we would like to use a Generic way to solve this problem like the code below