swift3

How to place text in the certain position when using SceneKit?

岁酱吖の 提交于 2019-12-24 08:34:25
问题 I have tried to follow the same simple logic as for cylinder, box … , so just by defining the position for textNode, but it is not working. func makeText(text3D: String, position: SCNVector3, depthOfText: CGFloat, color: NSColor, transparency: CGFloat) -> SCNNode { let textTodraw = SCNText(string: text3D, extrusionDepth: depthOfText) textTodraw.firstMaterial?.transparency = transparency textTodraw.firstMaterial?.diffuse.contents = color let textNode = SCNNode(geometry: textTodraw) textNode

Tabbar Item in Swift

≡放荡痞女 提交于 2019-12-24 08:30:07
问题 I have some issue in Tabbar controller . I put " FAQ " tab bar item in the bottom. When the app runs on the small screen devices, it automatically appears in More section. The problem is that I put "Nav Bar" in FAQ view controller. For large screens (ipad), FAQ bar item shows in bottom. When Navbar item goes to More section, navbar is appear as two bar. One bar is that I make and another bar is default bar. My current problem solving way is if (UIDevice.current.userInterfaceIdiom ==

JSON Image Parsing IOS Swift 3.0

半世苍凉 提交于 2019-12-24 08:16:03
问题 I'm totally new for iOS swift deveploment. I'm trying to do json image parsing with dynamic data/url, I tried without a result to search for examples for displaying data and images in table view or list view, can any one help me in achieving this task? Here is the following link for image parsing http://www.androidbegin.com/tutorial/jsonparsetutorial.txt 回答1: As a newbie i think this Library will ease your most of the work, SwiftyJSON the syntax is very dev friendly and simple , No struggling

Where are the swift/swiftc binaries for v3?

此生再无相见时 提交于 2019-12-24 08:07:14
问题 I've just downloaded the Xcode 8 beta, and am struggling to figure out where the swift and swiftc binaries are hidden. The Swift website says that the toolchain should be available at /Library/Developer/Toolchains and that it can be exported for use on command line with: $ export PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:"${PATH}" But that path doesn't seem to exist for me. I can see Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain , but that's for

The program duplicate the list on the tableview if I go back from secondviewcontroller

为君一笑 提交于 2019-12-24 07:59:12
问题 I have a viewcontroller with a tableview and with a list of places. If I touch a place from the list, I go to the SecondViewController scene to see more information about the place. But when I go back with the back button, the program duplicate my original list, so the places are two times on the list, then three times, four times... Every time if I go to the SecondViewController and then go back. Here is my ViewController: import UIKit var nev: [String] = [] var cim: [String] = [] var ar:

Swift conversion: ERROR - CGPathAddArc

吃可爱长大的小学妹 提交于 2019-12-24 07:59:00
问题 I am attempting to convert my Swift 2 code into the latest syntax(Swift 3). I am receiving the following error: Nil is not compatible with expected argument type 'UnsafePointer' (Swift 2 Code) CGPathAddArc(path, nil, overlayView.frame.width - radius/2 - xOffset, yOffset, radius, 0.0, 2 * 3.14, false) Can someone please help me resolve this conversion syntax issue? 回答1: path.addArc(withCenter: CGPoint(x: overlayView.frame.width - radius/2 - xOffset, y: yOffset), radius: radius, startAngle: 0,

UITableview: failed to obtain a cell from its dataSource

蓝咒 提交于 2019-12-24 07:38:29
问题 I get this error message: failed to obtain a cell from its dataSource The strange that func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { not even get called, problem is not that returned cell is nil. I put in breakpoints. cellForRowAt not get called. numberOfRowsInSection returns value. I do not know it is relating or not, but now I do not use UITableViewController , I just have a UIViewController , and it is the datasource and delegate for the

Alamofire 4 multipart upload with header

£可爱£侵袭症+ 提交于 2019-12-24 07:06:03
问题 How can I upload with my own headers using Alamofire v4? In case of v3, I made my own function for that like following codes, but I can't do the same thing with v4. static func upload(method: Alamofire.Method, urlString: String, multipartFormData: (data: Alamofire.MultipartFormData) -> (), completionHandler: ( response: Response<AnyObject, NSError>, statusCode:Int, json:JSON) -> ()){ Alamofire.upload(method, urlString, headers: MyRequest.makeHeaders(), multipartFormData: multipartFormData,

Call GameScene method from AppDelegate (Swift 3, SpriteKit, Xcode 8)

与世无争的帅哥 提交于 2019-12-24 06:48:56
问题 I am using Spritekit and swift 3 for create a game, my problem is when I try to call my pauseGame() method, present in my GameScene class (subclass of SKScene), from AppDelegate file within applicationWillResignActive(_ application: UIApplication) method. I already try to instantiate GameScene class and then call the method in my AppDelegate file in this way, although there is no compiler error it doesn't work: func applicationWillResignActive(_ application: UIApplication) { if let gameScene

Mute Voice Directions in Here Maps iOS SDK

牧云@^-^@ 提交于 2019-12-24 06:35:54
问题 I want to toggle the voice directions in my iOS app between on and off. The HERE maps instructions (https://developer.here.com/mobile-sdks/documentation/ios-hybrid-plus/topics_api_nlp_hybrid_plus/protocolnmaaudiomanagerdelegate-p.html) are still all in objective-C. It is quite clear in that language how to do this, but I am looking for the Swift 3 equivalent. That manual says: @optional (BOOL) audioManager:( NMAAudioManager *) audioManager shouldPlayOutput:( NMAAudioOutput *) output Called