草庐IT

make_member_delegate

全部标签

swift - 在 Swift 中制定隐私政策 : How to make UIAlertController action button disabled until message is scrolled to the bottom

在我的iOS应用程序中,我尝试使用UIAlertController实现一个简单的隐私策略。根据法律,该政策在被接受之前必须是可滚动的——就像当今大多数隐私政策一样。根据我自己的研究,我发现您可以禁用和启用UIAlertAction按钮,但我不知道如何识别UIAlertController消息正文何时滚动。一直滚动到底部可能是一项要求,我有兴趣找出一种同样可行的方法。这是我当前为上面的默认外观UIAlertController编写的代码。letalertController=UIAlertController(title:"PrivacyPolicy",message:privacyP

ios - 将我的自定义类的委托(delegate)设置为我的 View Controller

我创建了一个自定义类,它是UICollectionReusableView的子类。它本质上是一个CollectionView的部分标题,我在上面添加了几个按钮。按下按钮时,我希望ViewController过滤结果(取决于按下哪个按钮)。我需要我的ViewController有一个到这个自定义类的导出,但这没有用,因为Xcode提示重复的内容有类(即使我只打算使用一个collectionView部分标题)。所以我的下一个选择是授权。我的问题有两个方面:如何将自定义类的委托(delegate)设置为ViewController?通常我在prepareForSegue中设置委托(deleg

ios - 导航 Controller 委托(delegate)方法没有得到调用

在下面的代码中,我试图在导航转换期间创建一个自定义动画器,但导航Controller委托(delegate)方法没有得到调用。请查看下面的代码并向我建议一个解决方案。请注意,我已将DemoTransitionAnimationViewController嵌入到导航Controller中。这个VC在它的View上有一个按钮。单击此View时,我将推送另一个ViewController。但是委托(delegate)方法仍然没有得到调用。CustomAnimator.swift////CustomAnimator.swift//LoginModule////CreatedbyShubhamO

swift - 在第一次加载 requestAuthorization 之后,viewDidLoad 的其余部分未执行,下一行跳转到委托(delegate)函数 (swift 3)

我的应用似乎在每次使用时都运行良好,但第一次除外。我要求用户授权,并且我在plist中有适当的键,但是在请求授权的行之后的其余viewDidLoad不执行。我在下面附加了断点,断点2没有在第一次使用该应用程序时命中。我很确定在获得授权后它会跳转到扩展中的funclocationManager。我可以等到最后才请求授权,直到一切都准备就绪,但不确定这是最好的还是唯一的出路。谢谢,classMapController:UIViewController,GMSMapViewDelegate{varlocationManager=CLLocationManager()varcurrentLoc

ios - 将 UITextField 委托(delegate)连接到自定义表格 View 单元格的文件所有者不工作 Swift 3

我已经创建了一个具有UITableView和自定义单元格和xib的ViewController。在自定义单元格xib中添加了一个UITextField。现在,我已将UITexField的委托(delegate)连接到自定义单元格xib的文件所有者,并在ViewController中添加了以下代码:extensionMyViewController:UITextFieldDelegate{functextFieldShouldReturn(_textField:UITextField)->Bool{textField.endEditing(true)returntrue}}上面的方法没有

swift 代码 : Is there a way to make the alert view disappear automatically

有没有办法让警报View自动消失……几秒钟后,无需用户操作。目前我的代码如下,它需要用户按确定才能消失警报对话框。我想显示警报而不需要用户干预,只是让警报在几秒钟内消失。感谢您提出任何意见。我的代码如下:funcshowAlertController(message:String){letalertController=UIAlertController(title:nil,message:message,preferredStyle:.Alert)alertController.addAction(UIAlertAction(title:"OK",style:.Default,han

ios - 从 Swift 调用 Objective-C 委托(delegate)的方法

我正在编写一些基于我们的objective-c应用程序功能的Swift类。我有一个带有符合协议(protocol)的委托(delegate)的objective-c类。我正在尝试从Swift类内部调用该委托(delegate)的方法,我将其简化为这样。FredTestProtocol.h:@protocolFredTestProtocol-(void)dumbMethod;@endFredTestClass.h:#import#import"FredTestProtocol.h"@interfaceFredTestClass:NSObject@property(nonatomic,we

ios - Swift - 通过委托(delegate)将 UIImage 传递给 UIImageView

我没有想法,我不知道如何解决这个问题。任何帮助将不胜感激。我有以下情况:MainViewController指向嵌入在NavController中的CollectionViewCollectionView指向一个DetailViewControllerDetailViewController显示在CollectionView中选择的完整图片,并有一个将此图像传递给MainViewController的按钮。为此使用协议(protocol)和委托(delegate)此图像现在应该显示在MainViewController的UIImageView中委托(delegate)工作。我的Main

ios - 使用 NSFetchedResultsController 移动行的方法及其委托(delegate)不起作用

我一直在努力关注this使用NSFetchedResultsController和NSFetchedResultsController委托(delegate)时在TableView中重新排列行的教程,但我的项目非常有问题。发生的事情是,当我尝试重新排列一行并将其删除时,这些行是随机的(可能不是随机的,但我看不到找到问题的模式)。我的实现有什么问题?TableView数据源:overridefunctableView(tableView:UITableView,cellForRowAtIndexPathindexPath:NSIndexPath)->UITableViewCell{let

ios - 解析错误 : PFObject does not have a member named 'createdAt'

我被困在那个问题上。我已经阅读了Parse文档(https://parse.com/docs/ios/guide#queries-query-constraints),但它对我帮助不大。错误当我尝试从PFObject获取“createdAt”或“updatedAt”时,出现以下错误:['PFObject']doesnothaveamembernamed'createdAt'代码这是(缩写)函数:funcloadCheckInData(){varquery=PFQuery(className:"CheckIn")query.orderByDescending("createdAt")qu