Git Product home page Git Product logo

ios-8-swift-programming-cookbook's People

Contributors

vandadnp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-8-swift-programming-cookbook's Issues

Custom keyboard code issue

The keyboard shows correctly, but when you tap everywhere you got a:

Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=0x17027c540 {Message=Service Connection Interrupted}

Note that I also had to slightly modify the handleTapOnButton func to compile the code on Xcode 6 GA:

func handleTapOnButton(button: UIButton){
     let buttonText = button.titleForState(.Normal)
     if let proxy = textDocumentProxy{
-      proxy.insertText(buttonText)
+      proxy.insertText(buttonText!)
     }
   }

xtensionContext!.openURL open app but does not call -(BOOL) application:(UIApplication *)application handleOpenURL:(NSURL *)url

I implemented your solution for providing bus information in the today extension. All works quite fine in the Swift part, but for the completion handler for widgetPerformUpdateWithCompletionHandler to be called immediately while handing the table the old way that seem to leave empty rows while loading. Otherwise the method is called just once usually too early.
Yet when I click a cell and call openUrl, the main app is correctly opened but method handleOpenUrl is not called and so the app opens as it would without the extension.

Not getting all videos

I am not getting all the videos from my iPhone. Videos stored in Photos are being fetched not all.

How can I get all the videos stored in iPhone storage.

'[AnyObject]?' is not convertible to '[String]?'

chapter-camera/Taking Photos with the Camera/Taking Photos with the Camera/ViewController.swift:88:76: '[AnyObject]?' is not convertible to '[String]?'; did you mean to use 'as!' to force downcast?

License

Hello,

Really nice job, would you be so kind please to tell me which is the license for this code? Are there any restrictions to use it?

Thank you in advance!

Could not load NIB in bundle

I got it when build "Feeding Custom Cell to Collection View Using .xib File " in iOS 8 Cookbook.

Message: "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: ... "

How to fix it ?
Thanks

PopoverTableViewController crashes with iPhone

PopoverTableViewController crashes when the + button is clicked. By default Popovers are disabled for iPhones and I have to add the following extension to run the code.

extension UIPopoverController {
    class var _popoversDisabled : Bool {
        get { return false }
    }
}

I am using Xcode 6.3

homekit framework work only with iOS developer account

with xcode 6.1 a have the error : Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. (Cocoa error 4097.)" (connection to service named com.apple.homed.xpc) UserInfo=0x7f85f0cc08d0 {NSDebugDescription=connection to service named com.apple.homed.xpc}

VPN tunneling

Am I missing something, or is the VPN tunneling code non-functioning?

Objective-C method conflicts with optional requirement method

chapter-camera/Taking Photos with the Camera/Taking Photos with the Camera/ViewController.swift:36:8: Objective-C method 'imagePickerController:didFinishPickingMediaWithInfo:' provided by method 'imagePickerController(:didFinishPickingMediaWithInfo:)' conflicts with optional requirement method 'imagePickerController(:didFinishPickingMediaWithInfo:)' in protocol 'UIImagePickerControllerDelegate'

Question on Presenting Popovers

