Mix and Match is when you want to combine other codes with Swift programming. For instance, using objective C with swift programming. You can find more details here.
Sharing on facebook import Social //create a sharing function for Facebook, in button clicked if let vc = SLComposeViewController(forServiceType: SLServiceTypeFacebook) { shareOnFb(vc: vc) } //add function below func shareOnFb(vc: SLComposeViewController) { vc.setInitialText("Posted this from my swift app") vc.add(thisImage) let theurl = URL(string: "http://swiftcodingreferencebook.blogspot.sg") vc.add(theurl) present(vc, animated: true, completion: nil) } Sharing on Instagram in info.plist Create a key of type array: LSApplicationQueriesSchemes Control+click and add a row Item 0 value: instagram add to class ViewController: UIViewController,...
Entities - tables Attributes - fields NSPredicate - used to query compilation, filter data Check - core data when creating app. Click on xcdatamodeled Create new entity Go to the bottom and click +Entities. Double click entity at the top and give it a name. Add attribute at the right hand side. Indicate the type. At the right hand side of the screen, you will find the data model inspector, where you can provide more details for the attribute. Click on the entity itself, on the right hand side, specify the codegen to be 'class definition'. If you are storing an image, the type will be Binary Data. Attributes - store in external data file (avoid huge use of space, can store pdf and other files as well) Editor -> Create NSManagedSubClass (If you change anything in the db, you need to add it manually into the classes) Defining relationships Storing data import CoreData //storing core data: let appDelegate = UIApplication.shared.delegate as! AppDeleg...
After planning it on paper, Go to Xcode and create a new project, single page. Click on the storyboard on the left side of the screen. Turn that single page into a navigation page with links. Embed it in a view controller (Editor - embed in Navigation Controller). (see this for details) Set the navigation controller as the initial view controller. You can edit the main title and the colour of the navigation bar using the main navigation controller attribute inspector. Add a bar button link at the top of home page with the words 'HOME'. The other pages will be populated with the back button. Add other view controllers by drag and dropping it back to the screen. Add the UI elements for these view controllers and add missing constraints. Click and drag from the button in the main navigation page to the view controllers they link to. For each view controllers added, go to file->new. Create new Cocoa Touch file for each view controller and give it a name. Click on...
Comments
Post a Comment