xcode9

how can i put these print text into Textfield?

我是研究僧i 提交于 2019-12-02 13:40:49
UNUserNotificationCenter.current().getPendingNotificationRequests { DispatchQueue.main.async{//Contextual closure type '() -> Void' expects 0 arguments, but 1 was used in closure body let str:String = "" self.finalresulter.text = str self.finalresulter.text = "\($0.map{$0.content.title})" } } You are using $0 inside async { } closure. This closure expects no arguments, which means using $0 argument shortcut is invalid. You are evidently attempting to refer to requests array from getPendingNotificationRequests callback. The reason you can't by using $0 is that it's screened by DispatchQueue

UINavigationBar does not overlap to UICollectionView in swift 4

笑着哭i 提交于 2019-12-02 09:54:26
I put Navigation bar inside UICollectionView in swift 4. When I scroll the collectionView, it does not goes to back layer and it overlaps to Navigation Bar. self.collectionview.contentInset = UIEdgeInsetsMake(40, 0, 0, 0) I also write this code but it does not work. I also unselect the "Under Top Bars" in Extend Edges in Attributes Inspector. All the ways do not work. Can anyone help me please? 来源: https://stackoverflow.com/questions/46376475/uinavigationbar-does-not-overlap-to-uicollectionview-in-swift-4

problem with images loading on top of already set images swift 4

十年热恋 提交于 2019-12-02 09:34:34
I'm having an issue in my cellForItemAtIndexPath where I am setting an image to my cell's UIButton but every time I scroll the collectionView's cells, it's placing the image on top of the already set image again and again. I can tell because the shadow of the image is getting thicker and thicker. I'm pulling the images from an array that I created of image literals in that swift file and the correct images are loading so there's no problem there. I'm sure this is a simple fix for most but I can't seem to find an answer anywhere. Image of my cellForItemAtIndexPath function My app running before

Cannot test in-app purchases in Xcode 9 for macOS app

浪尽此生 提交于 2019-12-02 08:47:59
As of the release of iOS11 it has been a pain (if not impossible) testing in-app purchases. While I've found a great workaround for testing on iOS here: https://stackoverflow.com/a/46467498/4514671 I could not find anything for macOS apps. So here is what I did that kind of does the same as with the iOS workaround: In the App Store app Sign Out of your account (Store/Sign Out) In iTunes Connect create a brand new Tester Restart your computer Open your Xcode project Build & run Click on your Buy button to start a purchase Sign in with your newly created test account When prompted to Change the

Pass data back to previous VC using delegates and update custom cell

China☆狼群 提交于 2019-12-02 07:29:35
I am trying to pass data BACK to the previous viewController using delegates. Does anyone know how to pass data back from ViewController B to ViewController A ? So I want to pass data from SecondVC to FirstVC and update custom table view cells with the data from SecondVC 4 address text fields but for some reason, it's not updating at all. Any help will be much appreciated as I'm just at the beginning level so tried all sorts of things but not able to get it to work. FirstVC import UIKit class MainVC: UIViewController, UITableViewDelegate, UITableViewDataSource, DataSentDelegate { @IBOutlet

Properly archive iOS app with extensions

不想你离开。 提交于 2019-12-02 06:01:10
I've just added a new RichNotification Extension to my project. Now I've got "myApp" target and two targets for: "RichNotification" and "RichNotificationContent" When I archive the main target for the App Store works fine but I get this error while trying to upload to the App Store: ERROR ITMS-90700: "Incorrect Platform. You included the iOS arm64 executable “myAPP.app/PlugIns/myAPPRichNotifications.appex/myAPPRichNotifications” in your iOS bundle. Only iOS executables can be included." Is there any special procedure to archive an app with multiple extensions / targets? Special build config?

iPhone X - Safe Area does not achieve full-screen experience?

蹲街弑〆低调 提交于 2019-12-01 17:52:05
The new HIG for iPhone X available here , specify: "Provide a full-screen experience. Make sure backgrounds extend to the edges of the display, and that vertically scrollable layouts, like tables and collections, continue all the way to the bottom." Now I'd like to understand how to accomplish that with Xcode 9 GM, since it seems to me that the only view allowed to extend to the whole screen is the UIViewController root view, and that whenever I try to drag constraints for a view above that, i.e. WKWebView to the root view, the constraints get actually connected to the safe area, leaving both

ERROR ITMS-90725: Please update Xcode and rebuild your app

旧时模样 提交于 2019-12-01 17:51:13
My current project in Swift 3.2 and Xcode 8.3 this error comes today even I have successfully uploaded to iTunes before 3 days. ERROR ITMS-90725: "SDK Version Issue. This app was built with the iOS '10.3' SDK. All new iOS apps submitted to the App Store must be built with the iOS '11.0' SDK or later, included in Xcode [9.0] or later. Please update Xcode and rebuild your app." From Apple's Submitting apps to the App Store : Starting April 2018, all new iOS apps submitted to the App Store must be built with the iOS 11 SDK. And a related (older but probably useful) Technical Note : It is not

iPhone X - Safe Area does not achieve full-screen experience?

孤街浪徒 提交于 2019-12-01 17:06:48
问题 The new HIG for iPhone X available here, specify: "Provide a full-screen experience. Make sure backgrounds extend to the edges of the display, and that vertically scrollable layouts, like tables and collections, continue all the way to the bottom." Now I'd like to understand how to accomplish that with Xcode 9 GM, since it seems to me that the only view allowed to extend to the whole screen is the UIViewController root view, and that whenever I try to drag constraints for a view above that, i

Main Thread Checker: UI API called on a background thread: -[UIApplication delegate]

人盡茶涼 提交于 2019-12-01 17:01:57
Xcode 9 seems to be reporting a lot of Main thread calls to UIApplication properties. Even though the UI is not being updated this is particularly cumbersome due to the extension of logs it produces a default environment. 4 TestApp 0x0000000101c262e0 __39-[ViewController viewDidLoad]_block_invoke + 196 5 libdispatch.dylib 0x0000000102279654 _dispatch_call_block_and_release + 24 6 libdispatch.dylib 0x0000000102279614 _dispatch_client_callout + 16 7 libdispatch.dylib 0x0000000102289008 _dispatch_queue_serial_drain + 716 8 libdispatch.dylib 0x000000010227ce58 _dispatch_queue_invoke + 340 9