Tag: swift3

归档不成功,由于错误代码-1,虽然我可以做build立和安装在我的设备与发展概况

我的应用程序使用swift 3和核心数据编码作为离线信息存储。 由于长列表或错误,我无法归档我的应用程序 <unknown>:0: error: no such file or directory: '/Users/Ashwin/Library/Developer /Xcode/DerivedData/BeerScout-eweygxkfdhbkbkalbiyywrsuievg/Build /Intermediates/ArchiveIntermediates/BeerScout/IntermediateBuildFilesPath /BeerScout.build/Release-iphoneos/BeerScout.build/DerivedSources /CoreDataGenerated/BeerScout/Beer+CoreDataClass.swift' … And at last Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1 我检查过了 #1 Code optimizations #2 Clean project and derived data #3 Also checked for code-gen for core data files. #4 Revoke and recreate new certificates #5 Cleaning system junks […]

尝试呈现其视图不在窗口层次结构与localnotification UIAlertController

一旦用户点击本地通知,我试图呈现AlertView。 AlertView具有取消或正常的选项。 extension ViewController:UNUserNotificationCenterDelegate{ func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { print("Tapped in notification") if(defaults.object(forKey: "alertOn") != nil){ // Create the alert controller let alertController = UIAlertController(title: "Some text", message: "Some text again", preferredStyle: .alert) // Create the actions let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.default) { UIAlertAction […]

可折叠input格式Swift 3

我真的很失望,这就是为什么我问这个问题,我发现折叠式的TableView的在线教程,但他们是用一个string或类似的东西填充单元格。 我想用Swift 3制作这样的手风琴, 有几天我已经用UITableViewController尝试了很多东西,因为显然这是唯一可以折叠的东西,如果你想要不同的单元格的话。 无论如何,我开始这样做,但因为我在这里问我的问题,我不能在每个Section每个Cell中显示不同的UI 。 我相信有办法做到这一点,任何人有任何build议如何使这项工作? 我想也许有另一种方式来做到这一点(例如与ScrollView或什么的)

如何编辑UIAlertActionbutton的字体大小

现在我正在使用UIAlertController,我试图改变操作button的字体大小(确定和取消),但我还没有find任何解决scheme。 任何人都可以提供一个解决scheme 谢谢

如何通过在CollectionView中select一个单元格来更改图像

目前我正在从事一个项目,我的产品页面是这样的 在这里,我使用UIImageView来显示大图像,下面我使用CollectionView滚动一组图像。 我想从CollectionViewCell单击图像时相应地更改大图像。 由于这是我第一次使用这种function,所以我没有办法。 请有人给我一些build议。 谢谢。

Json和可变范围

我的错误应该很明显,但我找不到; 我有一个全局variables初始化我的课程的开始: class InscriptionStageViewController: UIViewController, UIPickerViewDelegate, UIPickerViewDataSource { var lesSemaines = [String]() 我尝试使用该函数与一个遥远的json文件填充这个数组 func getSemainesStages(){ let url = URL(string: "http://www.boisdelacambre.be/ios/json/semaines.json") let task = URLSession.shared.dataTask(with: url!){ (data, response, error) in if let content = data { do { let myJson = try JSONSerialization.jsonObject(with: content, options: JSONSerialization.ReadingOptions.mutableContainers) as AnyObject let listeSemaines = myJson["semaine"] as! [[String:AnyObject]] //print(listeSemaines) for […]

在不加载视图的情况下接收通知

正如我在这个问题中解释的,我试图将数据从一个TableView中的UISwitch传递到另一个ViewController。 但是,我希望在设置视图(包含UISwitch)被解散时传递数据。 在这个伟大的答案的第三个步骤之后,我使用UserDefaults来传递数据,并尝试使用NotificationCenter来更新UserDefaults值,当解散设置视图。 要更新用户默认值更改时,您可以让您的设置控制器解雇时发布通知。 然后,您应用中的其他VC可以侦听此通知并根据需要进行更新。 我已经尝试检索viewDidLoad内的通知,但值不会刷新,因为解散设置视图不会每次加载新的ViewController。 每次设置视图被解除时,我怎样才能接收/阅读通知? 更确切地说,我在哪里以及如何编写阅读通知的代码? 以下是发布通知的代码: class SettingsViewController: UIViewController { @IBAction func doneButton(_ sender: UIButton) { self.dismiss(animated: true, completion: nil) NotificationCenter.default.post(name: Notification.Name("nSound"), object: nil) } 以下是检索通知的代码: class ViewController: UIViewController { @IBOutlet weak var testLabel: UILabel! var savedValue = UserDefaults.standard.bool(forKey: "sound") override func viewDidLoad() { super.viewDidLoad() NotificationCenter.default.addObserver(self, selector: #selector(ViewController.viewDidLoad), name: Notification.Name("nSound"), object: nil) […]

解散Popover后更新第一个视图

我从第一个视图控制器(tableview)inheritance到第二个视图控制器,这是一个tableview。 我没有第二个视图后,我需要重新加载第一个控制器中的表视图。 popoverPresentationControllerDidDismissPopover被调用,如果我点击popup窗口外,但如果在第二个tableview中有另一个button,然后回到第一个? 通常我需要用户点击添加button才能从桌面视图中出来,而不是在popup窗口之外轻敲。 我保留外面的轻拍作为取消行动。 谢谢

如何在iOS中集成和触发Callkit目标c

现在,我想将CallKit Framework iOS(10.0)集成到这个应用程序中,但是我现有的代码是Objective-C语言。 我search了很多论坛,但都是Swift语言。 我也尝试整合在iOS Swift中的音箱 https://developer.apple.com/library/content/samplecode/Speakerbox/Introduction/Intro.html 。 但我试图将swift文件桥接到我的项目中,像#import“productname-Swift.h”到我的.m文件中,而且我将#import“AudioController.h”放入我的productname-Bridging-Header中。 H这些和所有工作正常,什么是我的问题是调用方法没有触发我用下面的方法来触发在VOIP推电话didReceiveIncomingPushWith providerDelegate?.reportIncomingCall(uuid:uuid,句柄:句柄,hasVideo:hasVideo,完成:完成) 当应用程序处于非活动状态并处于后台状态时,无法进入该方法,如果处于活动状态,则不会担心bcz触发单独的视图控制器。 请告诉任何人!

把我的TableViewcell与我的距离sorting来自swift3中的响应

即时通讯工作在地图和tableview。 我有4个地点,我有彼此之间的距离,现在我想要当我点击任何单元格,那么该单元格应该来第一个位置,之后与sorting所有其他位置将放置。 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let indexPath = tableView.indexPathForSelectedRow let currentCell = tableView.cellForRow(at: indexPath!)! print(currentCell.textLabel!.text as Any) print(indexPath?.row as Any) print(indexPath as Any) if (indexPath?.row) != 0{ tableView.beginUpdates() self.tableView.moveRow(at: IndexPath(row: (indexPath?.row)!, section: 0), to: IndexPath(row: 0, section: 0)) // self.tableView.moveRow(at: IndexPath(row: 0, section: 0), to: IndexPath(row: (indexPath?.row)!, section: 0)) tableView.endUpdates() […]