🇺🇦 iOS Dev UA - спільнота iOS розробників
384 subscribers
400 photos
42 videos
9 files
963 links
Перша україномовна спільнота iOS розробників 🇺🇦

👨‍💻Цікаві матеріали зі світу розробки для продуктів Apple.
Статті по розробці на Swift та SwiftUI. Огляд нових технологій в розробці від Apple.

чат: @iOSDevsUAChat
Ідеї та пропозиції: @SergeyZhuravel
Download Telegram
This media is not supported in your browser
VIEW IN TELEGRAM
Apple приділяє надзвичайну увагу до деталей. Неможливо подивитися на це і не посміхнутися 🤯

🇺🇦 iOSDevUA
👍1
💡Тренуємо і запускаємо ML модель на пристрої

Гарний туторіал про те, як з нуля навчити свою ML модель для того, щоб передбачати ймовірність закриття діалогового вікна залежно від рівня заряду батареї.

🇺🇦 iOSDevUA
🚀Hello Developer: травень 2024

Новий випуск щомісячної розсилки Apple для розробників.

👉 Pathways – навчальні треки з підбіркою статей, відео та документації з різних тем.
👉 Інтерв'ю з переможцями Swift Student Challenge.
👉 Реєстрація на онлайн-зустрічі з App Review Team.
👉 Огляд Apple Pencil Pro.
👉 Q&A від команди SharePlay.
👉 Новий фреймворк для конвертації документів у PDF.

🇺🇦 iOSDevUA
💡Шаблони нових айпадів уже в Sketch

Після анонсу нових айпадів (і скандалу з рекламою, але про нього ми в каналі говорити не будемо), Apple додали шаблони з їх рамками в офіційну бібліотеку в Sketch. Можете вже використовувати для своїх скріншотів!

🇺🇦 iOSDevUA
👍1
💡Базова річ, аналог якої має бути у багатьох, але якщо раптом немає або тільки вчитеся, то ось чудовий матеріал про конфігуровану кнопку в SwiftUI! Тобто просто компонент, який має різні стани та ними легко керувати. Ну і використовувати цю кнопку всюди в проекті, звичайно.

👉 https://www.danijelavrzan.com/posts/2024/05/configurable-button-swiftui

🇺🇦 iOSDevUA
Як правильно зробити вибір між Set та Array в Swift?

🔑 Колекції — ключовий компонент будь-якої мови програмування.

Безумовно, в переважній більшості ситуацій ми використовуємо Array або Set, але є й інші види колекцій (наприклад, ArraySlice, який відноситься до частини масиву).

📖 У цій статті розглянуті особливості Set та Array, ключові характеристики кожного з них і кейси використання (а також питання продуктивності).

🇺🇦 iOSDevUA
Hello everyone! New iOS weekly digest is here!
🚀🚀🚀 Last Week at Apple 🚀 🚀 🚀

Today we will start from the very important topic - perfomance. If you are working on the iOS application and want to improve perfomance please consider Accelerate framework.
Boost Performance by Over 100x Using the Accelerate Framework
Learn how to leverage the Accelerate Framework to improve the performance of Stream’s Video SDK by over 100x:
https://getstream.io/blog/accelerate-framework/

What Does spacing = nil Mean in SwiftUI?
In SwiftUI, many layout container constructors include a spacing parameter with a default value of nil, which controls the spacing between adjacent views. This article will start with this default parameter to explore the concept of Spacing in SwiftUI in-depth, and share some related tips and considerations.
Why Are the Spacings Between My Subviews Inconsistent?
As developers become more proficient with SwiftUI, they gradually master certain “rules of thumb.” For instance, in a VStack, if the spacing parameter is not explicitly specified and its default value nil is used, the spacing is typically about 8:
https://fatbobman.com/en/posts/spacing-of-swiftui

MVVM: An architectural coding pattern to structure SwiftUI Views
MVVM (Model-View-ViewModel) is an architectural coding pattern for structuring SwiftUI views. The goal of the pattern is to separate the view definition from the business logic behind it. Your views will not depend on any specific model type if done correctly.
While MVVM was mostly used in the UIKit/AppKit days, it’s still a commonly used pattern in SwiftUI. In my experience, how it’s being used isn’t always consistent and results more in a View-ViewModel pattern. However, this might be justified considering ‘overengineering’. Let’s dive in:
https://www.avanderlee.com/swiftui/mvvm-architectural-coding-pattern-to-structure-views

If you have some custom views for tips in your iOS application consider replace them with built-in iOS solution - TipKit
Refactoring to TipKit from AppStorage and Custom Views in SwiftUI
https://www.swiftjectivec.com/refactoring-tipkit-swiftui-from-appstorage

