Deep Dive Into Swift - Presented at Coffee@DBG
In the previous month, Coffe@DBG Covered the basics of Swift, Apple's new programming language. This session introduces some of handpicked interesting features of Swift.
The document provides an introduction to Swift programming concepts including variables, constants, data types, operators, control flow, functions, arrays, dictionaries, classes, structs, enums and more. Code examples are provided to demonstrate how to declare and use variables, constants, functions, arrays, dictionaries, classes, structs and enums in Swift. Key Swift concepts like optionals, tuples, protocols and generics are also briefly covered through code snippets.
This document provides an overview of the Swift programming language. It discusses Swift's basic data types including variables, constants, strings, arrays, dictionaries, tuples, optionals, and basic control flow structures like if/else statements and loops. It also covers classes, structures, enums, extensions, generics, closures, and other advanced topics like protocols, operators, and subscripts.
Swift is a multi-paradigm programming language developed by Apple for iOS, macOS, watchOS, and tvOS. It was inspired by Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and other languages. The document discusses Swift's history, principles, syntax including variables, constants, data types, functions, closures, and control structures. It provides code examples and explanations of Swift's main features.
Introduction to Swift programming language.Icalia Labs
Take a look to Swift, if you've been developing for iOS in Objective-C many things may look familiar, maybe just "upgraded". If you're a first timer diving into iOS development we strongly recommend you to understand first the basics of Cocoa.
This presentation traces my evolutionary path through software unit-testing techniques. The examples are in Perl, but the concepts can be applied to other programming languages as well. This material was first presented to the San Francisco Perl Mongers in February 2009.
Functional Programming in JavaScript by Luis AtencioLuis Atencio
This document provides an overview of functional programming concepts using JavaScript. It discusses thinking functionally by avoiding side effects, writing declaratively, and ensuring functions always return values. Functional techniques like currying, composition, and memoization are explained. It also covers paradigms like referential transparency and the Liskov substitution principle. The document discusses how JavaScript supports functional programming with features like closures and higher-order functions. Common libraries for functional programming in JavaScript are listed. Finally, the document covers advanced topics like functors, monads, and how they can be used for error handling.
This talk discusses various issues of low-level PHP performance, such as: When is it more efficient to use arrays or objects? What causes catastrophic garbage collection? Does adding type annotations make PHP faster or slower?
I will answer these types of question with a (shallow) dive into PHP internals, touching on various topics like value representation, bytecode optimization and GC.
The document provides an overview of the Swift programming language, summarizing that it is fast, modern, and safe. It then covers key Swift concepts like variables, strings, arrays, dictionaries, optionals, control flow, functions, closses, classes, inheritance, enums, structs, protocols, extensions, and generics in under 3 sentences each. The document encourages learning more about Swift from Apple's official documentation.
The document provides an introduction to Swift programming concepts including variables, constants, data types, operators, control flow, functions, arrays, dictionaries, classes, structs, enums and more. Code examples are provided to demonstrate how to declare and use variables, constants, functions, arrays, dictionaries, classes, structs and enums in Swift. Key Swift concepts like optionals, tuples, protocols and generics are also briefly covered through code snippets.
This document provides an overview of the Swift programming language. It discusses Swift's basic data types including variables, constants, strings, arrays, dictionaries, tuples, optionals, and basic control flow structures like if/else statements and loops. It also covers classes, structures, enums, extensions, generics, closures, and other advanced topics like protocols, operators, and subscripts.
Swift is a multi-paradigm programming language developed by Apple for iOS, macOS, watchOS, and tvOS. It was inspired by Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and other languages. The document discusses Swift's history, principles, syntax including variables, constants, data types, functions, closures, and control structures. It provides code examples and explanations of Swift's main features.
Introduction to Swift programming language.Icalia Labs
Take a look to Swift, if you've been developing for iOS in Objective-C many things may look familiar, maybe just "upgraded". If you're a first timer diving into iOS development we strongly recommend you to understand first the basics of Cocoa.
This presentation traces my evolutionary path through software unit-testing techniques. The examples are in Perl, but the concepts can be applied to other programming languages as well. This material was first presented to the San Francisco Perl Mongers in February 2009.
Functional Programming in JavaScript by Luis AtencioLuis Atencio
This document provides an overview of functional programming concepts using JavaScript. It discusses thinking functionally by avoiding side effects, writing declaratively, and ensuring functions always return values. Functional techniques like currying, composition, and memoization are explained. It also covers paradigms like referential transparency and the Liskov substitution principle. The document discusses how JavaScript supports functional programming with features like closures and higher-order functions. Common libraries for functional programming in JavaScript are listed. Finally, the document covers advanced topics like functors, monads, and how they can be used for error handling.
This talk discusses various issues of low-level PHP performance, such as: When is it more efficient to use arrays or objects? What causes catastrophic garbage collection? Does adding type annotations make PHP faster or slower?
I will answer these types of question with a (shallow) dive into PHP internals, touching on various topics like value representation, bytecode optimization and GC.
The document provides an overview of the Swift programming language, summarizing that it is fast, modern, and safe. It then covers key Swift concepts like variables, strings, arrays, dictionaries, optionals, control flow, functions, closses, classes, inheritance, enums, structs, protocols, extensions, and generics in under 3 sentences each. The document encourages learning more about Swift from Apple's official documentation.
The document discusses how to work with Cocoa and Objective-C from Swift. It covers importing Objective-C frameworks, interacting with Objective-C APIs such as initializers, properties, and methods, type remapping between Objective-C and Swift types, working with AnyObject and optionals, blocks, and integrating Swift code with Interface Builder using outlets and actions.
We have this new language, Swift, which takes some familiar Apple patterns, and introduces some new ones. With tools like closures and method chaining, there are definitely some new ways to solve the age-old Obj-c architecture challenges. This talk will walk through some of the most common Obj-c design patterns rewritten in Swift, and showcase the strengths and weaknesses of this new language.
LLVM is currently finalizing the migration from typed pointers (i32*) to opaque pointers (ptr) -- the likely largest intermediate representation change in LLVM's history. In this talk, we'll discuss the motivations for the change, how it will affect developers working on/with LLVM in practice, and why this migration took such a long time. We'll also briefly cover possible future IR changes based on opaque pointers.
Typed Properties and more: What's coming in PHP 7.4?Nikita Popov
The document summarizes new features coming in PHP 7.4, including typed properties, arrow functions, the nullsafe operator, and array spread syntax. It also discusses future language features like property accessors and generics. Some deprecations are noted, such as changes to ternary operator and concatenation precedence to avoid ambiguity.
Swift is a new programming language that is statically typed, multi-paradigm, and designed to work with Cocoa and Cocoa Touch. It features modern language elements like optionals, generics, closures, and pattern matching. Swift code is compiled to native executables making it performant, and it is designed to bridge seamlessly with Objective-C and Cocoa allowing existing iOS and OS X apps to migrate code over.
The document discusses several Swift Evolution proposals including:
- Implicit returns from single-expression functions and closures which allows omitting the return keyword from functions/closures with a single expression.
- Opaque result types which allow abstracting away types using some to preserve type identity and information hiding.
- The Identifiable protocol which provides a standard way to identify values based on an ID property to enable change tracking in SwiftUI lists and other APIs.
- Property wrappers which define custom attributes to encapsulate property storage and behavior, eliminating boilerplate and providing patterns to define properties like @State, @Binding, @Published etc.
Symfony World - Symfony components and design patternsŁukasz Chruściel
There are so many Symfony components already, and they have some pretty neat perks. But have you seen them in action?
Design patterns are not a silver bullet. They will never resolve your problem on their own. On the other hand, design patterns provide a common ground for developers without going into details and could be used as building bricks to solve some more advanced problems.
During my presentation, I will take a closer look and explain the appliance of selected design patterns. What is more, I will take advantage of the Symfony ecosystem to implement them with ease.
I will do the presentation on sample code that developers will understand at all levels of expertise.
Functional programming, though far from new, has gained much traction recently. Functional programming characteristics have started to appear in the PHP world, too. Microframeworks including Silex and Slim, middleware architectures (Stack) and even standards (PSR-7) rely on concepts such as lambdas, referential transparency and immutability, all of which come from functional programming.
I’ll give you a crash course in Erlang, a pragmatic functional language to make you feel familiar with the functional paradigm. By comparing code samples between Erlang and PHP, you’ll find out how and why you should employ functional programming in your PHP applications. You’ll see that functional programming is nothing to be scared of. On the contrary, understanding its concepts broadens your programming horizon and provides you with valuable solutions to your problems.
This document provides an introduction to the Swift programming language presented by Giuseppe Arici and Matteo Battaglio. It covers the history and principles of Swift, highlighting that it is a modern, multi-paradigm language inspired by many other languages. The document then discusses key Swift concepts like constants and variables, functions and closures, tuples and pattern matching, classes and structs, protocols and extensions, generics and optionals. It encourages exploring these concepts through playgrounds and considers open questions around Swift's future and use in production environments.
The document discusses functional programming concepts like purity, laziness, immutability, and concurrency. It provides examples using Clojure to illustrate higher order functions like map and filter, immutable data structures, and concurrency in a functional paradigm. The key benefits highlighted are readability, maintainability, avoiding side effects, and easing concurrency through sharing immutable data across threads.
Entities lifecycle is usually something more than create and delete. Models with which we are working on day to day basis change their state under some business circumstances. State machine patterns can be a powerful allay when solving this kind of problem. How does it look like? What are the pros and cons of state machine usage? What are the things that we should be beware of? I will answer these questions during my talk, together with practical differences between the most popular implementation.
The document discusses inheritance in C++ programming. It defines inheritance as an "is-a" relationship between classes where a derived class inherits attributes and behaviors from its base class. Examples are provided of inheritance relationships between vehicles and specific types of vehicles like cars. The advantages of inheritance include code reuse, ability to extend and modify the base class without affecting other classes, and enhancing capabilities by adding new behaviors and customizing the base class.
PHP 8.0 is expected to be released by the end of the year, so it’s time to take a first look at the next major version of PHP. Attributes, union types, and a just-in-time compiler are likely the flagship features of this release, but there are many more improvements to be excited about. As PHP 8.0 is a major version, this release also includes backwards-incompatible changes, many of which are centered around stricter error handling and more type safety.
This talk will discuss new features already implemented in PHP 8, backwards-compatibility breaks to watch out for, as well as some features that are still under discussion.
This document provides an introduction to functional programming concepts and the Scala programming language. It begins with a brief history of object-oriented programming and why it became popular. It then discusses why functional programming has gained popularity in recent years due to its ability to handle parallel, reactive and distributed systems through immutable data and avoidance of mutable state. The document introduces functional programming concepts like immutable data, first-class functions and purity. It provides an example of functional-style programming in Scala. Finally, it outlines topics that will be covered about practical functional programming in Scala, including collections, functions, pattern matching and lazy evaluation.
This document provides information about Javier Eguiluz, a programmer and trainer from Spain who specializes in Symfony and Twig. It outlines his experience with Symfony and as the author of a popular Symfony book. The agenda covers tips, tricks, advanced features, best practices and new noteworthy features of the Twig templating engine.
This is the slide for what I shared in JS Group meetup, 2014, Taiwan. It covers what JavaScript could do for making the program more "functional", the benefits, price and the limitation.
For the past few years in the functional Scala community, the standard approach for adding features to an effect type (features like logging, stateful updates, or accessing config) has been Monad Transformers (EItherT, OptionT, WriterT, ReaderT, etc.).
While elegant and proven, monad transformers were imported directly from Haskell, and in Scala, they have poor ergonomics and poor performance. Using tagless-final on transformers can eliminate some of the boilerplate, but cannot improve performance, and tagless-final makes it insanely hard to locally introduce and eliminate features.
In this presentation, John will introduce an alternate approach he coined ‘effect rotation’, which shares most of the power of monad transformers, but with better ergonomics and no loss of performance. You will see how to use the ZIO library that John created to composably add different features into the ZIO effect type, to solve the same problems as monad transformers, but in a way that feels natural and idiomatic for Scala.
This document discusses integrating the Swift object storage user interface (UI) into the CloudStack management platform with single sign-on authentication. The integration includes developing a Swift UI within the CloudStack UI without modifying Java code, and an authentication middleware that allows Swift to authenticate users against CloudStack. Load balancers are configured to route API requests between Swift and CloudStack based on the URL path. The full configuration brings together the Swift UI, authentication, and load balancing to provide a single sign-on experience for both platforms.
iOS development using Swift - Swift Basics (2)Ahmed Ali
This document provides an overview of Swift basics, including data types, strings, collection types, control flow, and connecting user interface controls to code. It covers topics like integers, floating point numbers, booleans, tuples, arrays, dictionaries, if/else statements, for/forEach loops, while loops, switch statements, and more. The document is presented as a tutorial by Ahmed Ali on iOS development using the Swift programming language.
The document discusses how to work with Cocoa and Objective-C from Swift. It covers importing Objective-C frameworks, interacting with Objective-C APIs such as initializers, properties, and methods, type remapping between Objective-C and Swift types, working with AnyObject and optionals, blocks, and integrating Swift code with Interface Builder using outlets and actions.
We have this new language, Swift, which takes some familiar Apple patterns, and introduces some new ones. With tools like closures and method chaining, there are definitely some new ways to solve the age-old Obj-c architecture challenges. This talk will walk through some of the most common Obj-c design patterns rewritten in Swift, and showcase the strengths and weaknesses of this new language.
LLVM is currently finalizing the migration from typed pointers (i32*) to opaque pointers (ptr) -- the likely largest intermediate representation change in LLVM's history. In this talk, we'll discuss the motivations for the change, how it will affect developers working on/with LLVM in practice, and why this migration took such a long time. We'll also briefly cover possible future IR changes based on opaque pointers.
Typed Properties and more: What's coming in PHP 7.4?Nikita Popov
The document summarizes new features coming in PHP 7.4, including typed properties, arrow functions, the nullsafe operator, and array spread syntax. It also discusses future language features like property accessors and generics. Some deprecations are noted, such as changes to ternary operator and concatenation precedence to avoid ambiguity.
Swift is a new programming language that is statically typed, multi-paradigm, and designed to work with Cocoa and Cocoa Touch. It features modern language elements like optionals, generics, closures, and pattern matching. Swift code is compiled to native executables making it performant, and it is designed to bridge seamlessly with Objective-C and Cocoa allowing existing iOS and OS X apps to migrate code over.
The document discusses several Swift Evolution proposals including:
- Implicit returns from single-expression functions and closures which allows omitting the return keyword from functions/closures with a single expression.
- Opaque result types which allow abstracting away types using some to preserve type identity and information hiding.
- The Identifiable protocol which provides a standard way to identify values based on an ID property to enable change tracking in SwiftUI lists and other APIs.
- Property wrappers which define custom attributes to encapsulate property storage and behavior, eliminating boilerplate and providing patterns to define properties like @State, @Binding, @Published etc.
Symfony World - Symfony components and design patternsŁukasz Chruściel
There are so many Symfony components already, and they have some pretty neat perks. But have you seen them in action?
Design patterns are not a silver bullet. They will never resolve your problem on their own. On the other hand, design patterns provide a common ground for developers without going into details and could be used as building bricks to solve some more advanced problems.
During my presentation, I will take a closer look and explain the appliance of selected design patterns. What is more, I will take advantage of the Symfony ecosystem to implement them with ease.
I will do the presentation on sample code that developers will understand at all levels of expertise.
Functional programming, though far from new, has gained much traction recently. Functional programming characteristics have started to appear in the PHP world, too. Microframeworks including Silex and Slim, middleware architectures (Stack) and even standards (PSR-7) rely on concepts such as lambdas, referential transparency and immutability, all of which come from functional programming.
I’ll give you a crash course in Erlang, a pragmatic functional language to make you feel familiar with the functional paradigm. By comparing code samples between Erlang and PHP, you’ll find out how and why you should employ functional programming in your PHP applications. You’ll see that functional programming is nothing to be scared of. On the contrary, understanding its concepts broadens your programming horizon and provides you with valuable solutions to your problems.
This document provides an introduction to the Swift programming language presented by Giuseppe Arici and Matteo Battaglio. It covers the history and principles of Swift, highlighting that it is a modern, multi-paradigm language inspired by many other languages. The document then discusses key Swift concepts like constants and variables, functions and closures, tuples and pattern matching, classes and structs, protocols and extensions, generics and optionals. It encourages exploring these concepts through playgrounds and considers open questions around Swift's future and use in production environments.
The document discusses functional programming concepts like purity, laziness, immutability, and concurrency. It provides examples using Clojure to illustrate higher order functions like map and filter, immutable data structures, and concurrency in a functional paradigm. The key benefits highlighted are readability, maintainability, avoiding side effects, and easing concurrency through sharing immutable data across threads.
Entities lifecycle is usually something more than create and delete. Models with which we are working on day to day basis change their state under some business circumstances. State machine patterns can be a powerful allay when solving this kind of problem. How does it look like? What are the pros and cons of state machine usage? What are the things that we should be beware of? I will answer these questions during my talk, together with practical differences between the most popular implementation.
The document discusses inheritance in C++ programming. It defines inheritance as an "is-a" relationship between classes where a derived class inherits attributes and behaviors from its base class. Examples are provided of inheritance relationships between vehicles and specific types of vehicles like cars. The advantages of inheritance include code reuse, ability to extend and modify the base class without affecting other classes, and enhancing capabilities by adding new behaviors and customizing the base class.
PHP 8.0 is expected to be released by the end of the year, so it’s time to take a first look at the next major version of PHP. Attributes, union types, and a just-in-time compiler are likely the flagship features of this release, but there are many more improvements to be excited about. As PHP 8.0 is a major version, this release also includes backwards-incompatible changes, many of which are centered around stricter error handling and more type safety.
This talk will discuss new features already implemented in PHP 8, backwards-compatibility breaks to watch out for, as well as some features that are still under discussion.
This document provides an introduction to functional programming concepts and the Scala programming language. It begins with a brief history of object-oriented programming and why it became popular. It then discusses why functional programming has gained popularity in recent years due to its ability to handle parallel, reactive and distributed systems through immutable data and avoidance of mutable state. The document introduces functional programming concepts like immutable data, first-class functions and purity. It provides an example of functional-style programming in Scala. Finally, it outlines topics that will be covered about practical functional programming in Scala, including collections, functions, pattern matching and lazy evaluation.
This document provides information about Javier Eguiluz, a programmer and trainer from Spain who specializes in Symfony and Twig. It outlines his experience with Symfony and as the author of a popular Symfony book. The agenda covers tips, tricks, advanced features, best practices and new noteworthy features of the Twig templating engine.
This is the slide for what I shared in JS Group meetup, 2014, Taiwan. It covers what JavaScript could do for making the program more "functional", the benefits, price and the limitation.
For the past few years in the functional Scala community, the standard approach for adding features to an effect type (features like logging, stateful updates, or accessing config) has been Monad Transformers (EItherT, OptionT, WriterT, ReaderT, etc.).
While elegant and proven, monad transformers were imported directly from Haskell, and in Scala, they have poor ergonomics and poor performance. Using tagless-final on transformers can eliminate some of the boilerplate, but cannot improve performance, and tagless-final makes it insanely hard to locally introduce and eliminate features.
In this presentation, John will introduce an alternate approach he coined ‘effect rotation’, which shares most of the power of monad transformers, but with better ergonomics and no loss of performance. You will see how to use the ZIO library that John created to composably add different features into the ZIO effect type, to solve the same problems as monad transformers, but in a way that feels natural and idiomatic for Scala.
This document discusses integrating the Swift object storage user interface (UI) into the CloudStack management platform with single sign-on authentication. The integration includes developing a Swift UI within the CloudStack UI without modifying Java code, and an authentication middleware that allows Swift to authenticate users against CloudStack. Load balancers are configured to route API requests between Swift and CloudStack based on the URL path. The full configuration brings together the Swift UI, authentication, and load balancing to provide a single sign-on experience for both platforms.
iOS development using Swift - Swift Basics (2)Ahmed Ali
This document provides an overview of Swift basics, including data types, strings, collection types, control flow, and connecting user interface controls to code. It covers topics like integers, floating point numbers, booleans, tuples, arrays, dictionaries, if/else statements, for/forEach loops, while loops, switch statements, and more. The document is presented as a tutorial by Ahmed Ali on iOS development using the Swift programming language.
Fastlane - Automation and Continuous Delivery for iOS AppsSarath C
Automation and Continuous Delivery for iOS Apps using Fastlane tools. This was presented at FAYA, Technopark, Trivandrum on 01-Jun-2016.
Fastlane is a collection of utilities that work beautifully together without friction. It's now part of Fabric, Twitter's developer tools and development lead by Felix Krause (Twitter: @krausefx) and many other amazing developers.
iOS developers typically spend several times managing provision files, certificates and so many mundane and boring stuffs they've to do with Apple Developer portal and tools. Fastlane tools can help you to right from creating a project to deploy your app to AppStore.
Fastlane has an amazing ability to pass the result of data around each of the utilities in your pipeline. Also the actions helps you to customize and extend your fastlane utilities.
Fastlane often come pre-installed with popular continuous integration servers like CricleCI. Utilities like match can help you a lot to manage your certificates and provision files by securely shari across computers. This works quite handy with with CI servers as well.
This document summarizes a presentation on IOS 8 features and Swift development. It discusses new features in IOS 8 like battery usage indicator, interactive notifications, and healthkit. It then covers the basics of Swift syntax, how it differs from Objective-C, and sample code examples to illustrate arrays, dictionaries, functions and more. It concludes by noting some pros and cons of Swift and provides reference links for further reading.
As one of the early adopters of Apple TV and tvOS, Gilt Groupe was recently selected to present their “Gilt on TV” app at the Apple Keynote event in September.
This presentation covers Gilt's discoveries during the process of building a tvOS app from scratch in Swift.
It was presented at iOSoho on October 12, 2015 in New York City.
This talk was originally presented at CocoaHeadsDC meetup on July 10th, 2014. It is an introduction to Apple's new programming language - Swift.
Contact me on Twitter at @NatashaTheRobot
The document discusses Scala concepts including higher-order functions, anonymous functions, currying, tail recursion, classes and objects, properties with getters and setters, object-private fields, auxiliary constructors, primary constructors, nested classes, and singleton objects. It provides code examples to illustrate these Scala features and explains how they work and how they compare to similar concepts in other languages like Java. The document is intended as a lesson on these Scala programming concepts.
All Aboard The Scala-to-PureScript Express!John De Goes
Many Scala programmers have embraced functional programming, but the syntax and semantics of programming languages in the Haskell family remains a mystery. In this talk, Scala developers (and to some extent, Java developers) will see how the types, data structures, traits / interfaces, packages, and so forth translate into their PureScript counterparts.
This document provides information about a lecture on polymorphism for the Object Oriented Programming course at MVPS’s KBT College of Engineering. It lists the name of the faculty member, department, college, subject name, teaching scheme, examination scheme, textbooks, reference books, e-books, video lectures, and topics to be covered in the unit on polymorphism along with number of hours for each topic.
The document discusses various C# object-oriented programming concepts including classes, structs, class members, passing values by value and reference, method overloading, constructors, static constructors, read-only fields, partial classes, static classes, and the Object class. It provides examples of declaring classes and structs, defining class members like fields, properties, methods, and constructors. It also covers passing parameters, calling constructors from other constructors, readonly fields, and anonymous types.
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVMManuel Bernhardt
The document discusses the need for reactive and functional programming approaches to build scalable applications that can take advantage of many-core processors and distributed systems. It introduces key concepts like immutability, functions, and declarative programming. Specific frameworks like Scala, Play and Akka are presented as tools that support this reactive, functional style for building web applications that can horizontally scale across multiple cores and nodes. The talk promotes adopting these approaches to build systems that can better handle concurrency, distribution and failure.
The Swift Compiler and Standard LibrarySantosh Rajan
The document discusses the Swift compiler, standard library, and key language features. It provides an overview of the Swift compiler's location and how to compile and run Swift programs from the command line. It also summarizes the main types, protocols, operators and global functions that are included in Swift's standard library.
TypeScript is a superset of JavaScript that primarily adds support for static types, classes, and interfaces to the language without imposing constraints on JavaScript code. It is primarily used to enable catching errors earlier and providing better tooling support. Some key benefits of TypeScript include managing modules and namespaces, scoping variables, and adding type safety to JavaScript code. TypeScript code is compiled to plain JavaScript, so any valid JavaScript code is also valid TypeScript code.
Minimizing Decision Fatigue to Improve Team ProductivityDerek Lee Boire
The document describes a typical day at Pivotal Labs, focusing on techniques for improving team productivity such as pair programming, standup meetings, discussions, and retrospectives. It emphasizes organizing code through file structure and annotations in Swift to minimize decision fatigue. Styles are defined for UI elements through extensions to promote consistent branding.
Apple's Swift has achieved the top place in Stack Overflow's "Most Loved" list of programming languages in its 2015 Developer Survey. Based on information gleaned from GitHub and Stack Overflow, analyst firm RedMonk has seen Swift's popularity ranking soar from 68 to 22 in an unprecedented 6 months.
The "Extreme Swift" event does not require advanced, or even any, knowledge of Swift. Learn about some of the more outrageous features of the language which help explain what the fuss is all about!
Never look at programming the same way again — even if you never end up writing a single line of Swift code in your life.
This document provides an overview and introduction to building a basic fraction calculator app in Objective-C. It begins with an overview of the project architecture using the MVC pattern with a Fraction model class to represent fractions, a Calculator class to perform operations, and a ViewController class to manage the user interface. It then details the implementation of each class, including the Fraction class with methods for creating, modifying, and performing operations on fractions, the Calculator class for setting operands and performing operations, and the ViewController class for handling user interface events and updating the display.
The document discusses various techniques for writing efficient JavaScript code, including:
1. Avoid premature optimization and focus on clean, correct code first. Optimization can then focus on specific bottlenecks.
2. Use language shortcuts like object and array literals instead of constructors to improve performance.
3. Cache frequently accessed values like DOM elements, styles, and function pointers to avoid repeated lookups.
4. Minimize DOM access and manipulation by batching changes and reducing the number of elements.
5. Use event delegation with event bubbling instead of attaching the same handler to many elements.
Classes and objects are key concepts in C++. A class defines the data and functions that can act on that data, while an object is an instance of a class. Classes contain public and private members to control access and promote reusability. Common tasks like initializing data, cleaning up memory, and accessing members are handled through constructors, destructors, and methods. Well-designed classes encapsulate data and behavior to be reused across programs while hiding implementation details. Examples demonstrate defining classes for counters, checkbooks, cans, and using built-in classes like string and file streams.
Scala is a programming language created in 2001 that runs on the Java Virtual Machine. It aims to be scalable by combining object-oriented and functional programming features. Some key characteristics include its Java-like syntax that makes Java libraries and frameworks accessible, static typing for performance and documentation, and use of traits to decompose large classes and avoid fat objects. Functional programming is also supported through treating functions as first-class objects and avoiding side effects.
Infinum iOS Talks #1 - Swift done right by Ivan DikicInfinum
The document discusses four main pillars of Swift programming: value types, higher-order functions, protocols, and generics. For value types, it explains that structs and enums keep unique copies of data unlike classes which share data. It provides examples of higher-order functions like map, filter and reduce. Protocols are described as a way to achieve composition over inheritance in Swift. Generics allow writing type-agnostic code through placeholders like <T>. Optionals represent the concept of nothingness in Swift by allowing a type to hold either a value or nothing.
This document introduces TypeScript for Java developers. It provides an overview of TypeScript, why to use it, how to get started, and examples of key TypeScript features like classes, interfaces, generics, decorators, and async/await. The author is an Angular practice lead and Java Champion who has authored books on Angular development with TypeScript. The document demonstrates how to set up a TypeScript environment and compile code, and provides code samples for many TypeScript language features and patterns.
Functions And Header Files In C++ | Bjarne stroustrupSyedHaroonShah4
This document discusses functions and header/source files in C++. It covers declarations, definitions, and the differences between them. Declarations introduce names and specify types, while definitions also fully specify the entity. Declarations allow interfaces to be specified. Headers contain declarations to share interfaces between parts of a program. Functions are described as units of operation that can take parameters and return values. The document also discusses scopes, namespaces, and storage classes like static.
This document provides an overview of Scala fundamentals including:
- Scala is a programming language for the JVM that supports both object-oriented and functional paradigms.
- It defines variables, values, lazy values, functions, types, classes, objects, traits, and higher-order functions.
- Classes can extend other classes and traits, allowing for multiple inheritance. Objects are used as singletons.
- Functional concepts like immutability, anonymous functions, and higher-order functions are supported.
Peter Lawrey is the CEO of Chronicle Software. He has 7 years experience working as a Java developer for investment banks and trading firms. Chronicle Software helps companies migrate to high performance Java code and was involved in one of the first large Java 8 projects in production in December 2014. The company offers workshops, training, consulting and custom development services. The talk will cover reading and writing lambdas, capturing vs non-capturing lambdas, transforming imperative code to streams, mixing imperative and functional code, and taking Q&A.
Come to this talk prepared to learn about the Doctrine PHP open source project. The Doctrine project has been around for over a decade and has evolved from database abstraction software that dates back to the PEAR days. The packages provided by the Doctrine project have been downloaded almost 500 million times from packagist. In this talk we will take you through how to get started with Doctrine and how to take advantage of some of the more advanced features.
INTRODUCTION TO OBJECT ORIENTED PROGRAMMING.pptxDeepasCSE
Object-Oriented Programming (OOP) is a programming paradigm that focuses on organizing and modeling software as a collection of objects. In OOP, objects are instances of classes, which serve as blueprints or templates for defining the structure and behavior of those objects. OOP is built on several key principles and concepts, which include:
Objects: Objects are the basic building blocks of an OOP system. They represent real-world entities, and they encapsulate both data (attributes or properties) and behavior (methods or functions) that operate on that data.
Classes: Classes are the templates or blueprints from which objects are created. They define the attributes and methods that objects of the class will possess. Classes enable the concept of abstraction, allowing you to create objects with common characteristics and behaviors.
Encapsulation: Encapsulation is the concept of bundling data (attributes) and methods (functions) that operate on that data into a single unit, i.e., a class. This unit is called an object. Encapsulation restricts access to the internal state of an object, providing data hiding and promoting information hiding, which helps manage complexity and reduces potential issues.
Inheritance: Inheritance is a mechanism that allows a class (a child or derived class) to inherit the attributes and methods of another class (a parent or base class). This promotes code reusability and the creation of specialized classes.
Polymorphism: Polymorphism allows objects of different classes to be treated as objects of a common base class. It enables the use of a single interface to represent a general class of actions. Polymorphism can take the form of method overriding (a subclass provides a specific implementation of a method defined in its superclass) or method overloading (multiple methods with the same name but different parameters).
Abstraction: Abstraction is the process of simplifying complex reality by modeling classes based on the essential properties and behaviors. It hides the unnecessary details while providing a clear and well-defined interface for interacting with objects.
Object-Oriented Programming is widely used in various programming languages like C++, Java, C#, Python, and more. It promotes code organization, modularity, and the modeling of real-world entities in a way that makes it easier to design, develop, and maintain software systems. OOP is particularly suited for large and complex projects where code readability, reusability, and maintainability are critical.
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
4. Chris Lattner
• Author of the original
LLVM tool chain project
• Started working on Swift
in 2010
• A research intern at
Microsoft Research
• Leads Development Tool
Effort at Apple
16. – The RedMonk Programming Language Rankings: January 2015
“Swift has gone from our 68th ranked
language during Q3 to number 22 this
quarter, a jump of 46 spots.”
26. enum CompassPoint {
case North
case South
case East
case West
}
var directionToHead = CompassPoint.East;
directionToHead = .East;
27. enum CompassPoint {
case North
case South
case East
case West
}
var directionToHead = CompassPoint.East;
directionToHead = .East;
switch(directionToHead) {
case .East:
println( "Heading east")
case .West:
println( "Heading West")
case .North:
println( "Heading North")
case .South:
println( "Heading South")
default:
println("Nowhere to go")
}
38. Lazy Stored Properties
• Initializes on first time access
• Declared with lazy keyword
• Lazy Stored properties can’t be a constant;
for obvious reasons
• Useful when the initial values are depends
on outside factors
39. // Lazy initialization
class DataImporter {
}
class DataManager {
lazy var importer = DataImporter()
var data = [String]()
}
let m = DataManager()
// importer has not yet been created
m.data.append("Element 1");
m.data.append("Element 2");
m.data.append("Element 3");
// Initialize on first access
m.importer.import();
43. // Property Observers
class Temperature {
var current : Int = 26 {
willSet {
println("(newValue)");
// Prints 32
}
didSet {
println("(oldValue)");
// Prints 26
}
}
}
var obj = Temperature()
obj.current = 32;
48. Closures
// Closures
var cities = ["New Delhi", "Trivandrum", "Kochi", "Bangalore"]
// Sort with delegates
cities.sort({ (a, b) -> Bool in
a < b
})
49. Closures - Trailing spaces
// Closures
var cities = ["New Delhi", "Trivandrum", "Kochi", "Bangalore"]
// Sort with delegates
cities.sort({ (a, b) -> Bool in
a < b
})
50. Closures - Parentheses
// Closures
var cities = ["New Delhi", "Trivandrum", "Kochi", "Bangalore"]
// Sort with delegates
cities.sort { (a, b) -> Bool in
a < b
}
51. Closures - Type inference
// Closures
var cities = ["New Delhi", "Trivandrum", "Kochi", "Bangalore"]
// Sort with delegates
cities.sort { (a, b) -> Bool in
a < b
}
52. Closures - Type inference
// Closures
var cities = ["New Delhi", "Trivandrum", "Kochi", "Bangalore"]
// Sort with delegates
cities.sort { a, b -> Bool in
a < b
}
53. Closures - Implicit return
// Closures
var cities = ["New Delhi", "Trivandrum", "Kochi", "Bangalore"]
// Sort with delegates
cities.sort { a, b in
a < b
}
63. class Person {
var residence : Residence?
}
class Residence {
var address : Address?
}
class Address {
var buildingNumber : String?
var streetName : String?
var apartmentNumber : String?
}
64. // Optional Binding
if let home = paul.residence {
if let postalAddress = home.address {
if let building = postalAddress.buildingNumber {
// Code
}
}
}
70. designated initializers are primary
initializers of a class
a class must have at least one
designated initializer
classes tend to have few
designated initializers
102. func swapInt(inout a:Int, inout b:Int) {
let t = a; a = b; b = t
}
func swapString(inout a:String, inout b:String) {
let t = a; a = b; b = t
}
var a = 10, b = 20
swapInt(&a, &b)
var p = "iOS 7", q = "iOS 8"
swapString(&p,&q)
103. func swapInt(inout a:Int, inout b:Int) {
let t = a; a = b; b = t
}
func swapString(inout a:String, inout b:String) {
let t = a; a = b; b = t
}
var a = 10, b = 20
swapInt(&a, &b)
var p = "iOS 7", q = "iOS 8"
swapString(&p,&q)
// MARK: With Generics
func Swap <T> (inout a: T, inout b: T) {
let t = a; a = b; b = t
}
Swap(&a, &b);
Swap(&p, &q);
104. func swapInt(inout a:Int, inout b:Int) {
let t = a; a = b; b = t
}
func swapString(inout a:String, inout b:String) {
let t = a; a = b; b = t
}
var a = 10, b = 20
swapInt(&a, &b)
var p = "iOS 7", q = "iOS 8"
swapString(&p,&q)
// MARK: With Generics
func Swap <T> (inout a: T, inout b: T) {
let t = a; a = b; b = t
}
Swap(&a, &b);
Swap(&p, &q);
105. // Generic Type
struct Stack<T> {
var items = [T]()
mutating func push(item: T) {
items.append(item)
}
mutating func pop() -> T {
return items.removeLast()
}
}
109. Structures and enumerations are value
types.
By default, the properties of a value type
cannot be modified from within its
instance methods.
110. // Immutatbility and Mutating
struct Point {
var x = 0.0, y = 0.0
// No change in the actual object
func pointByScaling(factor: Double) -> Point {
return Point(x: self.x*factor, y: self.y*factor)
}
// Function modifies the object
mutating func scale(factor : Double) {
self.x *= factor
self.y *= factor
}
}
111. // Immutatbility and Mutating
struct Point {
var x = 0.0, y = 0.0
// No change in the actual object
func pointByScaling(factor: Double) -> Point {
return Point(x: self.x*factor, y: self.y*factor)
}
// Function modifies the object
mutating func scale(factor : Double) {
self.x *= factor
self.y *= factor
}
}
112. // Immutatbility and Mutating
struct Point {
var x = 0.0, y = 0.0
// No change in the actual object
func pointByScaling(factor: Double) -> Point {
return Point(x: self.x*factor, y: self.y*factor)
}
// Function modifies the object
mutating func scale(factor : Double) {
self.x *= factor
self.y *= factor
}
}
126. References
• The Swift Programming Language - iBooks
• Using Swift with Objective-C and Cocoa -
iBooks
• WWDC 2014 Sessions on Swift
• Developing iOS 8 Apps with Swift -
iTunesU - Stanford