Swift for Android, Kotlin for iOS

Tom Delalande
6 Jul 202408:03

Summary

TLDRThe script discusses the evolution of cross-platform development, highlighting how Swift and Kotlin are revolutionizing native app creation for multiple platforms without code changes. It emphasizes the advantages of native tooling over frameworks like Flutter, React Native, and Electron, which may compromise developer or user experience. The video showcases how Google and Apple's efforts have made Swift and Kotlin developer-friendly, enabling the creation of consistent, high-quality apps across iOS, Android, Windows, Mac OS, and Linux, ushering in a renaissance of software engineering.

Takeaways

  • πŸ“± Swift applications can run on Android devices without code changes, utilizing native material components during the build process.
  • πŸ”„ Cross-platform development is evolving, making it easier to create native applications for multiple platforms with native tooling.
  • πŸ› οΈ Kotlin is the language used for Android development, and its UI framework, Compose, can now build native Swift UI applications using existing Kotlin code.
  • 🀝 Compose allows for code reusability across platforms without the need for rewriting, embedding the view controller into a V app.
  • πŸ”§ There are tools like Skip that facilitate cross-platform development by translating Swift code to Kotlin Compose code, although it's proprietary and can be unstable.
  • πŸ”„ Rattle is an open-source toolchain that helps share logic between Swift and Android projects, requiring UI layer rewriting for Android.
  • 🌐 Both Google and Apple have invested heavily in developer experience, creating dedicated IDEs, emulators, and powerful APIs for their platforms.
  • πŸ“ˆ Kotlin and Swift are developer-friendly languages, making them excellent choices for mobile app development.
  • 🎨 Swift UI and Material UI provide consistent design languages across applications, enhancing the user experience.
  • πŸ’» Beyond mobile, the same codebase can be used for desktop apps, with Windows supporting Swift through specific bindings.
  • 🌐 Compose supports cross-platform development for mobile and desktop, including Linux, allowing for shared or platform-specific code in Kotlin.
  • πŸš€ The current landscape of software engineering offers a renaissance of opportunities for developers to create delightful apps with improved developer and user experiences.

Q & A

  • What is the significance of the Swift application running on an Android device without code changes?

    -The significance lies in the demonstration of cross-platform capabilities, where an application originally developed for iOS can run on Android with no modifications, showcasing the potential for shared codebases across different operating systems.

  • What does the term 'Native material components' refer to in the context of the script?

    -Native material components refer to the native user interface elements that are specific to the Android platform, which are being used to convert the iOS application into a format compatible with Android.

  • Why is the ability to create cross-platform native applications considered a game-changer in the development landscape?

    -The ability to create cross-platform native applications without additional developer work or abstraction layers simplifies the development process, reduces costs, and allows developers to reach a wider audience with a single codebase.

  • What is the role of 'Cotlin' in Android development mentioned in the script?

    -Cotlin is a programming language used for Android development. It is highlighted for its UI framework, Compose, which has been extended to build native Swift UI applications using existing Kotlin code.

  • How does the script suggest using Kotlin Compose for cross-platform development?

    -The script suggests that Kotlin Compose can be used to create applications that run natively on iOS devices by calling Kotlin Compose code directly and embedding it into the view controller.

  • What is the 'Skip' plugin mentioned in the script, and what does it do?

    -The 'Skip' plugin is a tool that allows developers to pass Swift code and produce matching Kotlin Compose code. It enables cross-platform development by facilitating the use of Swift in Android applications, although it is proprietary and may have limitations.

  • What is the 'Rattle' toolchain, and how does it help in sharing logic between iOS and Android projects?

    -The 'Rattle' toolchain is a set of open-sourced tools developed by a company called 'Rle' that helps share common logic between iOS and Android projects while allowing the UI layer to be rewritten specifically for Android.

  • Why is the script critical of third-party cross-platform development tools like Flutter, React Native, and Ionic?

    -The script criticizes these tools for either providing a worse developer experience or resulting in a worse user experience when compared to native tooling. It suggests that the advantages of these tools in reducing cross-platform development work are diminishing as native tooling improves.

  • How does the script describe the developer experience with Swift and Kotlin?

    -The script describes the developer experience with Swift and Kotlin as pleasant and developer-friendly, highlighting the effort put by Apple and Google to create dedicated IDEs, emulators, and powerful APIs to enhance the development process.

  • What is the script's stance on the user experience provided by native platforms compared to third-party tools?

    -The script asserts that native platforms provide the best user experience due to consistent design languages and homogeneous application interfaces, whereas third-party tools create a middle ground that may compromise the user experience.

  • What is the potential of using a single codebase for multiple platforms, including desktop and mobile, as discussed in the script?

    -The script suggests that with advancements in native tooling, it is now feasible to use a single codebase for multiple platforms, including iOS, Android, Windows, macOS, and potentially Linux, allowing for a more efficient and unified development process.