And one more about TipKit
Discovering app features with TipKit. Rules.
This week, we will continue discussing how to highlight app features using the TipKit framework. TipKit provides a flexible way of customizing the condition under which tips should appear:
https://swiftwithmajid.com/2024/05/15/discovering-app-features-with-tipkit-rules

You are experienced iOS developer with a lot of experience with UIKit? Or maybe you have an iOS application created with UIKit and you want to move to SwiftUI? Check this great article about moving from UIKit to SwiftUI.
Avoid These Common Errors When Switching from UIKit to SwiftUI
I truly believe that I am 10x more productive with SwiftUI than with UIKit. However, there is no denying that SwiftUI has a steep learning curve. In fact, UIKit programmers might be at a disadvantage to newcomers because they know certain ways to make things work which are no longer relevant in SwiftUI. SwiftUI requires to to throw out everything you know, and retrain your brain.
In today's blog post, we are going to refactor a SwiftUI view to use simple, idiomatic SwiftUI. We will add support for Dark Mode and Dynamic Type. In the process, I will point out a bunch of mistakes that I find UIKit programmers make when first starting SwiftUI.
https://dev.jeremygale.com/avoid-these-common-errors-when-switching-from-uikit-to-swiftui

And a nice tip how to react to network changes in SwiftUI
React to network status updates in SwiftUI
In this short post we'll look into how to easily manage network status updates in SwiftUI by using the NWPathMonitor as an async sequence. This method integrates seamlessly with your views for efficient updates:
https://nilcoalescing.com/blog/ReactToNetworkStatusUpdatesInSwiftUI
💡Недолік unidirectional архітектур

Основний недолік однонаправлених архітектур, на думку автора, – розсіювання бізнес-логіки по різних місцях у коді, через що складно отримати цілісну картину того, що відбувається. У статті він показує, чому це здається проблемою, на прикладі одного екрану.

👉 https://medium.com/the-swift-cooperative/the-dark-side-of-unidirectional-architectures-in-swift-e4acf243ff1c

🇺🇦 iOSDevUA
1
This media is not supported in your browser
VIEW IN TELEGRAM
💡Як виміряти продуктивність за допомогою інструментів та os_signposts

⚙️ Інструменти допомагають нам не тільки вимірювати обсяг пам'яті чи навантаження на процесор, але також відіграють вирішальну роль у виявленні вузьких місць.

Одна з корисних функцій інструментів — можливість додавати в код вказівники (signposts) для визначення потрібних областей під час трасування. Це особливо корисно, коли у нас багато схожих викликів, і нам потрібно виміряти час, витрачений на конкретну операцію.

📖 У цій статті можна подивитися на приклад використання таких вказівників.

🇺🇦 iOSDevUA
💡Як уникнути поширених помилок при переході з UIKit на SwiftUI

Джеремі Гейл опублікував цікаву статтю, в якій є думка, що розробники UIKit знаходяться в невигідному становищі порівняно з новачками, оскільки знають способи змусити працювати речі, які більше не актуальні в SwiftUI.

Коли я тільки починав переносити деякі проєкти на SwiftUI, у мене було схоже відчуття, адже багато що доступне з коробки і так.

📖 У цій статті показано приклад рефакторингу SwiftUI. Також у процесі розглядаються помилки, які допускають розробники, вже звиклі до UIKit.

🇺🇦 iOSDevUA
👍1🔥1
This media is not supported in your browser
VIEW IN TELEGRAM
💡Нові фічі accessibility

Як завжди перед WWDC, Apple демонструє нові функції accessibility, які будуть випущені в наступному оновленні iOS.

👉 Боротьба з нудотою під час читання в автомобілі
👉 Керування iPad та iPhone рухом очей
👉 Відтворення музики через haptic вібрацію

🇺🇦 iOSDevUA
Паттерн «Репозиторій» в Swift: розбір і приклади коду

🐱 Шаблон проектування «Репозиторій» діє як проміжний рівень між бізнес-логікою додатка та сховищем даних.

За його допомогою забезпечується структурований спосіб читання та запису, абстрагуючи при цьому базові деталі рівня зберігання.

При цьому можна взаємодіяти з даними, не знаючи, чи зберігаються вони в пам'яті чи десь ще (у нас може бути і CoreData, і Realm, і кейчейн, навіть окремий файл у tmp).

Це створює чітке розділення задач і значно спрощує тестування.

Наприклад, ми можемо використовувати резервне сховище в пам'яті для тестів (при використанні CoreData у продакшн).

Також сам рівень даних буде значно більш гнучким, оскільки з'являється можливість замінити використовуване сховище даних без необхідності зміни коду додатка на рівні реалізації.

