草庐IT

target_user

全部标签

swift - 无法将类型 '(User?, Error?) -> ()' 的值转换为预期的参数类型 'AuthDataResultCallback?'

当我更新firebasepod时出现此错误:Cannotconvertvalueoftype'(User?,Error?)->()'toexpectedargumenttype'AuthDataResultCallback?'(aka'Optional()>')staticfuncsignUp(username:String,email:String,User:String,Phone:String,password:String,imageData:Data,onSuccess:@escaping()->Void,onError:@escaping(_errorMessage:Str

swift ,火力地堡 : No datas in realtime database after creating user

使用Xcode10.1、Swift4.2和Firebase##使用以下代码将数据上传到firebase后,我在实时数据库中看不到数据:staticfunccreateUser(username:String,email:String,password:String,imageData:Data,onSuccess:@escaping()->Void,onError:@escaping(_error:String?)->Void){Auth.auth().createUser(withEmail:email,password:password){(data,error)inifleter

swift - 如何获取并添加到 Syncano 对 user_profile 的引用

如标题所示,我有问题如何添加到syncano对user_profile的引用,如果有人可以告诉我一个提示?所以这是我的代码:funcsaveName(){letUerextra=userextra()Uerextra.name=(self.dict.objectForKey("first_name")as?String)!Uerextra.lastName=(self.dict.objectForKey("last_name")as?String)!Uerextra.avatarUrl=self.dict.objectForKey("picture")?.objectForKey("d

ios - iMessage 扩展 : Getting bundle nil from different target

我有一个现有的应用程序,想创建一个iMessage扩展程序。所以我在我的项目中添加了目标iMessage扩展。现在我想通过容器View在该扩展中显示我现有的View。我添加了代码:letmainBundle=Bundle(identifier:"com.marvel.nearby")print("MAIN_BUNDLE:\(mainBundle)")//gettingnilletstoryboard=UIStoryboard(name:"Main",bundle:mainBundle)letviewController=storyboard.instantiateViewControl

LeetCode-给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标。

给定一个整数数组nums和一个整数目标值target,请你在该数组中找出和为目标值target的那两个整数,并返回它们的数组下标。输入:nums=[2,7,11,15],target=9输出:[0,1]解释:因为nums[0]+nums[1]==9,返回[0,1]。语法JAVA实现classSolution{publicint[]twoSum(int[]nums,inttarget){if(nums==null)returnnull;//哈希表key是nums[i]values是IMapmap=newHashMap();for(inti=0;iLeetCodereturnnewint[]{ma

swift - 添加目标 :action:forControlEvents: selector syntax when target is nil?

我想要一个父ViewController来处理由它的一个子ViewController生成的Target-Actions。根据Apple文档,这应该可以通过将target设置为nil并遵循响应链来实现。Ifyouspecifynilforthetargetobject,thecontrolsearchestheresponderchainforanobjectthatdefinesthespecifiedactionmethod.https://developer.apple.com/documentation/uikit/uicontrol但是当target为nil时,我该如何编写a

iOS 本地通知 : app is not asking for permissions to notify the user

我不确定这是否是一个奇怪的错误,但在我的-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions我有以下几行代码来请求用户权限://RegisterforPushNotitications,ifrunningiOS8if([applicationrespondsToSelector:@selector(registerUserNotificationSettings:)]){UIUserNotificationTypeuserNotif

ios - 如何在 iOS 上使用 Sign In with Google 修复 `The user canceled the sign-in flow.`?

我正在将SigninwithGoogle与iOSFirebaseSDK集成。当用户点击GIDSignIn按钮时,应用程序会显示一条警告,显示“MyAPP”想要使用Google.com登录,但警告很快就会消失。我在didSignInForuser:GIDGoogleUser方法中得到的错误如下:2019-02-2116:54:13.104279+0530MyApp[18743:185089][Warning]Attemptingtoloadtheviewofaviewcontrollerwhileitisdeallocatingisnotallowedandmayresultinunde

ios - 使用 TARGET_INTERFACE_BUILDER 时出现 Swift 协议(protocol)编译错误

我正在尝试为@IBDesignable控件生成示例数据,因此在为IB构建时,我将控件欺骗成它自己的数据源。结果是我将一些方法添加到协议(protocol)中,仅供IB使用,作为一个好公民,我希望在常规(非IB构建)中删除这些方法。我已将我的问题提炼为以下代码片段。我的协议(protocol)看起来像这样:-protocolTestProtocol{#ifTARGET_INTERFACE_BUILDERfuncmyControl(control:AnyObject,colorForIndexindex:UInt)->UIColor?funcmyControl(control:AnyObj

swift - 如何从嵌套的父 firebase 获取 user_id

我想根据user_id检索站点信息,我正在使用以下查询来检索站点信息ref=Database.database().reference()self.ref.child("sites").queryOrdered(byChild:"user_id").queryEqual(toValue:"DxMYXkVqnZMC6NEZxdSQF3G2ZJ53").observe(.childAdded,with:{snapshotinif(snapshot.valueisNSNull){print("Notfound")}else{print("found")}})如果它的store_name、id