Web Age Webinar Series
Total Page:16
File Type:pdf, Size:1020Kb
WEB AGE TECHNOLOGY WEBINAR SERIES iOS Development using Swift Webinar Series WELCOME! To ask a question during the presentation type it in the “Questions” section Slides will be available shortly after the presentation Audio Recording will be published shortly after the presentation Webinar Series JASON BELL Webinar Series JASON BELL Webinar Series UPCOMING CLASSES iOS 10 Development with Swift June 26-30 goo.gl/oT0Z9W Webinar Series AGENDA Mobile Landscape and Development Options iOS Development Why Swift? Swift 4 and Xcode 9 Q & A Webinar Series MOBILE LANDSCAPE Webinar Series MOBILE LANDSCAPE Webinar Series NATIVE ANDROID DEVELOPMENT Language Java Kotlin Development Tool Android Studio Webinar Series NATIVE IOS DEVELOPMENT Language Swift Objective-C Development Tool Xcode AppCode (JetBrains) Webinar Series CROSS-PLATFORM DEVELOPMENT Web application Hybrid HTML-based cross-platform frameworks Apache Cordova / Adobe PhoneGap Native cross-platform frameworks Xamarin (C#) React Native (JavaScript) Appcelerator Titanium (JavaScript) Qt (C++) Webinar Series CROSS-PLATFORM DEVELOPMENT (PROS) Ability to more easily reuse code for multiple platforms Leverage existing language/framework knowledge Webinar Series CROSS-PLATFORM DEVELOPMENT (CONS) GUI components may still need to be coded multiple times to obtain a platform-specific look and feel Different platform design guidelines May not have access to all native functionality New native features may not be available right away Performance and offline functionality Webinar Series LANGUAGES FOR IOS NATIVE DEVELOPMENT Objective-C Original language for OS X and iOS development Still available and fully supported Swift Introduced by Apple in 2014 Released as open source in December of 2015 via swift.org The recommended choice for new app development Can interoperate with Objective-C code Webinar Series FUTURE OF SWIFT Many organizations outside of Apple have expressed interest in expanding the reach of Swift IBM – developer.ibm.com/swift Google Facebook and Uber – Have said they are considering making Swift "more central" to their operations Server-side web frameworks are appearing Perfect, Vapor, Kitura Webinar Series SWIFT VERSIONS Swift Version Release Date Xcode Version 1.0 September 2014 6.0 2.0 September 2015 7.0 3.0 September 2016 8.0 4.0 ? 9.0 Webinar Series DEVELOPMENT TOOLS Xcode is Apple's Integrated Development Environment (IDE) Several device simulators are included with Xcode Instruments is a performance- analysis and testing tool Webinar Series IOS SDK The iOS SDK provides the resources you need to develop native iOS apps Most system interfaces are provided as frameworks Contains a dynamic shared library and associated resources Added to your Xcode project as needed Webinar Series IOS SDK The iOS SDK is grouped into layers Each layer provides an increasing level of abstraction Higher layers are object-oriented and typically easier to use Lower layers are primarily composed of functions implemented in C Webinar Series IOS SDK Webinar Series IOS SDK Many frameworks within the SDK are grouped into smaller development kits that focus on specific functionality Event Scene Sprite Cloud Health Home Kit Kit Kit Kit Kit Kit Pass Push Store Web Map Watch Kit Kit Kit Kit Kit Kit And more… Webinar Series IOS SDK Apple ID - Free Develop and test on a device Individual or Organization Membership - $99 App Store distribution TestFlight beta testing App analytics Enterprise Program - $299 In-house app distribution Webinar Series SWIFT FEATURES Modern Inferred typing, closures, tuples, generics, and more Safe Variables are always initialized before use Arrays and integers are checked for overflow Memory is managed automatically Fast Leveraging the LLVM compiler infrastructure, Swift code is transformed into optimized native code at compile time Webinar Series SWIFT FEATURES Interactive Playgrounds REPL debugging console Interoperable Designed to provide seamless compatibility with Objective-C Maintains compatibility with a number of C language types and features Webinar Series SWIFT ENVIRONMENTS Command Line Any text editor and the Swift compiler REPL (Read-Eval-Print-Loop) Xcode Swift playground iOS or OS X project Other IDE Jet Brains AppCode Webinar Series SWIFT FROM THE COMMAND LINE DEMO Webinar Series SWIFT PLAYGROUNDS Playgrounds in Xcode behave much like a REPL but have many additional features Interactive GUI Code completion Ability to display graphics Great way to experiment and learn about Swift Webinar Series SWIFT PLAYGROUNDS DEMO Webinar Series SWIFT CONSTANTS AND VARIABLES Swift encourages the use of constants whenever possible Using a constant has several advantages over a variable Provides a better expression of programmer intent Allows the compiler to employ optimizations Helps to avoid unwanted side effects Webinar Series SWIFT CONSTANTS AND VARIABLES DEMO Webinar Series SWIFT OPTIONALS By default, every constant and variable in Swift must have a value at all times (cannot represent nil or null) This promotes safety and helps eliminate a common source of errors However, an optional can be used in situations where a value may be absent Webinar Series SWIFT OPTIONALS DEMO Webinar Series SWIFT INITIALIZATION A method that is called automatically when an object is created is called an initializer Defined using the init keyword A default initializer is automatically provided for any class or structure that does not have an initializer defined Non-optional properties can be defined without an initial value as long as they are given a value within an initializer Webinar Series SWIFT INITIALIZATION All properties of an object (including those defined in a subclass) must be assigned a value during initialization To help ensure this, Swift defines two types of initializers: Designated Initializer Convenience Initializer Webinar Series SWIFT INITIALIZATION A designated initializer fully initializes all properties of the object Must call an initializer of the subclass if one exists Webinar Series SWIFT INITIALIZATION A convenience initializer is a secondary, supporting initializer for a class Must call another initializer within the same class Should be identified by using the convenience keyword Webinar Series SWIFT INITIALIZATION A designated initializer must call a designated initializer from its immediate superclass A convenience initializer must call another initializer from the same class A convenience initializer must ultimately call a designated initializer Webinar Series SWIFT INITIALIZATION Webinar Series SWIFT INITIALIZATION Webinar Series SWIFT INITIALIZATION Initializers are not inherited from a superclass except under specific conditions If your subclass doesn't define any designated initializers, it automatically inherits all of its superclass designated initializers If your subclass provides an implementation of all its superclass designated initializers then it automatically inherits all of its superclass convenience initializers Webinar Series SWIFT INITIALIZATION The Swift compiler performs other checks to make sure initialization is done properly, completely, and safely DI must ensure all properties introduced by its class are initialized before calling a superclass initializer DI must call a superclass initializer before assigning a value to an inherited property CI must call another initializer before assigning a value to any property Webinar Series SWIFT 4 AND XCODE 9 At WWDC 2017, Apple made announcements related to Swift 4 and Xcode 9 Changes are less significant than the transition to Swift 3 Improvements to string data type Additional refinements around access modifiers Many improvements in the area of application size Webinar Series SWIFT 4 AND XCODE 9 developer.apple.com/videos/wwdc2017 What's New in Swift Webinar Series QUESTIONS? ? Webinar Series CONTACT Web Age Solutions www.webagesolutions.com/contactus/ US - 215-517-6540 Canada - 1-866-206-4644 Webinar Series.