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,...
It creates a navigation bar for all the pages in the storyboard. It has a back button, a title and a few other custom buttons that you can add. You can customise its colour as well. Add a navigation controller 1. Add it from the object library. 2. Drag it to a place outside the main storyboard. Make it the first page. 1. Select the navigation controller page 2. Drag it to the left of the first scene. 3. Go to attributes inspector, scroll and hide others until you see 'Is initial view controller' and check against it. 4. Control, click and drag from navigation controller to first scene and choose 'root view controller'. 5. To set the title, click on the view controller scene and select its title bar (the one with the battery). At where the attributes inspector is, key in the title of the app. 6. To make it such that all views have the same colour in the title bar, click on 'navigation bar' under 'navigation controller' on the left hand side of...
Add a file (.swift). Type: class ClassName { var property1: String init(prop1: String) { self.property1 = prop1 } } When referring to properties, use self.propertyName
Comments
Post a Comment