Skip to content

Justin's Blog

A developer's rambling

  • Home
  • Twitter
  • Apple App Store
  • About Me
iOS , Swift , SwiftUI

SwiftUI Camera Preview – Mirror App

by: Justin AllenPosted on: March 26, 2023March 26, 2023
iOS , Swift

iOS List Pending Notifications

by: Justin AllenPosted on: March 24, 2023

You may want to show a list of the upcoming application notifications, you can do this by using the following code.

iOS , Swift , SwiftUI

iOS Notifications While App is Open

by: Justin AllenPosted on: March 24, 2023

You first need a class that acts as the delegate for the userNotificationCenter. Then you need to create an instance of this on your @main, and then tell the notification center what the delegate is.

iOS , Swift , SwiftUI

iOS Notifications

by: Justin AllenPosted on: March 24, 2023March 24, 2023

Below is code for creating a notification locally on iOS, and triggering it 5 seconds later. Don’t forget to request permissions to send notifications.

iOS , Swift

When sharing data between targets using UserDefaults

by: Justin AllenPosted on: September 29, 2022

When you have to use UserDefaults to share data between a core app and a widget you have to do a couple of things. Inside of the project Signing & Capabilities use the Add Capabilities button to add App Group. You need to do this while selecting both the app […]

iOS , Swift , SwiftUI

Advanced SwiftUI Stepper

by: Justin AllenPosted on: September 27, 2022September 29, 2022

Apple’s built in stepper allows you to only have one step increment value, I’ve designed on that allows for two different increment values. Initial version supported 1 and 10 for the step values and is tied to an integer. This of course is the first revision, and it isn’t very […]

iOS , Swift , SwiftUI , Tips

Swift Temperature Format Customization

by: Justin AllenPosted on: July 29, 2022July 30, 2022

When you use Measurement format function in Swift it will always format the temperature to the format of the locale of the device. This is not the experience I wanted in my application. I wanted to provide the user an option to chose which scale they wanted to use, so […]

iOS , Swift , SwiftUI

Slide Out Menu for iOS using SwiftUI

by: Justin AllenPosted on: July 4, 2022July 4, 2022

This week I’ve been working on prototyping a slide out menu, or as most people know it as the hamburger menu. This is a very useful navigation system for apps once the scale past 5 “systems” or tabs. This system has to wrap the main content view inside of a […]

iOS , Swift , SwiftUI

Navigation View Constraints

by: Justin AllenPosted on: July 2, 2022

If you are using Swift UI and you get an error based around the constraints, you might be able to fix it by putting this line at the end of your navigation view. .navigationViewStyle(.stack)

iOS , Swift , Weather Driver

Converting a callback function to async await in Swift

by: Justin AllenPosted on: July 1, 2022

Occasionally you will need to convert a callback based function to an async/await function. One example of this is below, calculating a map route appears to be only available as a callback based one. Below is an example of how to convert it to an async function. This code is […]

Posts navigation

Page 1 Page 2 Next page
Theme Blog Explorer by Kantipur Themes