Is it possible to use Apple Sign-In implementation without using ASAuthorizationAppleIDButton? Does it pass through the reviews?

Is it possible to use Apple Sign-In implementation without using ASAuthorizationAppleIDButton? Does it pass through the reviews? The designers are trying a new style for the button to sign in with Apple, and I would like to know if there is a problem besides consistent and familiar UI experience for users. >Solution : You can… Read More Is it possible to use Apple Sign-In implementation without using ASAuthorizationAppleIDButton? Does it pass through the reviews?

Convert elements in an array of Int to elements of another array of String using map and filter

I have an array of integers var array: [Int] = [0, 1, 2] I have an array of strings var arrayOfStrings: [String] = ["apple", "banana", "orange"] I have a function that i can pass an array parameter of Int and returns an array of String. If i call the function and pass the following Int… Read More Convert elements in an array of Int to elements of another array of String using map and filter

Why do I get the error 'Type does not conform to protocol' when using a struct that conforms to the protocol?

I’ve got a protocol called DTO. public protocol DTO { static func GetDefaultInstance() -> DTO } I’ve got a struct that conforms to DTO called Exercise. public struct Exercise: Codable, Identifiable, DTO { public var id: String { return ExerciseId } public var ExerciseId: String public var ExerciseName: String public static func GetDefaultInstance() -> Exercise… Read More Why do I get the error 'Type does not conform to protocol' when using a struct that conforms to the protocol?

How to get UTF8 encoded byte count of a string given a particular NSRange?

To get the UTF8-encoded byte count of a string, I would simply do the following. let str = "it’s 🌮 time" let totalUTF8EncodedBytes = str.utf8.count print(totalUTF8EncodedBytes) // 14 However, if I’m given an NSRange of this string, how can I get the UTF8-encoded byte count of that range? To add some context, I want to… Read More How to get UTF8 encoded byte count of a string given a particular NSRange?