xcode9-beta

How to fix “'@IBInspectable' attribute is meaningless on a property that cannot be represented in Objective-C” warning

谁说胖子不能爱 提交于 2019-12-18 14:17:27
问题 In Xcode 9 and Swift 4 I always get this warning for some IBInspectable properties: @IBDesignable public class CircularIndicator: UIView { // this has a warning @IBInspectable var backgroundIndicatorLineWidth: CGFloat? { // <-- warning here didSet { backgroundIndicator.lineWidth = backgroundIndicatorLineWidth! } } // this doesn't have a warning @IBInspectable var topIndicatorFillColor: UIColor? { didSet { topIndicator.fillColor = topIndicatorFillColor?.cgColor } } } Is there a way to get rid

Xcode 9 : Module compiled with Swift 3.1 cannot be imported in Swift 4.0

大兔子大兔子 提交于 2019-12-18 10:13:09
问题 After updating to Xcode 9, I tried to build one of my projects. I use the FacebookLogin pod. I have a compiler error in FacebookLogin/LoginButton.swift @testable import FacebookCore ❌ Module compiled with Swift 3.1 cannot be imported in Swift 4.0 In my target's build settings, the Swift language version is set to Swift 3.2 . I guess I need to wait for Facebook to update their pod ? Or any other suggestion ? Thanks ! 回答1: Update: Solution also tested and working in Swift 5 and Xcode 11.

How to enable UIDragInteraction on Custom UIViews for iPhone

你离开我真会死。 提交于 2019-12-13 15:18:07
问题 I've been trying to use Apple's new API to enable Drag interactions on Custom UIViews. I've managed to make it work when testing using iPad, but when I run the same app in my iPhone 7 - ios 11 beta 3, I'm not able to drag my custom UIViews. I've noticed that we need to enable drag interaction when using in UICollectionView and UITableViews collectionView.dragInteractionEnabled = true tableView.dragInteractionEnabled = true but I can't manage to find anything in the documentation or anywhere

Unable to import in CoreNFC in swift project Xcode 9 beta

▼魔方 西西 提交于 2019-12-13 08:31:49
问题 I am unable to import CoreNFC in a swift project. Getting this error No such module CoreNFC . I also added the framework to Linked Frameworks and Libraries . 回答1: According to a post on the Apple Developer forums, you can only build for a real device or the Generic iOS device as there is no x86 version of CoreNFC. Once you switch to one of these, you do not need to add CoreNFC to Linked Frameworks and Libraries , just @import it: @import CoreNFC; 来源: https://stackoverflow.com/questions

Accessing methods, actions and/or outlets from other controllers with swift

随声附和 提交于 2019-12-13 08:04:58
问题 I'm working on a macOS project where I have a split view containing 2 other ViewControllers and I can't figure out how to access the ViewControllers from my primary window's ViewController. this is the setup: Basically what I'm trying to do is use the Button in my ViewController on the top-left to access the Label in my SectionController on the right, which is embedded in my split view. Since I can't create an IBAction or IBOutlet for a control in a different ViewController, I can't figure

How to initialize a MLMultiArray in CoreML

淺唱寂寞╮ 提交于 2019-12-12 16:25:08
问题 I've got an array of 40 arrays with 12 double features, so the type is [[double]]. Currently I'm sending this data to Google Cloud ML API to get a related prediction. Since Apple recently introduced CoreML and coremltools, I converted my model from keras to .mlmodel to avoid thousand of google cloud api calls and do inference directly on my iPhone: coreml_model = coremltools.converters.keras.convert(new_Model, input_names=['accelerations'], output_names=['scores']) coreml_model.save(

Xcode 9 - Framework breakpoints

元气小坏坏 提交于 2019-12-09 11:07:59
问题 In Xcode 7 and 8, I have been able to debug a framework I've been developing by running the containing application within an xcworkspace that also contains the framework project. If I set breakpoints in the framework, they would get triggered at runtime. In Xcode 9 beta 6, this is no longer the case. So far, execution is only stopping at the framework breakpoints when debugging on simulator. When I debug on a physical device, the framework breakpoints do not stop execution and it appears they

How can I use Realm with Swift 4?

流过昼夜 提交于 2019-12-09 02:49:29
问题 I'm trying to run my current project in the new Xcode 9 beta, but when I do so it says Module compiled with Swift 3.1 cannot be imported in Swift 4.0 . How can I solve this problem? I'm not using cocoapods. 回答1: Update : As of v2.10.1, released 2017-09-14, Realm's prebuilt binaries include frameworks built with Xcode 9 for Swift 3.2 and 4.0. It's no longer necessary to build them yourself. The information below remains relevant to anyone looking to use Realm with prerelease versions of Xcode

Hide large title when scrolling up

心已入冬 提交于 2019-12-09 02:34:41
问题 I have a normal view controller that is embedded in a navigation controller. In this view controller, I have a table view that is using the constraints of the safe area. (I don't use a table view controller) The navigation controller is set to prefer large titles and the mode is set to .always. In beta 2 this worked perfectly, So when I came in the title was large and when I scrolled down it became small (Like the normal one). But since beta 3 this doesn't work anymore. Anyone know how to

Xcode 9 - Add an App Store icon

白昼怎懂夜的黑 提交于 2019-12-08 14:57:51
问题 i saw this new requirement in itunes connect (next to the App Store Icon ): As for now (Xcode 8.3.x) I have AppIcon assets next to the App Icon Source Is this requirement means i need to change any thing? or only that from Xcode 9.x.x the App Icon Source and the App store Icons are coupled and there is no option to change the App Store Icon in iTunes connect? 回答1: If you're using Xcode 9 or later, you should use your Assets catalog (See image below) to provide an App Store Icon for your app