Home About Contact

 

Navigation bar title style, color and custom back button in SwiftUI

post thumbnail techchee

5 min read We’ve seen how to simply create NavigationView and NavigationLink in SwiftUI to allow you to push and pop screens. Now, we look at how we can set the title, change the navigation bar color and the back button etc.

Posted on 25 Jan 21  

How to create custom View modifiers for better code reusability in SwiftUI

post thumbnail techchee

5 min read SwiftUI View comes with a range of built-in modifiers, such as background(), frame(), cornerRadius(), shadow() etc, which allow you to change the view from its original appearance or behaviour. Besides the built-in modifiers, you can also create your own custom modifiers.

Posted on 17 Jan 21  

How to use function that returns some View to increase SwiftUI code readability

post thumbnail techchee

3 min read To have better readability for my SwiftUI code, I’ll always move some complex parts in my SwiftUI code to some dedicated functions. Especially those parts that need to display different views on different conditions.

Posted on 11 Jan 21  

Push and pop screens with NavigationView in SwiftUI

post thumbnail techchee

4 min read In iOS development, we always have our apps designed in a way letting users to navigate between screens. Such as in the UIKit, a UINavigationController is used to push to another ViewController and pop back from it.

Posted on 10 Jan 21  

Useful extension functions to decode Json from Bundle and remote URL with SwiftUI examples

post thumbnail techchee

5 min read Here are two useful extension functions for decoding Json data into structs or objects of any type. The first one is an extension function of Bundle for decoding any JSON file stored in your local bundle. The second one is an extension function of URLSession for decoding any JSON data from remote URL.

Posted on 04 Jan 21  

JSON parsing and examples of creating views in loop with SwiftUI

post thumbnail techchee

4 min read Most of our apps need to deal with JSON parsing these days. Especially when your apps need to load data from REST API which provides data in the form of JSON. With SwiftUI, the use of ForEach and List that allow the creation of views in a loop with ease, making it better to have […]

Posted on 02 Jan 21  

Creating views in a loop with ForEach, Identifiable and List in SwiftUI

post thumbnail techchee

2 min read In SwiftUI, you cannot use a control flow statement within a ViewBuilder closure. For example, you need to loop over a collection of data and create views accordingly. The screenshot below shows that a typical for loop in swift code is used but your Xcode will show you error as below.

Posted on 27 Dec 20  

List and ScrollView in SwiftUI

post thumbnail techchee

3 min read In UIKit, we use UITableView to display a single-column, vertical and scrollable rows of contents and UIScrollView to display contents that will not fit entirely on the screen, which then allows them to be scrollable either horizontally and vertically.

Posted on 21 Dec 20  

How to convert video to gif with Python

post thumbnail techchee

2 min read It’s often that I need to convert videos of screen recordings to GIFs, while authoring this blog. Therefore, I’d like to explore how to convert video to gif with Python. Python comes with lots of libraries. To convert video to gif, the MoviePy simply comes in handy, which you can have it done in just […]

Posted on 17 Dec 20  

How to work with threads in Python

post thumbnail techchee

2 min read Thread lets different parts of program run concurrently. Usually when you have a part of execution in your program that takes longer than usual to run, it’s better let it run in a thread without blocking the main program to handle the user’s interactions or other executions etc.

Posted on 14 Dec 20  
Our FB Twitter Our IG Copyright © 2021