Saturday, June 27, 2015

Mobile Application Programing: iOS Lecture I

I am continuing with  Mobile programming iOS  with Matt Stoker I read some of  - Apple's Introduction to Swift.





He has developed MobileFinder/Studio

On to Week 1 demo and presentation 

Companies target iOS platforms before they do Android.

Xcode starts around the 43 minute mark

Starting with Single View Application








Right click project, show in finder

As you add files, the build phases tabs adds the files to compile:




Images.xcassets - different pixel densities

Info.plist - metatdata about the project


For now, remove story board file.


@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {


    var window: UIWindow?


class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.

    }




        window = UIWindow(frame:UIScreen.mainScreen().bounds)
        window?.makeKeyAndVisible()
        window?.backgroundColor = UIColor.greenColor()
        
        
        let lightView1 = UIView()
        lightView1.frame = CGRectMake(40.0, 50.0, 200.0, 100.0)
        lightView1.backgroundColor = UIColor.blueColor()
        window?.addSubview(lightView1)
        
        
        
        let lightSwitch = UISwitch()
        lightSwitch.frame = CGRectMake(200.0, 250.0, 100.0, 200.0)

        window?.addSubview(lightSwitch)







No comments:

Post a Comment