Outlines

00:00

πŸ“± Cross-Platform Native App Development with Swift and Compose

The script discusses the evolution of cross-platform app development, highlighting how Swift and Compose enable developers to create native applications for iOS and Android without code changes. It emphasizes the maturity of these ecosystems, which now allow for the development of native applications with native tooling, without the need for additional developer work or abstraction layers. The script also touches on the disadvantages of third-party cross-platform solutions like Flutter, React Native, and Ionic, which may compromise the developer and user experience. It introduces 'Cotland', a language for Android development, and its UI framework 'Compose', which can now build native Swift UI applications using existing code. The script also mentions 'Skip', a plugin for converting Swift code to Compose code, and 'Buckle', a toolchain for sharing logic between Swift and Android projects.

05:02

🌐 Expanding Cross-Platform Development Beyond Mobile

This paragraph expands on the idea of cross-platform development, suggesting that the same codebase can be used not only for mobile apps but also for desktop applications across various platforms including Windows, Mac OS, and Linux. It mentions the 'Browser Company' and their efforts to recreate WinUI components in Swift, allowing for the development of Windows applications using Swift. The paragraph also discusses the limitations of Flutter, positioning it as a middle ground that doesn't fully leverage the design language and consistency of established platforms. The script concludes by celebrating the current state of software engineering, where developers have a plethora of tools to turn ideas into delightful apps, and encourages the use of native tooling for the best developer and user experience.

Mindmap

Keywords

πŸ’‘Swift

Swift is a powerful and intuitive programming language developed by Apple for iOS, macOS, watchOS, and tvOS app development. In the video, Swift is highlighted as a core technology for creating native cross-platform applications without code changes, showcasing its versatility and efficiency in modern app development.

πŸ’‘Android

Android is an operating system for mobile devices, primarily smartphones and tablets, developed by Google. The script discusses how Swift applications can run on Android devices with no code changes, indicating the cross-platform capabilities that are now possible with native tooling.

πŸ’‘Xcode

Xcode is an integrated development environment (IDE) developed by Apple for macOS, used for creating software for Apple's platforms. The video mentions Xcode as part of the build process for converting projects into native components for Android, demonstrating the integration of Apple's tools with cross-platform development.

πŸ’‘Cross-platform development

Cross-platform development refers to the practice of creating software applications that can run on multiple platforms, such as iOS and Android, without needing to be rewritten for each. The video's theme revolves around this concept, emphasizing the ease and efficiency of creating native applications for multiple platforms using tools like Swift and Compose.

πŸ’‘Cotlin

Cotlin is a statically typed programming language for the Java platform designed to be a 'better Java' and officially supported by Google for Android development. The script refers to 'Cotland', which seems to be a mispronunciation or typo for 'Kotlin', highlighting its use in Android development and its recent capability to build native Swift UI applications.

πŸ’‘Compose

Compose is a modern toolkit for building native Android UI, allowing developers to create more dynamic UIs with less code. The video script discusses how Compose can be used to convert existing code into native Swift UI applications, showcasing its role in enhancing cross-platform development.

