並び順

ブックマーク数

期間指定

  • から
  • まで

41 - 65 件 / 65件

新着順 人気順

swiftuiの検索結果41 - 65 件 / 65件

  • SwiftUIでSFSafariViewControllerを使う手法の探求 - cockscomblog?

    SwiftUIからSFSafariViewControllerを使いたい場面は多い。 SafariView SFSafariViewControllerはビューコントローラーだから、UIViewControllerRepresentableを使ってSwiftUIのビューにしてしまうのが簡単か。 import SwiftUI import SafariServices struct SafariView: UIViewControllerRepresentable { typealias UIViewControllerType = SFSafariViewController typealias Configuration = SFSafariViewController.Configuration private let url: URL private let configuratio

      SwiftUIでSFSafariViewControllerを使う手法の探求 - cockscomblog?
    • SwiftUIでMVVMやるシンプルなパターン3つ

      @MainActor class SampleViewModel: ObservableObject { @Published var model: SampleModel init(model: SampleModel) { self.model = model } var count: Int { get { return model.count } set { model.count = newValue } } var stars: String { return model.stars } func changeStarsLength(_ len: Int) { model.changeStarsLength(len) } } struct SampleView: View { @StateObject var viewModel: SampleViewModel var bod

        SwiftUIでMVVMやるシンプルなパターン3つ
      • iOS 13でもStateObjectが使いたい! - Lento con forza

        iOS 14から使えるStateObject、とても便利ですよね developer.apple.com ObservableObjectなどを初期化するときに便利です。 class Object: ObservableObject { @Published var value = "value" } struct Content: View { @StateObject var object = Object() var body: some View { Text(object.value) } } ただ、これはiOS 14以降でしか使えないため、iOS 13に対応が必要な場合は使えません。代わりにObservedObjectを使います。 struct Content: View { @ObservedObject var object = Object() var body: som

          iOS 13でもStateObjectが使いたい! - Lento con forza
        • The Complete Guide to SF Symbols

          The Complete Guide to SF Symbols Example code, tips, and techniques for both SwiftUI and UIKit SF Symbols allows us to render a huge and growing variety of icons inside our apps, and every year it gets bigger – not only do many more icons get added, but iOS 14 added the ability to render multicolor icons and iOS 15 added the ability to have complete control over individual layers. In this article

            The Complete Guide to SF Symbols
          • 日経電子版をSwiftUIで作ってみた — HACK The Nikkei

            この記事はNikkei Advent Calendar 2020の 1 日目の記事です。 アプリチームの高木です。iOS エンジニアなので iOS の話をします。 本記事では、SwiftUI を使って日経電子版 iOS アプリのトップの UI を再現しました。簡易的に実装を紹介します。 自己紹介 普段は日経電子版・紙面ビューアー・Nikkei Waveの iOS アプリ及び BFF(Backends For Frontends)を開発しています。 直近だと iOSDC 2020 でiOSで安定した自動ダウンロードを実現する話をしていました。 背景 SwiftUI が発表されてから早一年半経ちました。 UIKit から SwiftUI へいつから移行できる(すべき)か、SwiftUI のみでどの程度のアプリを構成できるのか、気になっている方は多いと思います。 日経電子版のアプリを Swift

              日経電子版をSwiftUIで作ってみた — HACK The Nikkei
            • SwiftUIで日本語テキストが不自然に改行される | DevelopersIO

              SwiftUIのTextビューで日本語を表示する際、意図しない箇所で改行が入ることがある。改行コードを使わずに改行位置を調整する方法を紹介する。 日本語テキストが不自然に改行される SwiftUIのTextビューで日本語を表示する時、意図しない箇所で改行が入ることがある。たとえば「あなたに寄り添う究極のイノベーション」というフレーズが、「あなたに寄り添う\n究極のイノベーシ\nョン」と不自然に改行されることがある。 例図では以下のように表示されている。 あなたに寄り添う 究極のイノベーシ ョン あなたの未来を形 作る最上のガジェ ット 英語圏で作られたWebサイトでの日本語の改行問題 英語圏で作られた後に日本語に翻訳されたサイトの例では、「今すぐダウンロード」というフレーズが「今すぐダウンロー\nド」と表示されることがあった。日本人の感覚からするとこれには強い違和感がある。他にも禁則処理が

                SwiftUIで日本語テキストが不自然に改行される | DevelopersIO
              • WWDC22、iOS16:数行のコードで作成できるSwiftUIの新機能(26本) - Qiita

                ※一般公開されているWWDC Keynoteの動画と公開Session/Documentation/Sample Codeページだけを使ってこの記事を執筆しました。 新しいビューの種類: Gauge - 進捗状況を表示する新しいビュー 複数日付選択ツール 図表 複数列のテーブル グリッド(格子)表示 貼り付けボタン MacOS メニューバーアプリ ナビゲーション・スタック ナビゲーションのスプリットビュー UIを変更する新しいビューモディファイア: グラデーションカラーを生成する インナーシャドウ、アウターシャドウの追加 SwiftUIで直接利用(互換性のあるビューは不要になりました)。: 共有シート 写真選択ツール アプリのレビューを依頼 機能の改善: サイズ変更可能なシート SF Symbolカラーバリエーション 複数行のテキストフィールド テキストフィールドを添付したアラート スコー

                  WWDC22、iOS16:数行のコードで作成できるSwiftUIの新機能(26本) - Qiita
                • SwiftUI App Lifecycle Explained – LearnAppMaking

                  Home » App Development » SwiftUI’s App Lifecycle Explained SwiftUI's App Lifecycle Explained Written by Abhinav Girdhar on March 11 2021 in App Development, SwiftUI Bye-bye AppDelegate! You can now build SwiftUI apps with the new App protocol and lifecycle, without needing an app- or scene delegate. How does the SwiftUI App lifecycle work? And how do you configure it? Let’s find out! In this tutor

                  • Numbers API を利用した実践的なアプリで学ぶ SwiftUI(UIKit) + TCA - Qiita

                    はじめに こんにちは、アイカワと申します。 この記事は iOS Advent Calendar 2020 の 23 日目の記事です。 昨日は堤さんの「coremltools 4.0でPyTorchモデルを変換する」でした。 最近は SwiftUI や The Composable Architecture(以後 TCA)の勉強をしていて、TCA についての解説記事もあまりないことを踏まえて、この記事を書こうと思います(ボリュームが想像以上に膨れあがってしまいすみません🙇‍♂️ ) iOS のバージョンの兼ね合いもあって SwiftUI をプロダクトに導入する事はまだ難しいかもしれませんが、TCA は UIKit でも利用できます。(Combine に依存しているため、iOS13 からしか利用できませんが😢 ) また、利用方法は SwiftUI と UIKit でそこまで大きくは変わらな

                      Numbers API を利用した実践的なアプリで学ぶ SwiftUI(UIKit) + TCA - Qiita
                    • Tweaking The iOS System Fonts

                      Before you switch to a custom font don’t overlook how much you can tweak the appearance of the system fonts. A quick review of some font APIs that work for both UIKit and SwiftUI. Tweaking The System Fonts Here’s my starting point. I’m using dynamic type with a large title and body text. I’m not going to spend time on the layout details. (See this post on scroll view layouts for a UIKit example).

                        Tweaking The iOS System Fonts
                      • Mastering SwiftUI previews

                        Mastering SwiftUI previews 10 Mar 2021 This week, I want to talk about one of the most powerful Xcode features, SwiftUI previews. SwiftUI previews allow you to look at your SwiftUI views inside Xcode without running the app in the simulator. You can also preview UIKit views and controllers by wrapping them in SwiftUI. Today we will learn about all the powerful features of previews in Xcode. Enhanc

                          Mastering SwiftUI previews
                        • SwiftUI / Jetpack Composeでよくある画像のプレビュー画面を実装する - inSmartBank

                          こんにちは。スマートバンクで iOS / Android エンジニアをしている nakamuuu です。 先日リリースした新しいメンバーシッププラン「B/43プラス」では支払いの明細へ画像を添付できるようになりました!添付した画像は明細画面にサムネイル状に表示され、タップするとプレビュー画面へと遷移して画像が大きく表示されます。 今回、私はこのような画像のプレビュー機能を iOS / Android の両OSそれぞれで SwiftUI / Jetpack Compose を用いて実装しました。 このエントリーでは SwiftUI / Jetpack Compose の各フレームワークにおけるジェスチャー操作のAPIや振る舞いの差異を踏まえつつ、 “よくある画像のプレビュー画面” を実装するにあたっての知見を紹介していこうと思います。 プレビュー画面の要件 上述したプレビュー画面ではユーザー

                            SwiftUI / Jetpack Composeでよくある画像のプレビュー画面を実装する - inSmartBank
                          • Simplifying Backwards Compatibility in Swift

                            Every year as new OS and Swift versions are released, the question comes up over and over again: “how do I use this new thing while also supporting older versions?”. While we have a bunch of “availability” tools at our disposal (and I’ll be using them in this post), they always come across as somewhat cumbersome: we need to do inline checks, or we have conditional logic flow that obfuscates the in

                            • Swift Package Managerを活用したクラシルリワードのiOSアプリ構成 - dely Tech Blog

                              はじめに クラシルリワードについて クラシルリワードのiOSアプリについて 技術スタック Project Management Swift Package Managerのモジュール粒度 Package.swiftの例 Screen Architecture Screen Structure Builder Controller(UIHostingController) ScreenView(SwiftUI) ViewModel(ObservableObject) BaseViewModel Screen Navigation ConcurrencyのTask管理について DemoApp その他の取り組み 自動生成 Development Flow 最後に はじめに こんにちは!クラシルリワードiOSエンジニアのfunzinです。 この記事ではクラシルリワードのiOSアプリの構成について紹

                                Swift Package Managerを活用したクラシルリワードのiOSアプリ構成 - dely Tech Blog
                              • SwiftUI でリスト要素のインプレッションを計測する

                                こちらは Wantedly Advent Calendar 2023 2日目の記事です はじめに ネイティブアプリではスクリーン表示やタップなどのイベントの計測が一般的にありますが、一覧の中にある特定の要素が表示されたかを計測したい要件が必要な場合があります UIKit では willDisplayCell や scrollViewDidScroll などで実現していたものを SwiftUI ではどのように行ったかを紹介します ゴールとしてはこのようなリストデータ上のセルの表示領域が 70% 以上現れたらインプレッションされたと扱います anchorPreference preference は environment とは逆に子要素側から親要素へ値を伝えるモディファイアで anchorPreference はそれのジオメトリに特化したモディファイアになります key には Prefere

                                  SwiftUI でリスト要素のインプレッションを計測する
                                • SwiftUIのDynamicPropertyを試す - cockscomblog?

                                  SwiftUIにはDynamicPropertyというprotocolがある。 これを使ってみようという趣旨の記事を見かけた。 ので、私も試してみました。 @Now import Combine import SwiftUI class Clock: ObservableObject { @Published private(set) var date: Date = Date() init() { Timer.publish(every: 1, on: .main, in: .default) .autoconnect() .assign(to: &$date) } } @propertyWrapper struct Now: DynamicProperty { @StateObject private var clock = Clock() var wrappedValue: Date

                                    SwiftUIのDynamicPropertyを試す - cockscomblog?
                                  • SwiftUIとGraphQLでプロダクトの継続的な破壊に立ち向かう

                                    iOSDC2021 の発表資料です

                                      SwiftUIとGraphQLでプロダクトの継続的な破壊に立ち向かう
                                    • SwiftUIに適した新アーキテクチャの導入に挑む

                                      iOSDC2023 Day2の発表資料です

                                        SwiftUIに適した新アーキテクチャの導入に挑む
                                      • GitHub - ra1028/swiftui-hooks: 🪝 A SwiftUI implementation of React Hooks. Enhances reusability of stateful logic and gives state and lifecycle to function view.

                                        You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

                                          GitHub - ra1028/swiftui-hooks: 🪝 A SwiftUI implementation of React Hooks. Enhances reusability of stateful logic and gives state and lifecycle to function view.
                                        • SwiftUI でスポットライト機能を実装する - スタディサプリ Product Team Blog

                                          こんにちは、iOSエンジニアの @motoshima1150 です。 iOSDC Japan 2021の「スタディサプリ」がFull SwiftUIを選択した先に見えてきたもの。のトークセッションで収まりきれなかったTipsを紹介いたします。 はじめに 本記事では、Spotlight機能の実装方法について紹介します。 Spotlight機能とは、アプリのチュートリアルなどで画面はそのままに一部分を切り抜いた半透明Viewを重ねてユーザーの次の行動を促すことができる機能を指します。 要件としては次の要件を想定しています。 全画面を覆ったViewで任意の箇所を透過させたい 利用イメージ 例として、1と番号が振られたViewを明るく、それ以外の部分を暗く表示させるイメージです。 実装のステップは大きく2つに分けて説明します。 切り抜き用のFrameを取得する 指定した形にViewを切り抜く 切り

                                            SwiftUI でスポットライト機能を実装する - スタディサプリ Product Team Blog
                                          • SwiftUIで多言語化に対応してプレビューで確認する | DevelopersIO

                                            SwiftUIで多言語化対応したテキストを確認したかったのでその確認方法を記事にしようと思います。また多言語対応も行う度に調べてしまっていたので、改めて多言語対応の手順も振り返ってみることにしました。 環境 Xcode 13.3 多言語化対応を行う Localizationsを追加 Project > Info > Localozations の +ボタンを押します。 追加できるLocalizationが沢山出てくるので、追加したいものを選択します。 今回は、Englishに加え、Japanese、Arabic、Italian を追加しました。 Localization.stringを追加 Xcodeの上部メニューバー File > New > File を押します。 表示された中からStrings.fileを選択します。 ファイルの名前は必ずLocalizable.stringsにしてく

                                              SwiftUIで多言語化に対応してプレビューで確認する | DevelopersIO
                                            • SwiftUIを使ったアプリを1年運用してみてわかったこと|株式会社カウシェ

                                              (本記事は、2021年9月にiOSDC Japan 2021で発表した「SwiftUIで使ったアプリを1年運用してみてわかったこと」のトークセッションを文字起こししたものです。実際のセッション動画はこちら) こんにちは!カウシェの@akifumiです。 SwiftUIが発表され早2年が経ちました。 そんなSwiftUIですが、本番アプリで採用されているケースはまだまだ少ないかと思います。 そんな中、積極的に新しい技術を取り入れようと、私たちが2020年9月にリリースした、シェア買いアプリ「カウシェ」は、大部分をSwiftUI, Combineを活用して作っています。 今日は、リリースから1年運用した今、 SwiftUI, Combineを活用し、どのようなアーキテクチャで開発・運用しているのか SwiftUIで開発中に問題となった点 運用している中でわかった良かった点・悪かった点 などを紹

                                                SwiftUIを使ったアプリを1年運用してみてわかったこと|株式会社カウシェ
                                              • Observing Combine publishers in SwiftUI views | Swift by Sundell

                                                Articles and podcasts about Swift development, by John Sundell. This article has been archived, as it was published several years ago, so some of its information might now be outdated. For more recent articles, please visit the main article feed. SwiftUI offers multiple ways to connect a given view to the underlying state that it depends on, for example using property wrappers like @State and @Obs

                                                  Observing Combine publishers in SwiftUI views | Swift by Sundell
                                                • SwiftUI | Swiftly Engineered iOS

                                                  SwiftUI simplifies the development process by providing a clean, easy-to-learn syntax and reducing the amount of boilerplate code required to create responsive, modern user interfaces, making it a powerful tool for building apps quickly and efficiently. Do take note that building your project with SwiftUI means your app only runs on iOS 13, macOS 10.15, tvOS 13, and watchOS 6 ViewVStackHStackZStac

                                                  • How to write unit tests for SwiftUI apps

                                                    unit and acceptance testing, automation, productivity How do you write unit tests for a SwiftUI application? SwiftUI, with its declarative approach to UI development and its opaque types, doesn't lend itself to writing unit tests. Are UI and snapshot tests our only option? Should we generate multiple Previews for every behavior permutation of our views? The answer is simpler and doesn't require an

                                                      How to write unit tests for SwiftUI apps

                                                    新着記事