In Presenting Temporary Information on the Screen with Popovers from Chapter 1, I believe it is recipe 1.2, the book mentions that the popovers can be used on both iPads and iPhones. I checked my code and It looks like everything is the same as what you have in your repo (https://github.com/vandadnp/iOS-8-Swift-Programming-Cookbook/tree/master/chapter-basics/Presenting%20Temporary%20Information%20on%20the%20Screen%20with%20Popovers). The application does not have any errors and loads fine. When I click the plus to present the popover on an iPad it works perfectly but on an iPhone I get the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIPopoverController initWithContentViewController:] called when not running under UIUserInterfaceIdiomPad.'

Im still learning but when googling about that error it seems that this may be an iPad only feature. Just curious if this is true or if there is a way to make this work on an iPhone using out of the box swift code (i.e. no third party libraries)?

I thought I read something about a popoverPresentationController property in iOS8 that can do this but it seems like that would require many changes to the current code so not sure if that is the right way to go to make it work on an iPhone. Any information would be greatly appreciated.

Not an issue, just a thank you

I would like to thank you to provide those examples for free. They help me a lot has a new Swift developper.

Again : Thanks ! :

'AnyObject.Protocol' does not have a member named 'FlexibleTopMargin'

I got this error message

/Users/MNurdin/Documents/Github/iOS-8-Swift-Programming-Cookbook/chapter-multimedia/Playing Video Files/Playing Video Files/ViewController.swift:130:11: 'AnyObject.Protocol' does not have a member named 'FlexibleTopMargin'

In this ViewController file

  override func viewDidLoad() {
    super.viewDidLoad()

    playButton = UIButton(type: .System)

    if let button = playButton{

      /* Add our button to the screen. Pressing this button
      will start the video playback */
      button.frame = CGRect(x: 0, y: 0, width: 70, height: 37)
      button.center = view.center

      button.autoresizingMask =
        [.FlexibleTopMargin, .FlexibleLeftMargin, .FlexibleBottomMargin, .FlexibleRightMargin] //error message here

Please advice. Thank you.

Adding widgets to the Notification Center adds logo but no table

Hullo,

I tried implementing your 2.5 receipt “Adding widgets to the Notification Center but all I got in the notification center is the logo of the app but no table. I double-checked everything and set breakpoints in my widget code but none of them is ever reached. Please help.

Thanks, Fabrizio
ios simulator screen shot 03 giu 2015 16 17 50

Reading values from Keychain does not work when in Release mode

I'm unable to read values from the Keychain when using the Swift compiler Optimization Level [Fastest -O], which is default for Release mode apps.

https://github.com/vandadnp/iOS-8-Swift-Programming-Cookbook/blob/master/chapter-security/Finding%20Values%20in%20the%20Keychain/Finding%20Values%20in%20the%20Keychain/AppDelegate.swift

Seems like these lines are the problem:

var returnedData: Unmanaged<AnyObject>? = nil
let results = Int(SecItemCopyMatching(query, &returnedData))

Possible solution:
http://stackoverflow.com/questions/24145838/querying-ios-keychain-using-swift

var returnedData: AnyObject?
var results = withUnsafeMutablePointer(&returnedData) { SecItemCopyMatching(query, UnsafeMutablePointer($0)) }

Extra argument 'type' in call

I got this error message

/Users/MNurdin/Documents/Github/iOS-8-Swift-Programming-Cookbook/chapter-multimedia/Playing Video Files/Playing Video Files/ViewController.swift:120:26: Extra argument 'type' in call

In this ViewController file

override func viewDidLoad() {
    super.viewDidLoad()

    playButton = UIButton(type: .System) //error message here

Please advice. Thank you.

getLocation with timer

Hi, I use "Handling Location Changes in the Background" examples

On simulator works fine but on device not working
I use simulator iPhone 6 iOS 8.3 and device iPhone 6 iOS 8.3
On device when i click menu button i get location but after 30 seconds i can't get location

i need realy big help...

location services enabled

i add NSTimer

code:

import UIKit
import CoreLocation

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate,
CLLocationManagerDelegate {

  var window: UIWindow?
  var locationManager: CLLocationManager! = nil
  var isExecutingInBackground = false

  func locationManager(manager: CLLocationManager!,
    didUpdateToLocation newLocation: CLLocation!,
    fromLocation oldLocation: CLLocation!){
      if isExecutingInBackground{
        println(newLocation);
        locationManager.stopUpdatingLocation()
      } else {
        /* We are in the foreground. Do any processing that you wish */
      }
  }

 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
 {
    locationManager = CLLocationManager()
    locationManager.desiredAccuracy = kCLLocationAccuracyBest
    locationManager.requestAlwaysAuthorization()
    locationManager.delegate = self
    locationManager.startUpdatingLocation()
    return true
  }



  func applicationDidEnterBackground(application: UIApplication) {
    isExecutingInBackground = true
    var timer = NSTimer.scheduledTimerWithTimeInterval(30, target: self, selector: Selector("update"), userInfo: nil, repeats: true)


    /* Reduce the accuracy to ease the strain on
    iOS while we are in the background */
    locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters
  }

    func update() {
        println("test");
        locationManager.startUpdatingLocation()
    }

  func applicationWillEnterForeground(application: UIApplication) {
    isExecutingInBackground = false

    /* Now that our app is in the foreground again, let's increase the location
    detection accuracy */
    locationManager.desiredAccuracy = kCLLocationAccuracyBest
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.