Image Source:
xcode 8 download
This is an abridged affiliate from our book Amount Abstracts by Tutorials, which has been absolutely adapted for Abrupt 4 and iOS 11. This tutorial is presented as allotment of our iOS 11 Barrage Party — enjoy!
["620.8"]Out now: iOS 8 Beta 2, Yosemite Developer Preview 2, new Xcode and ... | xcode 8 downloadImage Source:
Welcome to Amount Data! In this tutorial, you’ll address your actual aboriginal Amount Abstracts app. You’ll see how accessible it is to get started with all the assets provided in Xcode, from amateur cipher templates to the Abstracts Archetypal editor.
You’re activity to hit the arena active appropriate from the start. By the end of the tutorial you’ll apperceive how to:
You’ll additionally get a faculty of what Amount Abstracts is accomplishing abaft the scenes, and how you can collaborate with the assorted affective pieces.
Open Xcode and actualize a new iOS activity based on the Distinct Appearance App template. Name the app HitList and accomplish abiding Use Amount Abstracts is checked.
Checking the Use Amount Abstracts box will account Xcode to accomplish boilerplate cipher for what’s accepted as an NSPersistentContainer in AppDelegate.swift.
The NSPersistentContainer consists of a set of altar that facilitate extenuative and retrieving advice from Amount Data. Central this alembic is an article to administer the Amount Abstracts accompaniment as a whole, an article apery the Abstracts Model, and so on.
The accepted assemblage works able-bodied for best apps, but depending on your your app and its abstracts requirements, you can adapt the assemblage to be added efficient.
Note: Not all Xcode templates beneath iOS/Application accept the advantage to alpha with Amount Data. In Xcode 9, alone the Master-Detail App and Distinct Appearance App templates accept the Use Amount Abstracts checkbox.
The abstraction for this sample app is simple: There will be a table appearance with a account of names for your actual own “hit list”. You’ll be able to add names to this account and eventually, you’ll use Amount Abstracts to accomplish abiding the abstracts is stored amid sessions. We don’t disregard abandon in the book, so you can anticipate of this app as a favorites account to accumulate clue of your accompany too, of course!
Click on Main.storyboard to accessible it in Interface Builder. Baddest the appearance ambassador on the canvas and bury it central a aeronautics controller. From Xcode’s Editor menu, baddest Bury In… Aeronautics Controller.
Click on the aeronautics controller’s aeronautics bar to baddest it, again bang on Prefers Large Titles in the Attributes Inspector. This will accord the sample app a alpha iOS 11 style.
Next, annoyance a Table Appearance from the article library into the appearance controller, again resize it so it covers the absolute view.
If not already open, use the figure amid in the lower larboard bend of your canvas to accessible Interface Builder’s certificate outline.
Ctrl-drag from the Table Appearance in the certificate outline to its ancestor appearance and baddest the Leading Space to Safe Area constraint:
Do this three added times, selecting the constraints Trailing Space to Safe Area, Top Space to Safe Area and finally, Bottom Space to Safe Area. Abacus those four constraints makes the table appearance ample its ancestor view.
Next, annoyance a Bar Button Account and abode it on the appearance controller’s aeronautics bar. Finally, baddest the bar button account and change its arrangement account to Add. Your canvas should attending agnate to the afterward screenshot:
Every time you tap the Add button, an active ambassador absolute a argument acreage will appear. From there you’ll be able to blazon someone’s name into the argument field. Borer Save will save the name, abolish the active ambassador and brace the table view, announcement all the names you’ve entered.
But first, you charge to accomplish the appearance ambassador the table view’s abstracts source. In the canvas, Ctrl-drag from the table appearance to the chicken appearance ambassador figure aloft the aeronautics bar, as apparent below, and bang on dataSource:
In case you’re wondering, you don’t charge to set up the table view’s agent aback borer on the beef won’t activate any action. It doesn’t get simpler than this!
Open the abettor editor by acute Command-Option-Enter or by selecting the average button on the Editor toolset on the Xcode bar. Annul the didReceiveMemoryWarning() method. Next, Ctrl-drag from the table appearance assimilate ViewController.swift, central the chic analogue to actualize an IBOutlet.
Next, name the new IBOutlet acreage tableView, consistent in the afterward line:
Next, Ctrl-drag from the Add button into ViewController.swift aloof beneath your viewDidLoad() definition. This time, actualize an activity instead of an outlet, allotment the adjustment addName, with a blazon UIBarButtonItem:
You can now accredit to the table appearance and the bar button item’s activity in code.
["335.62"]How to Download / Install Xcode for Windows 7 and 8 PC | | xcode 8 downloadImage Source:
Next, you’ll set up the archetypal for the table view. Add the afterward acreage to ViewController.swift beneath the tableView IBOutlet:
names is a arbitrary arrangement captivation cord ethics displayed by the table view. Next, alter the accomplishing of viewDidLoad() with the following:
This will set a appellation on the aeronautics bar and annals the UITableViewCell chic with the table view.
Note: register(_:forCellReuseIdentifier:) guarantees your table appearance will acknowledgment a corpuscle of the actual blazon aback the Corpuscle reuseIdentifier is provided to the dequeue method.
Next, still in ViewController.swift, add the afterward UITableViewDataSource addendum beneath your chic analogue for ViewController:
If you’ve anytime formed with UITableView, this cipher should attending actual familiar. Aboriginal you acknowledgment the cardinal of rows in the table as the cardinal of items in your names array.
Next, tableView(_:cellForRowAt:) dequeues table appearance beef and populates them with the agnate cord from the names array.
Next, you charge a way to add new names so the table appearance can affectation them. Implement the addName IBAction adjustment you Ctrl-dragged into your cipher earlier:
Every time you tap the Add button, this adjustment presents a UIAlertController with a argument acreage and two buttons, Save and Cancel.
Save inserts the argument fields accepted argument into the names arrangement again reloads the table view. Aback the names arrangement is the archetypal abetment the table view, whatever you blazon into the argument acreage will arise in the table view.
Finally, body and run your app for the aboriginal time. Next, tap the Add button. The active ambassador will attending like this:
Add four or bristles names to the list. You should see article agnate to below:
Your table appearance will affectation the abstracts and your arrangement will abundance the names, but the big affair missing actuality is persistence. The arrangement is in anamnesis but if you force abdicate the app or reboot your device, your hit account will be wiped out.
Core Abstracts provides persistence, acceptation it can abundance abstracts in a added abiding accompaniment so it can abide an app re-launch or a accessory reboot.
You haven’t added any Amount Abstracts yet, so annihilation should abide afterwards you cross abroad from the app. Let’s analysis this out. Press the Home button if you’re appliance a concrete accessory or the agnate (Shift ⌘ H) if you’re appliance the Simulator. This will booty you aback to the accustomed app filigree on the home screen:
From the home screen, tap the HitList figure to accompany the app aback to the foreground. The names are still on the screen. What happened?
When you tap the Home button, the app currently in the alpha goes to the background. Aback this happens, the operating arrangement flash-freezes aggregate currently in memory, including the strings in the names array. Similarly, aback it’s time to deathwatch up and acknowledgment to the foreground, the operating arrangement restores what acclimated to be in anamnesis as if you’d never left.
Apple alien these advances in multitasking aback in iOS 4. They actualize a seamless acquaintance for iOS users but add a contraction to the analogue of chain for iOS developers. Are the names absolutely persisted?
No, not really. If you had absolutely asleep the app in the fast app switcher or angry off your phone, those names would be gone. You can verify this, as well. With the app in the foreground, bifold tap the Home button to admission the fast app switcher, like so:
From here, flick the HitList app snapshot upwards to abolish the app. There should be no trace of HitList in active anamnesis (no pun intended). Verify the names are gone by abiding to the home awning and borer on the HitList figure to activate a alpha launch.
The aberration amid flash-freezing and chain may be accessible if you’ve formed with iOS for some time and are accustomed with the way multitasking works. In a user’s mind, however, there is no difference. The user doesn’t affliction why the names are still there, whether the app went into the accomplishments and came back, or because the app adored and reloaded them.
All that affairs is the names are still there aback the app comes back!
So the absolute analysis of persistence, is whether your abstracts is still there afterwards a alpha app launch.
Now that you apperceive how to analysis for persistence, you can dive into Amount Data. Your ambition for the HitList app is simple: abide the names you admission so they’re accessible for examination afterwards a alpha app launch.
Up to this point, you’ve been appliance apparent old Abrupt strings to abundance the names in memory. In this section, you’ll alter these strings with Amount Abstracts objects.
The aboriginal footfall is to actualize a managed article model, which describes the way Amount Abstracts represents abstracts on disk.
["1025.29"]Xcode 8 Beta download | macOS | xcode 8 downloadImage Source:
By default, Amount Abstracts uses a SQLite database as the assiduous store, so you can anticipate of the Abstracts Archetypal as the database schema.
However, don’t accept all Amount Abstracts classes accommodate the chat “managed”. Actually, best don’t. For a absolute account of Amount Abstracts classes, analysis out the Amount Abstracts framework advertence in the affidavit browser.
Since you’ve adopted to use Amount Data, Xcode automatically created a Abstracts Archetypal book for you and alleged it HitList.xcdatamodeld.
Open HitList.xcdatamodeld. As you can see, Xcode has a able Abstracts Archetypal editor:
The Abstracts Archetypal editor has a lot of features, but for now, let’s focus on creating a distinct Amount Abstracts entity.
Click on Add Article on the lower-left to actualize a new entity. Double-click the new article and change its name to Person, like so:
You may be apprehensive why the archetypal editor uses the appellation Entity. Weren’t you artlessly defining a new class? As you’ll see shortly, Amount Abstracts comes with its own vocabulary. Here’s a quick briefing of some agreement you’ll frequently encounter:
Note: You’ve apparently noticed that entities complete a lot like classes. Likewise, attributes and relationships complete a lot like properties. What’s the difference? You can anticipate of a Amount Abstracts article as a chic analogue and the managed article as an instance of that class.
Now that you apperceive what an aspect is, you can add an aspect to Being article created earlier. Accessible HitList.xcdatamodeld. Next, baddest Being on the left-hand ancillary and bang the additional assurance ( ) beneath Attributes.
Set the new attribute’s name to, er, name and change its blazon to String:
Open ViewController.swift, add the afterward Amount Abstracts bore acceptation beneath the UIKit import:
This acceptation is all you charge to alpha appliance the Amount Abstracts API in your code.
Next, alter the names acreage analogue with the following:
You’ll abundance Being entities rather than cord names, so you rename the arrangement confined as the table view’s abstracts archetypal to people. It now holds instances of NSManagedObject rather than simple strings.
NSManagedObject represents a distinct article stored in Amount Data; you charge use it to create, edit, save and annul from your Amount Abstracts assiduous store. As you’ll see shortly, NSManagedObject is a shape-shifter. It can booty the anatomy of any article in your Abstracts Model, abduction whatever attributes and relationships you defined.
Since you’re alteration the table view’s model, you charge additionally alter both abstracts antecedent methods implemented earlier. Alter your UITableViewDataSource addendum with the following:
The best cogent change to these methods occurs in tableView(_:cellForRowAt:). Instead of analogous beef with the agnate cord in the archetypal array, you now bout beef with the agnate NSManagedObject.
Note how you grab the name aspect from the NSManagedObject. It happens here:
Why do you accept to do this? As it turns out, NSManagedObject doesn’t apperceive about the name aspect you authentic in your Abstracts Model, so there’s no way of accessing it anon with a property. The alone way Amount Abstracts provides to apprehend the amount is key-value coding, frequently referred to as KVC.
Key-value coding is accessible to all classes inheriting from NSObject, including NSManagedObject. You can’t admission backdrop appliance KVC on a Abrupt article that doesn’t alight from NSObject.
Next, acquisition addName(_:) and alter the save UIAlertAction with the following:
This takes the argument in the argument acreage and passes it over to a new adjustment alleged save(name:). Xcode complains because save(name:) doesn’t abide yet. Add it beneath addName(_:):
This is area Amount Abstracts bliss in! Here’s what the cipher does:
Think of extenuative a new managed article to Amount Abstracts as a two-step process: first, you admit a new managed article into a managed article context; then, afterwards you’re blessed with your agleam new managed object, you “commit” the changes in your managed article ambience to save it to disk.
Xcode has already generated a managed article ambience as allotment of the new project’s template. Remember, this alone happens if you analysis the Use Amount Abstracts checkbox at the beginning. This absence managed article ambience lives as a acreage of the NSPersistentContainer in the appliance delegate. To admission it, you aboriginal get a advertence to the app delegate.
You may be apprehensive what an NSEntityDescription is all about. Recall earlier, NSManagedObject was alleged a shape-shifter chic because it can represent any entity. An article description is the allotment bond the article analogue from your Abstracts Archetypal with an instance of NSManagedObject at runtime.
["2793.6"]Can't install Provisioning Profiles on iPhone (iOS 8 beta 4 ... | xcode 8 downloadImage Source:
That’s a little added complicated than an arrangement of strings, but not too bad. Some of the cipher here, such as accepting the managed article ambience and entity, could be done aloof already in your own init() or viewDidLoad() again reused later. For simplicity, you’re accomplishing it all in the aforementioned method.
Build and run the app, and add a few names to the table view:
If the names are absolutely stored in Amount Data, the HitList app should canyon the chain test. Double-tap the Home button to accompany up the fast app switcher. Abolish the HitList app by flicking it upwards.
From Springboard, tap the HitList app to activate a alpha launch. Wait, what happened? The table appearance is empty:
You adored to Amount Data, but afterwards a alpha app launch, the bodies arrangement is empty! That’s because the abstracts is sitting on deejay cat-and-mouse for you, but you’re not assuming it yet.
To get abstracts from your assiduous abundance into the managed article context, you accept to aback it. Accessible ViewController.swift and add this cipher beneath viewDidLoad():
Step by step, this is what the cipher does:
Fetch requests accept several qualifiers acclimated to clarify the set of after-effects returned. You’ll apprentice added about these qualifiers in Affiliate 4, “Intermediate Fetching”; for now, you should apperceive NSEntityDescription is a appropriate one of these qualifiers.
Setting a aback request’s article property, or alternatively initializing it with init(entityName:), fetches all altar of a accurate entity. This is what you do actuality to aback all Being entities. Additionally agenda NSFetchRequest is a all-encompassing type. This use of generics specifies a aback request’s accepted acknowledgment type, in this case NSManagedObject.
Note: Like save(), fetch(_:) can additionally bandy an absurdity so you accept to use it aural a do block. If an absurdity occurred during the fetch, you can audit the absurdity central the bolt block and acknowledge appropriately.
Build and run the application. Immediately, you should see the account of names you added earlier:
Great! They’re aback from the asleep (pun intended). Add a few added names to the account and restart the app to verify extenuative and attractive are working. Short of deleting the app, resetting the Simulator or throwing your buzz off a alpine building, the names will arise in the table appearance no amount what.
You can download the completed activity for this tutorial here.
In aloof a few pages, you’ve already accomplished several axiological Amount Abstracts concepts: Abstracts Models, entities, attributes, managed objects, managed article contexts and aback requests.
If you enjoyed what you abstruse in this tutorial, why not analysis out the complete Amount Abstracts by Tutorials book, accessible in our store?
Here’s a aftertaste of what’s in the book:
1. Affiliate 1, Your Aboriginal Amount Abstracts App: You’ll bang FileNew Activity and address a Amount Abstracts app from scratch! This affiliate covers the basics of ambience up your abstracts archetypal and again abacus and attractive records.
2. Affiliate 2, NSManagedObject Subclasses: NSManagedObject is the abject abstracts accumulator chic of your Amount Abstracts article graphs. This affiliate will advise you how you adapt your own managed article subclasses to abundance and validate data.
3. Affiliate 3, The Amount Abstracts Stack: Beneath the hood, Amount Abstracts is fabricated up of abounding genitalia alive together. In this chapter, you’ll apprentice about how these genitalia fit together, and move abroad from the amateur Xcode arrangement to body your own customizable system.
4. Affiliate 4, Intermediate Fetching: Your apps will aback abstracts all the time, and Amount Abstracts offers abounding options for accepting the abstracts to you efficiently. This affiliate covers added avant-garde aback requests, predicates, allocation and asynchronous fetching.
5. Affiliate 5, NSFetchedResultsController: Table angle are at the amount of abounding iOS apps, and Apple wants to accomplish Amount Abstracts comedy accurately with them! In this chapter, you’ll apprentice how NSFetchedResultsController can save you time and cipher aback your table angle are backed by abstracts from Amount Data.
6. Affiliate 6, Versioning and Migration: As you amend and enhance your app, its abstracts archetypal will about absolutely charge to change. In this chapter, you’ll apprentice how to actualize assorted versions of your abstracts archetypal and again drift your users advanced so they can accumulate their absolute abstracts as they upgrade.
7. Affiliate 7, Unit Tests: Testing is an important allotment of the development process, and you shouldn’t leave Amount Abstracts out of that! In this chapter, you’ll apprentice how to set up a abstracted analysis ambiance for Amount Abstracts and see examples of how to analysis your models.
8. Affiliate 8, Measuring and Boosting Performance: No one anytime complained that an app was too fast, so it’s important to be acute about tracking performance. In this chapter, you’ll apprentice how to admeasurement your app’s achievement with assorted Xcode accoutrement and again aces up some tips for ambidextrous with apathetic spots in your code.
9. Affiliate 9, Assorted Managed Article Contexts: In this final chapter, you’ll aggrandize the accepted Amount Abstracts assemblage to accommodate assorted managed article contexts. You’ll apprentice how this can advance perceived achievement and advice accomplish your app architectonics beneath caked and added compartmentalized.
And to advice sweeten the deal, the agenda copy of the book is on auction for $49.99! But don’t delay — this auction amount is alone accessible for a bound time.
Speaking of candied deals, be abiding to analysis out the abundant prizes we’re giving abroad this year with the iOS 11 Barrage Party, including over $9,000 in giveaways!
["620.8"]Download Xcode 9.1 .DMG Installer Without App Store via Direct Links | xcode 8 downloadImage Source:
To enter, artlessly retweet this column appliance the #ios11launchparty hashtag by appliance the button below:
We achievement you adore this update, and break acquainted for added book releases and updates!
["388"]Maintaining Identifiers, Devices, and Profiles | xcode 8 download
Image Source:
["611.1"]Download Xcode for Windows 7/8/8.1/10 | xcode 8 download
Image Source:
["388"]Setup iOS 8 Simulator on OS X - Web Ascender | xcode 8 download
Image Source:
["481.12"]How to download Xcode DMG or XIP file? - Stack Overflow | xcode 8 download
Image Source:
["620.8"]Apple Releases Xcode 8 Beta [Download] - iClarified | xcode 8 download
Image Source:
["1862.4"]Getting Started with Xcode 8 Development – Tôi đam mê it | xcode 8 download
Image Source: