草庐IT

APPDELEGATE

全部标签

ios - Quickblox + Swift 3.0 iOS SDK 错误 : No Application Found and QBConnectionZoneTypeProduction

我正在尝试创建一个基本的QBRequest并登录一个用户,或者至少返回一个用户不存在的错误。我在控制台中收到此错误。NSErrorFailingURLKey=https://api.quickblox.com/session.json,NSLocalizedRecoverySuggestion={"errors":{"base":["Noapplicationfound"]}},com.alamofire.serialization.response.error.data=,NSLocalizedDescription=Requestfailed:clienterror(422)我已经

ios - 我必须在 AppDelegate.swift 文件中写任何东西吗?

我只是想知道在发布Xcode项目之前是否必须在我的AppDelegate.swift文件中编写任何代码。当我不在AppDelegate中编写任何内容时,是否有必要或应用程序是否可以正常工作。 最佳答案 有必要吗?不,如果您查看UIApplicationDelegate协议(protocol),您会发现没有任何委托(delegate)方法被标记为必需。这是一个为方便起见而提供的类,可让您设置应用程序。Appledocs说得最好:Launchtimeisanimportantpointinanapp’slifecycle.Atlaunc

ios - 在 AppDelegate 中设置 UIButton 外观时如何更改 SafariViewController 中导航栏的色调

当在AppDelegate中设置UIButton.appearance()时,我正在尝试更改SFSafariViewController中导航栏的色调.例如:AppDelegatefuncapplication(_application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:[UIApplicationLaunchOptionsKey:Any]?)->Bool{//HereistheglobalsettingthatIwanttooverrideintheSafariViewControllerUIButton

iOS Swift 从推送通知以编程方式导航到某些 ViewController

我使用推送通知来通知用户应用中发生的不同类型的事件。某种类型的推送通知应该打开一个特殊的ViewController(例如,关于新聊天消息的通知确实会在单击时导航到聊天)为此,我在我的应用委托(delegate)中尝试了以下代码:funcapplicationDidBecomeActive(_application:UIApplication){ifvartopController=UIApplication.shared.keyWindow?.rootViewController{whileletpresentedViewController=topController.presen

swift - 从 AppDelegate 更改 WebView url

我在AppDelegate类中收到来自Firebase的通知。此通知包含一个名为“notif_url”的字符串。我已将此值放入名为“desired_url”的var中,现在我需要使用“desired_url”值更改我的WebViewurl。但我无法访问webview来更改它的url:@IBOutletweakvarmy_web_view:UIWebView!funcload_url(server_url:String){leturl=URL(string:server_url);letrequest=URLRequest(url:url!);my_web_view.loadReques

ios - AppDelegate.swift 中没有这样的模块 'AWSMobileClient' 错误

我正在尝试将aws框架与native应用程序链接起来。我正在使用cocoapods,我已经在我的Podfile中包含并安装了我需要的依赖项platform:ios,'9.0'use_frameworks!target'auth'doinherit!:search_pathspod'AWSMobileClient'pod'AWSUserPoolsSignIn'pod'AWSAuthUI'#Podsforauthtarget'authTests'doinherit!:search_paths#Podsfortestingendendtarget'auth-tvOS'do#use_frame

swift - 无法识别的选择器发送到 AppDelegate 中的实例

我试图让一个方法每5秒调用一次,无论应用程序是否打开或在后台运行,所以在我的AppDelegate中,我认为有一个调用方法的计时器是个好主意每5秒:varhelloWorldTimer=Timer.scheduledTimer(timeInterval:5.0,target:self,selector:#selector(sayHello),userInfo:nil,repeats:true)@objcfuncsayHello(){print("helloWorld")}但是,我得到这个错误:NSInvalidArgumentException',reason:'-[_SwiftVal

ios - 来自 appDelegate 的 popToRootViewController swift

我试图从应用程序委托(delegate)弹出到导航堆栈的RootViewController,但在将obj-c中的工作转换为swift时遇到了一些问题。在obj-c中的作用:UINavigationController*navigationController=(UINavigationController*)self.window.rootViewController;[navigationControllerpopToRootViewControllerAnimated:YES];我的转换尝试:varnavigationController:UINavigationControll

ios - 在保持 Tabbar 的同时在 AppDelegate 中打开 ViewController

在我的Xcode项目中,当用户点击通知时,我想首先将它们发送到我的tabBar中的某个项目,然后我想实例化一个ViewController并将一个对象发送到该ViewController。我有将它们发送到我想要的tabBar的代码,但我不知道如何在保持tabBar和导航栏连接到ViewController的同时将它们实例化到ViewController。关于这个的所有答案都要求您更改RootViewController,这让我在调用ViewController时失去与我的tabBar和导航栏的连接。现实生活中的例子:用户收到Instagram通知说“John开始关注你”->用户点击通知

ios - `duplicate symbol _main` Swift AppDelegate

我正在尝试将我的iOS应用程序转换为Swift。一切都很顺利,直到我尝试用.swift等效项替换我的AppDelegate.m/.h。现在,在构建时,出现以下错误:Ld/Users/ruben/Library/Developer/Xcode/DerivedData/Bowdoin_Dining-eevtozmixiiwpkdhanzlqfsrhfxr/Build/Products/Debug-iphonesimulator/Bowdoin\Dining.app/Bowdoin\Diningnormali386cd"/Users/ruben/Workspace/Development/O