xcode6

Change destination of Navigation Back button

♀尐吖头ヾ 提交于 2020-01-11 04:55:28
问题 How can I change the view controller the default navigation back button takes me to? The back button usually takes you back to the previous view controller. But what if I want it to go back by two view controllers? I mean I want to change the view controller the back button takes me to. I do not prefer creating a custom back button. So is there any other way? Probably an unwind segue linked to the back button or something? 回答1: Probably easiest way to achieve behaviour you want is to use

How do I intercept tapping of the done button in AVPlayerViewController?

你说的曾经没有我的故事 提交于 2020-01-10 21:45:05
问题 I created an AVPlayerViewController and an attached AVPlayer in the viewDidAppear method of a custom UIViewController . However, when I press the "Done" button my custom view controller is dismissed automatically. I would like to intercept this action in order to use my own unwind Segue, but I'm not sure how to do this. I've found examples for MPMoviePlayerViewController but not AVPlayerViewController . The code I found for MPMoviePlayerViewController is below: - (void)playVideo:(NSString *

How do I intercept tapping of the done button in AVPlayerViewController?

北慕城南 提交于 2020-01-10 21:44:47
问题 I created an AVPlayerViewController and an attached AVPlayer in the viewDidAppear method of a custom UIViewController . However, when I press the "Done" button my custom view controller is dismissed automatically. I would like to intercept this action in order to use my own unwind Segue, but I'm not sure how to do this. I've found examples for MPMoviePlayerViewController but not AVPlayerViewController . The code I found for MPMoviePlayerViewController is below: - (void)playVideo:(NSString *

Programmatically switching views swift

让人想犯罪 __ 提交于 2020-01-10 08:53:05
问题 I am trying out apple's new language swift in Xcode 6 beta. I am trying to programmatically switch views when a table view cell is pressed, although all it does is pull up a blank black screen. In my code, I commented out the things that didn't work. They would just make the iOS simulator crash. my code: // ViewController.swift // Step-By-Step Tip Calculator // Created by Dani Smith on 6/17/14. // Copyright (c) 2014 Dani Smith Productions. All rights reserved. import UIKit var

iOS 8 / Xcode 6 Simulator is not using HTTP Proxy anymore

久未见 提交于 2020-01-10 08:47:05
问题 My iOS 8 Simulator is not using my proxy settings anymore (I want to debug with Charles). The rest of the system does. The simulator somehow seems to get direct internet access. Have I missed some new setting? Caution: this is NO dup of How to use Charles Proxy on the Xcode 6 (iOS 8) Simulator?. I´m not trying to use SSL on the simulator in the first place. My simulator doesn´t even start to use the proxy. Charles: System: 回答1: Restart the simulator between proxy changes 回答2: This is correct.

Injecting a new stylesheet into a website via uiwebview using iOS8 Swift XCode 6

﹥>﹥吖頭↗ 提交于 2020-01-10 05:27:06
问题 I've seen a few options on here using just Objective-C, but I'm having trouble doing this with Swift iOS8 in XCode 6. I'm using the uiwebview to load a website. For sake of example, let's say its google.com. @IBOutlet var website: UIWebView! var url = "http://www.google.com" func loadUrl() { let requestURL = NSURL(string: url) let request = NSURLRequest(URL: requestURL!) website.loadRequest(request) } override func viewDidLoad() { super.viewDidLoad() website.delegate = self loadUrl() } func

Swift - Segmented control - Switch multiple views

心已入冬 提交于 2020-01-09 08:37:09
问题 Until now I still can't figure how to switch multiple views in one view controller. My storyboard is like this one. Right now I want to embed two views inside my view controller. My code for segmented control to switch two views in one view controller so far. import UIKit class PopularHistoryViewController: UIViewController { @IBOutlet weak var segmentedControl: UISegmentedControl! @IBAction func indexChanged(sender: UISegmentedControl) { switch segmentedControl.selectedSegmentIndex { case 0:

How to append a tuple to an array object in Swift code? [duplicate]

≡放荡痞女 提交于 2020-01-09 07:54:47
问题 This question already has answers here : Array of tuples in Swift (3 answers) Closed 4 years ago . I searched google, but i cant find a way to append new element to array object in Swift. The error code "Missing arguments fot parameter "name" in call" is come up. My code is followed. var arrayObj: [(id: Int, name: String)] = [] var idInt: Int = 1 var nameString: String = "hoge" arrayObj.append(( // ----> "Missing arguments fot parameter "name" in call" id: idInt, name: nameString )) if you

Class 'ViewController' has no initializers in swift

家住魔仙堡 提交于 2020-01-09 07:04:07
问题 Getting the complaint from the compiler when I am doing this class ViewController: UIViewController { var delegate : AppDelegate override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. //self.appDelegate = UIApplication.sharedApplication().delegate; } @IBAction func getData(sender : AnyObject) { } @IBAction func LogOut(sender : AnyObject) { } } However, if I just add ? at the end of AppDelegate like below and the error is gone

Xcode 6 Standard architectures exclude armv7s

不想你离开。 提交于 2020-01-09 04:38:29
问题 I am experimenting with Xcode 6 Beta, and noticed armv7s disappeared from Standard Architectures. I did scan through Xcode 6 release notes, but didn't see changes on that. Can anyone confirm this change? Xcode 5.1.1: Xcode 6 Beta: Update There is a thread on iOS 8 Beta forum discussing this topic as well. https://devforums.apple.com/thread/244407?tstart=0 Also note @ThomasW had an answer on adding armv7s to Architectures. 回答1: I also filed a bug on this and got a reply stating that this is