Giter Site home page Giter Site logo

Comments (6)

erswelljustin avatar erswelljustin commented on July 19, 2024

I have found this as well the error I am getting is

'String' is not a subtype of 'DictioanryIndex<NSObject, AnyObject>'

on the following lines in ChatViewController.swift

let frameNew = userInfo[UIKeyboardFrameEndUserInfoKey].CGRectValue()
let duration = userInfo[UIKeyboardAnimationDurationUserInfoKey].doubleValue
let frameNew = userInfo[UIKeyboardFrameEndUserInfoKey].CGRectValue()

Can someone show how to fix this as I have done some googling and I cannot find a solution as swift in Xcode Beta 3 is relatively new

from chats.

pbrewczynski avatar pbrewczynski commented on July 19, 2024

@erswelljustin

You can investigate problem (I unfortunately don't have a time):

Try conditionally unwrapping:

let frameNew = userInfo[UIKeyboardFrameEndUserInfoKey]?.CGRectValue()

And be careful since frameNew would be by this moment the optional value.

And then probably you can unwrap the value (in the following code) since your are sure that there have to be value for that key in dictionary.

I'm kind of not sure how it could pass in earlier version of Xcode since Dictionaries should return optionals

from chats.

matsuokashuhei avatar matsuokashuhei commented on July 19, 2024

@erswelljustin

I did

let frameNew = (userInfo[UIKeyboardFrameEndUserInfoKey] as NSValue).CGRectValue()
let duration = (userInfo[UIKeyboardAnimationDurationUserInfoKey] as NSNumber).doubleValue
let frameNew = (userInfo[UIKeyboardFrameEndUserInfoKey] as NSValue).CGRectValue()

Let's try

from chats.

ma11hew28 avatar ma11hew28 commented on July 19, 2024

Thanks, all. @matsuosh your solution seems to work. I pushed a fix. Thanks!

from chats.

matsuokashuhei avatar matsuokashuhei commented on July 19, 2024

@mattdipasquale
I have learned a lot in your app.
I will be glad if I was of any help.

from chats.

ma11hew28 avatar ma11hew28 commented on July 19, 2024

@matsuosh I'm glad to hear that. Thank you for the positive feedback and for checking out this project. I learned a lot myself while building it, and still, I'm sure there are many more improvements to be made. And, I'm sure we both still have more to learn and to teach each other. I look forward to learning more from you and to sharing what I learn with you and others. Best wishes to you, my friend! :-)

from chats.

Related Issues (20)

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.