![]() You can dm me anytime if you get stuck or confused and I will try to help you. YouTube recommendations algorithm is great and will help you find topics related to your watch history in iOS dev. Once you complete the basics, you will get a clear idea of how things work and what to do next. I know, in the beginning, you might get confused which topics should I learn first and what will be the learning path. Randomly pick up a video and code along with them. Follow every resource she shares and do additional research in topics you find difficult to understand.Īpart from the udemy course, I follow some YT channels with great content for learning like 'Code with Chris', 'iOS Academy', 'Kilo loco' and others. Her course is great for beginners and others and is pretty much oriented towards getting us started in the iOS development journey. First, I learned Swift language from the official documentation and then purchased Angela's course. In Xcode 10 and Swift 4.2, only the code completion function (or auto-complete) of the Xcode IDE has been discontinued for the old way. I've been learning iOS development for the past couple of months but I have a programming background. Let fetchRequest: NSFetchRequest = User.fetchRequest()Īnd as mentioned I would also suggest you get the Core Data by Tutorials book.I'm in the same boat as you buddy. NewUser.pic = #imageLiteral(resourceName: "jessica").jpegData(compressionQuality: 0.9) Long story short, here’s the code to make your project run: import UIKit ![]() Next, you try to set up the same object twice, then you try to assign a User to a property of type Data. Always make sure to use the same name everywhere. #imageLiteral(resourceName: "Jessica") should have been #imageLiteral(resourceName: "jessica"). Actually he lives below sea level in the Netherlands and is pretty down-to-earth but he does spend too much time in Xcode. The current release of Xcode is available as a free download from the Mac App Store. Xcode brings user interface design, coding, testing, debugging, and submitting to the App Store into a unified workflow. This allows Xcode to run some optimizations for you and you don’t have to worry about the FileManager which you would have needed to get the image you were referring to. Xcode is a complete developer toolset for creating apps for Mac, iPhone, iPad, Apple Watch, and Apple TV. First of all you should add all assets to the asset catalog. Your code was a little hard to follow, but I think I found the issue. Let fetchRequest = NSFetchRequest(entityName: "User") ![]() Try context.save() //save object to CoreData ![]() For information on using playground literals in Xcode, see Add a color, file, or image literal in Xcode Help. Playground literals in plain text outside of Xcode are represented using a special literal syntax. ![]() Object.pic = newUser //add image to object A playground literal is used by Xcode to create an interactive representation of a color, file, or image within the program editor. Let object = User(context: context) //create object of type MyEntity NewUser.pic = #imageLiteral(resourceName: "Jessica").jpegData(compressionQuality: 0.9) as NSObject? as! Data Lazy var context = ( as! AppDelegate).persistentContainer.viewContext This is a link to gitHub GitHub - redrock34/lebron. When the code loads it should just save the image literal to the Xcode project. I am getting a complie error at object.pic = newUser stating Cannot assign value of type ‘User’ to type ‘Data?’. image imageLiteral(resourceName: DiceOne) If you are writing the array of image literals, you can write the code for one image literal manually and then. A image litteral is a image located locally within the xcode project. My swift code below is trying to save a image litteral to binary core data pic. ![]()
0 Comments
Leave a Reply. |