CLCong Leinconglesolutionx.hashnode.dev·Oct 26, 2023 · 6 min readPassing closure as an argument while initializing an object in Swift and SwiftUIIn Swift, closures are self-contained blocks of functionality that can be passed around and used in your code. They can be treated like any other type, which means they can also be passed as an argument while initializing an object. Here's a simple e...00
CLCong Leinconglesolutionx.hashnode.dev·Oct 10, 2023 · 3 min readPreviewing UIViews and UIViewControllers With SwiftUI PreviewSteps on how to do it 1. Create a new Cocoa Touch Class File template as a subclass of UIViewController using Swift language. Name that file as BaseUIViewController 2. Replace the boilerplate code with this example code snippet import UIKit import Sw...00
CLCong Leinconglesolutionx.hashnode.dev·Oct 10, 2023 · 2 min readObjective-oriented Programming Principles in SwiftObject-oriented programming has four main principles: Encapsulation, Inheritance, abstraction, and polymorphism. Let's see how these four critical principles of Object-Oriented Programming (OOP) apply in Swift. 1. Encapsulation Encapsulation is an OO...00
CLCong Leinconglesolutionx.hashnode.dev·Oct 10, 2023 · 4 min readAdding Swift Font to your SwiftUI appAdding custom fonts to your Xcode project involves adding font files to your project and declaring them in your app's Info.plist. The following steps detail the procedure: Add Font Files to Your Project Drag and drop your .ttf or .otf font files int...00