20200703のSwiftに関する記事は4件です。

匿名チャットアプリをappstoreに提出したときにされたリジェクト

匿名チャットアプリを出しましたが、結構審査は厳しいようです。
以下リジェクト内容です

Guideline 1.2 - Safety - User Generated Content

Your app enables users to post content anonymously but does not have the proper precautions in place.

Next Steps

To resolve this issue, please revise your app to implement all of the following precautions:

  • A method for filtering objectionable content
  • A mechanism for users to flag objectionable content
  • A mechanism for users to block abusive users
  • A mechanism for users to immediately remove posts from the feed
  • Developer must act on objectionable content reports within 24 hours by removing the content and ejecting the user who provided the offending content
  • Developer must provide contact information in the app itself, giving users the ability to report inappropriate activity

どうやら匿名で他人とやりとりできる場合、フィルタリング機能(ユーザーが不適切な内容をブロック・報告)、管理者による特定のユーザーの使用停止機能、ユーザーが不快なコンテンツを報告できる機能、管理者と直接やりとりできる機能が必要なようです。

  • このエントリーをはてなブックマークに追加
  • Qiitaで続きを読む

Firebase/Authenticationで匿名ログインにする方法

Friebaseで匿名ログイン

よくメールアドレス認証などは見られますが、匿名ログインについてはあまり見られないように思いますので、自身の備忘録を含めて記事を書こうと思います。

以下のコードを例えばIBActionのなかに書くことで匿名ログインが可能になります。

Auth.auth().signInAnonymously() { ( authResult, err ) in
            if let err = err {
                print("エラー\(err)")
                return
            }

            guard let user = authResult?.user else { return }
            let isAnonymous = user.isAnonymous
            self.uid = user.uid
            print("サインインに成功しました。\(self.uid)")
        }

ちなみにemail認証の時はAuth.auth().createUser()です。

  • このエントリーをはてなブックマークに追加
  • Qiitaで続きを読む

SwiftのProperty Wrappers 機能を使って自作の @-prefixed attributes.を作ってみた

概要

表題の通りであります。

引用

NSHiper

https://nshipster.com/propertywrapper/

Sample code

入力文字列値から空白と改行を削除する次のprefixed attributesのサンプルが下記になります。

@propertyWrapper を利用して、定義します。

import Foundation

@propertyWrapper
struct Trimmed {
    private(set) var value: String = ""

    var wrappedValue: String {
        get { value }
        set { value = newValue.trimmingCharacters(in: .whitespacesAndNewlines) }
    }

    init(wrappedValue initialValue: String) {
        self.wrappedValue = initialValue
    }
}

使ってみる。

struct Post {
    @Trimmed var title: String
    @Trimmed var body: String
}

var quine = Post(title: "  Swift Property Wrappers  ", body: "…")

print(quine.title)// Swift Property Wrappers 

こんな感じでいけます。

airbnbがよしなにやっていたので、勉強してみました。

airbnb github
https://github.com/airbnb/ResilientDecoding

コードと解説はNSHiperをそのまま引用しました、詳しい情報はNSHiperApple (github)を参考にして下さい。

  • このエントリーをはてなブックマークに追加
  • Qiitaで続きを読む

アプリを再審査に提出する際にYour package contains a file ..と出た

1度目の審査の時には出なかったエラーでした。おそらく1度目の提出の時のDisplayNameは英語、2度目の提出はDisPlayName日本語としたことが原因だと思います。参考

対処法

スクリーンショット 2020-07-03 16.32.48.jpg

画像のDebug Releaseに入力されている文字列の前に半角スペースが追加されていました。消去することでエラーは消えました。

  • このエントリーをはてなブックマークに追加
  • Qiitaで続きを読む