🔗 Шаблон з прикладами коду

🇺🇦 iOSDevUA
👍1🔥1
Знову про архітектуру. Цього разу про MVVM та SwiftUI!

Автор перевірений, а матеріал досить хороший, тому було б неправильно не поділитися.
Для новачків точно буде корисно, головне не забувати, що це не єдине можливе рішення і не срібна куля! Але для загального розвитку треба знати і вміти готувати 👍

👉 https://www.avanderlee.com/swiftui/mvvm-architectural-coding-pattern-to-structure-views/

🇺🇦 iOSDevUA
💡Реалізація навігації в SwiftUI за допомогою NavigationPath і NavigationDestination

Взагалі, однією з основних проблем у SwiftUI була якраз навігація.

До появи NavigationPath існували деякі способи вирішення цієї проблеми, але вони були не надто зручні.

📖 У цьому пості розглядаються особливості NavigationPath (доступної з iOS 16), принципи роботи та відмінності від UINavigationController у UIKit.

🇺🇦 iOSDevUA
This media is not supported in your browser
VIEW IN TELEGRAM
💡Introducing the iPhone 16 Pro Supa Max!

Цей новий додаток, Bezel, дозволяє бездротово віддзеркалювати ваш iPhone або iPad на ваш Apple Vision Pro!
Він не ідеальний, але дійсно круто експериментувати з ним.

🇺🇦 iOSDevUA
1
🚀Apple зробила редизайн Apple Developer Forums

Apple Developer Forums були оновлені до WWDC24, щоб допомогти розробникам зв'язуватися з експертами Apple, інженерами та один з одним для пошуку відповідей і отримання порад.

👉 https://developer.apple.com/forums/

🇺🇦 iOSDevUA
💡Пам'ятаєте Personal Voice, функцію доступності в iOS 17, яка дозволяє створити AI-версію вашого голосу?

Вона працює дійсно досить добре!
Додатки можуть використовувати цей голос для перетворення тексту в мову 🤯

Ось стаття, про це 👉 https://bendodson.com/weblog/2024/04/03/using-your-personal-voice-in-an-ios-app/

🇺🇦 iOSDevUA
💡SwiftUI QR-код сканування прямокутника з кутовою рамкою:
Ви можете досягти цієї рамки за допомогою stroke(). Він приймає деякі додаткові параметри, такі як StrokeStyle. З невеликими розрахунками ви можете досягти цього результату.

🇺🇦 iOSDevUA
Hello iOS developers! New digest is here!

Hello everyone! New iOS weekly digest is here!
🚀🚀🚀 Last Week at Apple 🚀 🚀 🚀

Let's start from the unusual topic: Swift on the Server
Very interesting article about benchmarking different web servers:
FPM w/ NGINX (PHP).
Helidon (Kotlin / Java1).
Node.js (JavaScript).
Vapor (Swift)
More info here:
https://wadetregaskis.com/swift-sucks-at-web-serving-or-does-it

Programmatic navigation in SwiftUI with NavigationPath and navigationDestination
In this post we’ll look at:
Understanding iOS 16’s navigation API
Navigating through a NavigationPath:
https://www.donnywals.com/programmatic-navigation-in-swiftui-with-navigationpath-and-navigationdestination

SwiftUI Split View Configuration
Starting with iOS 16, the NavigationSplitView is the preferred way to create two or three column layouts on the iPad and Mac. It has configuration options to control the column visibility, width and style:
https://useyourloaf.com/blog/swiftui-split-view-configuration

MVVM: An architectural coding pattern to structure SwiftUI Views
MVVM (Model-View-ViewModel) is an architectural coding pattern for structuring SwiftUI views. The goal of the pattern is to separate the view definition from the business logic behind it. Your views will not depend on any specific model type if done correctly.
While MVVM was mostly used in the UIKit/AppKit days, it’s still a commonly used pattern in SwiftUI. In my experience, how it’s being used isn’t always consistent and results more in a View-ViewModel pattern. However, this might be justified considering ‘overengineering’. Let’s dive in:
https://www.avanderlee.com/swiftui/mvvm-architectural-coding-pattern-to-structure-views

Your Complete Guide to Push Notifications in SwiftUI
Push notifications are a feature that many apps use, but there hasn’t been much content around how they work or how to implement them. In this tutorial we will make this complex topic easier to understand and implement in your own project:
https://medium.com/@jpmtech/your-complete-guide-to-push-notifications-in-swiftui-8a13f5588662

Replacing The Deprecated cornerRadius View Modifier In SwiftUI
https://serialcoder.dev/text-tutorials/swiftui/replacing-the-deprecated-cornerradius-view-modifier-in-swiftui