Sign In

Razvan Bogdan

Senior iOS Engineer | Fintech | Crypto

Razvan Bogdan is a seasoned Senior iOS freelancer, contractor, and consultant with over 6 years of experience in software engineering. He specializes in creating top-notch mobile applications and collaborates with global companies to deliver exceptional software solutions. Razvan's expertise spans various areas including iOS development using tools like Swift, Realm, APNS, Firebase, RxSwift, CryptoSwift, and MVVM-Coordinator. In addition, he is proficient in Design&Prototyping tools such as Sketch, Figma, Invision, and Marvel, along with experience in RESTful Webservices and Relational Databases. Razvan's focus is on remote work, and he is open to discussing how his skills can benefit your business. He holds a Master's degree in Computer Software Engineering and a Bachelor of Science in Computer Science from Universitatea „Babeș-Bolyai” din Cluj-Napoca. Throughout his career, Razvan has worked as a Senior iOS Developer, Remote Consultant, and Freelancer at ARCHLIME SOLUTIONS, and has previous experience at Centrys Inc., Wolfpack Digital, Catalysts GmbH, and msg systems Romania.

Highlights

Aug 28 · linkedin

Is 𝐒𝐰𝐢𝐟𝐭𝐃𝐚𝐭𝐚 production ready? Can it replace CoreData or Realm? 🧐

Some say yes, others say no. While there are articles outlining scenarios where SwiftData excels or falls short compared to the alternatives, the reality is it's still lacking some important features.

As mentioned in another post, I've migrated the local DB from RealmSwift to SwiftData in my 𝐩𝐞𝐭 𝐩𝐫𝐨𝐣𝐞𝐜𝐭 Plantasia (there's a link to the app in the comments 👇).

𝐓𝐡𝐢𝐬 𝐢𝐬 𝐰𝐡𝐚𝐭 𝐈'𝐯𝐞 𝐥𝐞𝐚𝐫𝐧𝐞𝐝:

  1. 𝐍𝐨 𝐨𝐛𝐬𝐞𝐫𝐯𝐚𝐭𝐢𝐨𝐧 𝐦𝐞𝐜𝐡𝐚𝐧𝐢𝐬𝐦 𝐨𝐮𝐭𝐬𝐢𝐝𝐞 𝐨𝐟 𝐒𝐰𝐢𝐟𝐭𝐔𝐈 One of the challenges I encountered is the absence of an observation mechanism like the ones available in CoreData or Realm. These mechanisms trigger events whenever stored objects change, allowing the UI to update accordingly. While SwiftData's observation works with SwiftUI’s @Query macro, querying data outside of a SwiftUI view is tricky.

Unfortunately, this feature is missing in SwiftData, though there is a workaround.

You can observe changes in the database using the .NSPersistentStoreRemoteChange notification. By listening for this, you can re-query the database and use an AsyncStream to deliver the results to subscribers. Check the comments for the solution.

  1. 𝐂𝐚𝐧𝐧𝐨𝐭 𝐢𝐧𝐬𝐭𝐚𝐧𝐭𝐢𝐚𝐭𝐞 𝐚 𝐒𝐰𝐢𝐟𝐭𝐃𝐚𝐭𝐚 𝐦𝐨𝐝𝐞𝐥 𝐚𝐧𝐲𝐰𝐡𝐞𝐫𝐞 Another limitation is that you must define a model context before creating a SwiftData model - otherwise, your app crashes. This affects not only the app but also SwiftUI previews and unit tests, as you always need to create a model context (even an in-memory one) to instantiate a model.

  2. 𝐍𝐨 𝐬𝐮𝐩𝐩𝐨𝐫𝐭 𝐟𝐨𝐫 𝐬𝐡𝐚𝐫𝐞𝐝 𝐝𝐚𝐭𝐚𝐛𝐚𝐬𝐞𝐬 Finally, SwiftData doesn’t yet support shared databases. Shared databases, which are available in CoreData, allow iCloud users to share data and notify all subscribers when the database changes. This feature would be incredibly useful for Plantasia, enabling shared plant collections. Hopefully, SwiftData will adopt this feature soon. 🤞

In the attachments you can see how I've defined the SwiftData and the Realm versions of one of my models that I use, the Room model.

🙋‍♂️𝐇𝐚𝐯𝐞 𝐲𝐨𝐮 𝐮𝐬𝐞𝐝 𝐒𝐰𝐢𝐟𝐭𝐃𝐚𝐭𝐚 𝐢𝐧 𝐲𝐨𝐮𝐫 𝐩𝐫𝐨𝐣𝐞𝐜𝐭 𝐬𝐨 𝐟𝐚𝐫? 𝐖𝐡𝐚𝐭'𝐬 𝐲𝐨𝐮𝐫 𝐞𝐱𝐩𝐞𝐫𝐢𝐞𝐧𝐜𝐞 𝐰𝐢𝐭𝐡 𝐢𝐭?

Aug 21 · linkedin

In the last few (8?) months I've been preparing some huge 𝐫𝐞𝐟𝐚𝐜𝐭𝐨𝐫𝐢𝐧𝐠 for my 𝐩𝐞𝐭 𝐩𝐫𝐨𝐣𝐞𝐜𝐭 Plantasia 🧑‍💻

I've changed the minimum OS target to iOS 17 to benefit from the latest APIs.

Some of the 𝐡𝐢𝐠𝐡𝐥𝐢𝐠𝐡𝐭𝐬 include:

  • migrated the local DB from RealmSwift to 𝐒𝐰𝐢𝐟𝐭𝐃𝐚𝐭𝐚
  • rewritten the UI layer from UIKit to 𝐒𝐰𝐢𝐟𝐭𝐔𝐈 and introduced a 𝐝𝐞𝐬𝐢𝐠𝐧 𝐥𝐢𝐛𝐫𝐚𝐫𝐲
  • introduced some new things like 𝐖𝐢𝐝𝐠𝐞𝐭𝐬, 𝐀𝐩𝐩 𝐈𝐧𝐭𝐞𝐧𝐭𝐬
  • 𝐂𝐥𝐨𝐮𝐝𝐊𝐢𝐭 𝐬𝐲𝐧𝐜

I'll prepare a 𝐬𝐞𝐫𝐢𝐞𝐬 𝐨𝐟 𝐩𝐨𝐬𝐭𝐬 about the most interesting things I've learned in this journey, so until then you can check out the app and let me know your opinion 👇

Related Questions

What projects has Razvan Bogdan worked on at Xapo Bank?
How did Razvan Bogdan transition from a student to a Senior iOS Engineer?
What are some notable achievements of Razvan Bogdan in the fintech industry?
What technologies does Razvan Bogdan specialize in?
How does Razvan Bogdan contribute to the iOS engineering community?
Razvan Bogdan
Razvan Bogdan, photo 1
Razvan Bogdan, photo 2
Add to my network

Location

Cluj-Napoca, Cluj, Romania