πŸ’‘Native UI

Native UI refers to user interfaces that are built specifically for a particular platform, adhering to its design language and user experience standards. The script emphasizes the importance of native UI in providing the best possible user experience, contrasting it with the abstraction layers that can compromise experience in some cross-platform frameworks.

πŸ’‘Flutter

Flutter is an open-source UI software development kit created by Google for building natively compiled applications for mobile, web, and desktop from a single codebase. The video script positions Flutter as a middle ground between native development and other cross-platform solutions, suggesting that while it offers convenience, it may not provide the optimal experience for developers or users.

πŸ’‘React Native

React Native is a popular cross-platform development framework developed by Facebook that allows developers to build mobile apps using JavaScript and React. The script briefly mentions React Native as one of the cross-platform tools that may offer a worse developer experience or result in a worse user experience when compared to native tooling.

πŸ’‘Rattle

Rattle is an open-source toolchain that helps share logic between Swift and Android projects, allowing developers to maintain a single codebase for both iOS and Android applications. The video script uses Rattle as an example of how existing Swift applications can be adapted for Android with minimal UI layer rewriting.

πŸ’‘Material UI

Material UI is a set of React components that implement the Google Material Design guidelines. Although not explicitly mentioned in the script, Material UI is an example of a design system that contributes to a consistent and homogeneous user experience across Android applications, which the video script praises as a benefit of native development.

Highlights

Swift applications can run on Android devices with no code changes, thanks to the conversion to native material components during the Xcode build process.

Google's sample project creates native Swift UI without third-party dependencies, allowing for cross-platform applications with no additional developer work or abstraction layers.

The cross-platform development landscape is evolving, making it easier to create native applications with native tooling.

Cotlin is used for Android development, and its UI framework, Compose, can now build native Swift UI applications using existing Kotlin code.

Apple's ecosystem is more closed than Google's, but there are still options for cross-platform development with Swift.

Skip is a proprietary plugin that translates Swift code to Kotlin Compose code, though it may not be as stable or comprehensive.

Rattle is an open-source toolchain that helps share logic between Swift and Android projects, with separate UI layers for each platform.

Google and Apple have invested heavily in developer experience, creating dedicated IDEs, emulators, and powerful APIs like Kotlin and Swift.

Swift UI and Material UI are significant for providing a consistent design language and user experience across applications on their respective platforms.

Flutter offers a middle ground in cross-platform development but may compromise the native experience compared to using native tools.

It's possible to write a single codebase for iOS and Android and extend it to desktop apps, as demonstrated by the Windows version of a Swift application.

Swift can be used with specific bindings to create different UIs for various platforms, allowing for shared application logic.

Compose, a tool from the Compose team, enables cross-platform applications for mobile and desktop, including Linux, using native tools.

The Todo app example by the Compose team demonstrates the ability to run on multiple platforms with shared or platform-specific code.

Native tooling with Kotlin and Swift has significantly improved the developer experience and the way programming languages are perceived.

The current state of software engineering represents a renaissance, with the developer and user experience being better than ever before.

There is a wide range of tools available for turning ideas into delightful apps, and the choice of tooling impacts the experience for both developers and users.

Transcripts

play00:00

this is a swift application running on

play00:02

an Android device with no code changes

play00:05

this xcode sample project made by Apple

play00:08

is being converted to Native material

play00:11

components for Android as part of the

play00:13

xcode build process and this is a

play00:16

cotland application running on iOS also

play00:19

with no code changes this Google sample

play00:22

project creates native Swift UI with no

play00:25

third party

play00:26

dependencies both of these projects are

play00:28

shipping native cross platform

play00:30

applications without any additional

play00:32

developer work or abstraction layers the

play00:35

crossplatform development landscape is

play00:38

changing as these ecosystems have

play00:40

matured it's now easier than ever to

play00:42

create cross-platform native

play00:44

applications with Native tooling and

play00:46

it's not just mobile stick around and

play00:49

I'll show you how to maintain a single

play00:50

native code base while building an

play00:52

application for iOS Android Windows Mac

play00:56

OS and Linux flutter react native ionic

play00:59

and electron all either have a worse

play01:02

developer experience or result in a

play01:04

worse user experience when compared to

play01:06

Native tooling previously these

play01:09

disadvantages were outweighed by the

play01:11

advantage of Haring the amount of work

play01:13

required for cross-platform development

play01:15

but that won't Remain the case for long

play01:17

a lot of smart people and influential

play01:20

companies are working hard to make the

play01:22

portable native codebase dream a reality

play01:25

cotland is the language used for Android

play01:27

development the UI framework for cotland

play01:30

is called compose historically it's been

play01:32

used to create Android and desktop

play01:34

applications but they recently added the

play01:37

capability to build native Swift UI

play01:39

applications using existing cin code

play01:42

this is an example of a composed

play01:44

application running on an iOS device

play01:47

although this looks like a pretty normal

play01:48

xcode project when I go into this view

play01:51

controller I can see that it's calling

play01:53

cotland compost code directly and

play01:56

embedding The View controller into V app

play01:58

letting me reuse it without rewriting

play02:01

it if you prefer using Swift over cotlin

play02:04

you are also in luck but since apple is

play02:06

inherently more closed than Google the

play02:09

tools aren't integrated directly into

play02:10

the ecosystem but you still have a few

play02:13

options for crossplatform development

play02:15

skip is a plug-in that will pass Swift

play02:17

Code and produce matching colon compos

play02:20

code this particular solution is

play02:22

proprietary and will often break since

play02:24

all apis are not implemented I look

play02:27

forward to an open-source more stable

play02:29

implement of something similar I

play02:31

couldn't find an example of a skip

play02:33

application online so all I did is go to

play02:36

the sample applications on the Apple

play02:37

website and downloaded the first example

play02:40

here about me then I created a brand new

play02:43

xcode project using Skip and then copied

play02:46

all the files over when I run build

play02:49

inside of xcode it'll run the app both

play02:51

on Android and iOS and we can see that

play02:54

we're using native UI for both of

play02:58

these a more consistent option for

play03:00

existing Swift applications is using a

play03:03

set of tools to share common logic

play03:05

between IOS and Android projects while

play03:07

rewriting the UI layer for Android this

play03:10

effort is spearheaded by a company

play03:11

called rle who has open- sourced many

play03:14

tools that help share logic between

play03:16

Swift and Android projects this is an

play03:18

example weather app made using the

play03:20

rattle tool chain I can't run it because

play03:23

this particular tool chain doesn't work

play03:25

on macoma but we can still look at the

play03:27

files and see how it works I have three

play03:30

folders that are important here the core

play03:33

one is the logic which is written in

play03:35

Swift and is shared for Android and iOS

play03:38

then there's separate folders for the

play03:39

Swift UI and for Android as you can see

play03:43

the core of the application is written

play03:45

in Swift there's not a lot to it here

play03:47

it's just an API that calls for wether

play03:48

data and then we have a separate xcode

play03:51

project that includes for UI for iOS and

play03:53

Mac OS and then another project which

play03:56

has the UI for Android it's a little bit

play03:58

of extra work but it gives you more

play04:01

customizability Google and apple have

play04:03

put a ridiculous amount of effort to

play04:05

make the developer experience on their

play04:07

platforms as pleasant as possible they

play04:09

stand to gain everything from having the

play04:11

best possible apps on their devices

play04:13

they've both created dedicated idees and

play04:16

emulators with purpose-built programming

play04:18

languages and powerful apis cotland and

play04:21

Swift are two of the most developer

play04:23

friendly languages out there and I would

play04:25

know I tried a ton of them either of Eco

play04:28

systems make an excellent envir

play04:29

environment to create mobile apps it's

play04:31

