기본 콘텐츠로 건너뛰기

5월, 2022의 게시물 표시

iOS, Test Flight

 ・AppStore Connector ①appstoreでアプリ生成 ・XCode ① bundle name : 大文字なし ②app icon 登録 ④Xcode > Archive > Distribution > AppStore update  ・AppStore Connector ①AppからTestFlight ②テスター追加(招待) ③ビルド選択 ・Tester ①iPhoneでTestFlightアプリを設置 ②メールで招待メールからLinkをタップ ③TestFlightで招待をOK ④アプリインストール

SwiftUI, View visibility

  extension View {   @ViewBuilder func visibility ( _ isShow: Bool ) -> some View {     if isShow {         self     } else {              }   } extension View {   @ViewBuilder func visibility ( _ isShow: Bool ) -> some View {     if isShow {         self     } else {         hidden ()     }   } } https://swiftuirecipes.com/blog/how-to-hide-a-swiftui-view-visible-invisible-gone

SwiftUI, iOS14, hide Keyboard

       @State private var isKeyboardVisible = false if isKeyboardVisible {                     Button {                          hideKeyboard ()                      } label : {                         Color . clear . edgesIgnoringSafeArea (. all )                     }                 }                  . onReceive ( keyboardPublisher ) { newIsKeyboardVisible in                     print( "Is keyboard visible? " , newIsKeyboardVisible)                     isKeyboardVisible = newIsKeyboardVisible                 } import Foundation import SwiftUI import Combine extension UIApplication {     func endEditing () {         sendAction ( #selector ( UIResponder . resignFirstResponder ), to : nil , from : nil , for : nil )     } } protocol KeyboardReadable {     var keyboardPublisher : AnyPublisher < Bool , Never > { get } } extension KeyboardReadable {     var keyboardPublisher : AnyPublisher < Bool , Never > {         Publishers . Merge (          

SwiftUI, Floating TextField implement

  FloatingField ( "title" , text : $statevar )                                 . textFieldStyle ( RoundedBorderTextFieldStyle ())                                 . keyboardType (. asciiCapable ) struct FloatingField : View {     @Binding private var text : String     private var title : String          init ( _ title: String , text : Binding < String >) {         self . title = title         self ._text = text     }          var body : some View {         ZStack {             HStack {                 TextField ( title , text : $text )                     . textFieldStyle ( RoundedBorderTextFieldStyle ())             }                          if ! text . isEmpty {                 HStack {                     Text ( title )                         . font (. caption )                         . background (. white )                                              Spacer ()                 }. offset ( x : 7 , y : - 17 )                              }         }