Categories
iOS Swift tvOS Xcode

WWCD 2021

WWDC 2021 is over. We got lot of new announcements for development. Here are some of my favourites sessions of the week. In App Purchase Meet StoreKit 2 Support customer and handle refunds Swift What’s new in Swift? What’s new in Foundation? Async Await Elevate your DocC documentation in Xcode Swift AttributedString Embrace Expected Failure […]

Categories
iOS Swift

Rounded Corners

Radius for all corners I have used the possibility to make rounded corners on iOS. It’s quite straight forward using the CALayer of a view. Doing the following will round all 4 corners of the view. Adding radius for some corners Is it possible to add a rounded corner to only 2 of the corners? […]

Categories
Programming Swift

Do-while-false?

Have you already use Do-While-False in some project ? This is of course not much applicable in Swift as we have guard let, but in C++, Java or ObjectiveC, this could be very useful in some cases. Let me past an example I found in old project. The purpose of the function here doesn’t really […]

Categories
Swift

Using OptionSet

Let’s take an example. You are working as a team, with 4 members (Alex, John, Michael, Henry). The team is working on 4 iOS projects (Calculator, Tetris, Streaming App, Social Network) Now we want to mark which team member is working on which project. A simple way would be to use enum for this. One […]

Categories
Swift Xcode

Swift Package Manager.3

Now that we know how to create a package hosted in a git repo and use in a client project, we would like to try to set up some automated build + running our unit tests. This would prevent any wrong commits, and we could be notified automatically by the system. For the example, I […]

Categories
Swift Xcode

Swift Package Manager.2

In the first post, we saw how to create a package, here we’ll see how to use our newly created package without our project. Add code to your package First, open your xcode project, and create some code. Get rid of the automatically generated code : FluentCoding_MediaControl.swift Create a new swift file: MediaControlManager.swift ⚠️ Please […]

Categories
Swift Xcode

Swift Package Manager.1

Today I would like to write about Swift Package Manager (SPM), which was introduced already several years ago, but I’ve never had a chance to try as I was mostly using Cocoa Pods for managing dependencies. I will split my experience over several posts (4), because there is a lot to write, so this one […]

Categories
iOS Swift tvOS

My first SwiftUI view

Swift UI has been around for almost 2 years now, and I didn’t have much time / opportunity to play with it. But yesterday I did my first Swift UI view. This is not very advanced, as I wanted to replace a simple table view which shows text on each cell, and handles a click […]

Categories
Swift

Add vs. Adding

A few weeks ago, I was watching an online video which presented a way to generate an object following the Builder Pattern.I hear something very interesting which I believe is a convention within the Swift world on how to name some of your methods within your API objects. Add versus Adding or more generic, [Action] […]