been such a tragedy that in the past we

play04:33

would need to throw it all away in the

play04:35

name of better crossplatform development

play04:38

the ability to build crossplatform apps

play04:40

with either of these ecosystems is a

play04:42

huge deal and that future is closer than

play04:45

ever before for both of these platforms

play04:48

Apple and Google have put a lot of work

play04:49

into the user experience on their

play04:51

platforms the design language is

play04:53

consistent and homogeneous across

play04:55

different applications the benefits of

play04:58

Swift UI and material UI should not be

play05:01

underestimated I don't know if you

play05:03

remember a time when all apps weren't

play05:05

just web app rappers but native apps

play05:07

feel so much better flutter fits

play05:09

somewhere in the middle of both of these

play05:11

ecosystems and creates its own

play05:13

abstraction layer both for developer and

play05:16

the user miss out on the design language

play05:18

and consistency of these very

play05:20

established platforms only native

play05:22

platforms can provide the best

play05:24

experience for both developers and users

play05:27

and look I don't want to rag on fluted

play05:29

too much I know people really like it

play05:31

but compared to this it feels like a

play05:33

middle ground where everyone has

play05:34

compromised and no one really gets what

play05:37

they want if you go native you know at

play05:39

least one set of users is getting the

play05:41

best possible experience and the other

play05:43

is getting a translation layer that's

play05:45

comparable with what they would have

play05:46

with flutter anyway but why stop there

play05:50

if we can already write a single code

play05:51

base for IOS and Android why not go

play05:54

further and use the same code base for

play05:56

your desktop apps as well the browser

play05:58

company recently released a Windows

play06:00

version of their Swift application by

play06:02

recreating winui components in Swift you

play06:06

can share application logic between all

play06:08

platforms but use Swift with specific

play06:10

bindings to create different uis this is

play06:13

the windows sample app provided by the

play06:15

browser company that shows how to use

play06:17

Swift to create Windows applications as

play06:20

you can see this is all written in Swift

play06:22

but they import the Win app SDK Windows

play06:24

foundation and wiui to call these apis

play06:27

directly from within Swift allowing us

play06:29

to write Swift but ship on Windows since

play06:32

the browser company hasn't had a need

play06:34

for Linux or Android yet there are no

play06:36

bindings for those platforms but these

play06:38

projects are open source so it's only a

play06:41

matter of time if you want to write a

play06:43

crossplatform application for mobile and

play06:45

desktop including Linux using native

play06:47

tools today your best bet is the first

play06:50

tool covered in this video cotlin

play06:52

compose compose does more than code

play06:54

generation it uses application binary

play06:56

interfaces to call cotlin code in other

play06:59

Lang anges directly the team have

play07:01

created bindings for all major platforms

play07:03

so compost can actually run anywhere

play07:05

even embedded systems this is an example

play07:08

of an app that runs everywhere the

play07:10

composed team provide this Todo app that

play07:12

can run on all platforms you can have as

play07:15

much shared or platform specific code as

play07:17

you want to and it's all cotlin and it's

play07:20

all composed we can run on Android iOS

play07:25

Mac OS windows and even Linux

play07:30

clearly I enjoy using native tooling

play07:32

cotland and Swift have honestly changed

play07:34

the way I think about programming

play07:35

languages they are just so pleasant but

play07:38

whatever tooling you do use whether it

play07:40

is native development or flut or react

play07:43

native or Progressive web apps the

play07:45

developer and user experience across all

play07:47

tooling is better than it has ever been

play07:49

before we are so lucky to be a part of

play07:52

this Renaissance in software engineering

play07:54

there has never been a better time to

play07:56

turn your awesome idea into a delightful

play07:58

app whatever tool you use I can't wait

play08:01

to see what you create

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Cross-PlatformNative AppsSwift UIKotlin ComposeMobile DevelopmentCode SharingDeveloper ToolsUser ExperiencePlatform EcosystemsProgramming LanguagesSoftware Engineering