developer resources
Codebales holds an ever growing number of solutions to problems that we have experienced in our day to day code writing
Selected filter
45
results
Andrew Fletcher
•
The purple warning notification of annoyance recently came my way! I received the following warning:
Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.
What was happening?
The functionality of the code uses URLSession to get a user's name via API and the display is simple piece that initially message of Hello {user}.
The view code consists of:
MainView : View
Main...
Andrew Fletcher
•
I'm currently working on a project that requires login, register, forget...
Andrew Fletcher
•
iOS localization on the fly
If you have added languages to your app......
Andrew Fletcher
•
Updating Realm and RealmSwift from 5.5.x to 10.0.0 brought in the following...
Andrew Fletcher
•
Installing Laravel on an Apache server was going to be a no fuss process said no...
Andrew Fletcher
•
After creating a new view with a @Binding string as follows
struct EditRival: View {
@Environment(\.presentationMode) var presentationMode
@EnvironmentObject var realmPerson: RealmPersons
@Binding var uid: String
The previews struct had an error with the var previews
struct EditRival_Previews: PreviewProvider {
//... Initial code ...//
static var previews: some View {
EditRival()
.environmentObject(RealmPersons())
}The error was Cannot convert value of...
Andrew Fletcher
•
What to do when you want to filter a Realm object, using NSPredicate in...
Andrew Fletcher
•
Today while in Terminal, I ran a regular script pod update. However, this...
Andrew Fletcher
•
I'm going to take you on a journey about adding a gradient tint to a...
Andrew Fletcher
•
Creating a new SwiftUI project is a quick process. There are already...
Andrew Fletcher
•
How to apply a gradient tint over a background image?
Set the background image
The first step is to set the background image. I wanted the image to cover the entire device, so scale aspect fill will be required.
self.backgroundImage = UIImageView(image: UIImage(named: "bgkMain"))
self.backgroundImage.contentMode = .scaleAspectFill
self.view.insertSubview(self.backgroundImage, at: 0)
Set the tint layer
With the background in place, next construct the tint layer. To make...
Andrew Fletcher
•
For detailed notes regarding how to add custom fonts to your iOS app see...
Andrew Fletcher
•
Working on formatting the date in Xcode, and you come across the situation where...
Andrew Fletcher
•
Adding a floating decimal point for n number of places is quite easy to achieve....
Andrew Fletcher
•
We had an issue recently where saving a page in the admin area produced one of...