/
LearnSwift.json
13 lines (12 loc) · 20.3 KB
/
LearnSwift.json
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"articles":[
{
"text" : "Swift is much easier to follow, especially if you've never done iOS development before. This chapter is for designers and complete beginners. As mentioned in the Web VS Native article, I will focus on executing simple user interfaces and powerful animations instead of the language itself, which can be read in the Swift iBooks. You don’t need to have read the book before this chapter. I’ll include all the important information for designers.\n\nSimpler than Objective-C\nObjective-C always felt like an alien language from the perspective of someone who’s never done iOS development. It’s bulky and long, but thanks to the expressive syntax and world-class documentation, I got used to it and even liked it. Still, that doesn’t change the fact that to new developers, it’s confusing and unfamiliar. Swift solves that. It’s a lot more approachable.\n\nvar str = \"Hello, playground\" \/\/ Swift\nNSString *str = @\"Hello, playground\"; \/\/ Objective-C\nOne class file\n\nSwift removed the need for header (.h) and implementation (.m) files. That concept in Objective-C was new to people from the Web, so it’s nice to not have to think about it anymore.\n\n\nUsing dots\n\nSwift uses dot notation to access object members, redColor() is a method in our case. As someone who is used to JavaScript's syntax and who never liked Objective-C's brackets syntax, this is a welcome addition. It's more familiar and easier to read.\n\nUIColor.redColor() \/\/ Swift\n[UIColor redColor]; \/\/ Objective-C\nNo semicolon\n\nSemicolons are effectively removed at the end of each line, making the code cleaner.\n\nWe’re Building a Dribbble app\nThe best way to learn is to create something that you’d want to use. Knowledge is mostly useful when you’re directly manipulating results. So while we’re building things, I’ll explain things during the process. At the end of this chapter, you’ll be able to create a Dribbble app prototype.\n\n\nThe app can be interacted using gestures. As you swipe down, the next Dribbble shot appears. When you press the dialog, you get an elegant transition to the next screen. When you press the user icon at the top right, a custom popover appears. Finally, when you press on Share, options appear from the bottom of the screen.\n\n\n0:00\n\n\nSwift Playground\nPlayground allows you to quickly test snippets of code and see the results in real time. There are a few techniques that you need to know in order to be efficient at using Playground. While this isn’t an intro to coding, I can at least explain what’s happening.\n\n\n\nDesign the UI in Sketch\nWe’ll first learn how to design all the UI elements in Sketch from scratch and prepare\/export the assets. This is an intermediate level tutorial, the basic UI and techniques won’t be explained in-depth. Chapter 2 has a comprehensive list of all the tricks, techniques and resources for Sketch.\n\n\n\nBasic Prototype in Storyboards\nOnce the screens are prepared, we’ll learn how to quickly import those screens to our Assets Catalog in Xcode 6. Within 2 minutes, you’ll have a basic app up and running on your phone. But this time, I’m not going to rush things up, it’s going to take a lot more than 2 minutes because I’m going to explain all the little things in Xcode that matters to UI.\n\n\n\nImplementing in Storyboards\nSince we’re going to execute animations and interactions at the tap of specific buttons, we’ll need to break down all the design elements. In this section, we’ll learn how to prepare the buttons, images, texts and views to create a functional prototype that’s good enough to be launched to the App Store.\n\n\n\nBasic Implementation in Swift\nThe code finishes the job. Without code, you’re limited to the GUI, and unfortunately, Storyboards can’t take you all the way. However, it allowed us to separate and remove the styling code from the Class, making it much cleaner and focused.\n\nIn this lesson, we’ll learn how to create a Class file and connect the Storyboard’s View Controller to it. We’ll connect all the UI elements to the Class files using IBOutlet and IBAction for animations later on. Finally, we’ll learn how to create a Blurred Background using Xcode 6’s UIVisualEffectView.\n\n\n\nBasic Animations\nBefore trying to do advanced techniques, we’ll work with animateWithDuration. Learn this code by heart:\n\nUIView.animateWithDuration(0.5)\nSimple right? With this, you can move things, change colors and sizes. It’s really powerful.\n\n\n0:02\n\n\n\nTransform Animations\nTransforms are some of the most commonly used methods for creating animations. With Transforms, you can scale, rotate or move things.\n\nlet translate = CGAffineTransformMakeTranslation(100, 100)\nlet rotate = CGAffineTransformMakeRotation(360)\nlet scale = CGAffineTransformMakeScale(2, 2)\nYou can even combine 2 animations together.\n\nview.transform = CGAffineTransformConcat(translate, rotate)\n\n0:00\n\n\n\nSpring Animations\nThis is where the fun begins. For all the value changes and transforms, you can apply a Spring behavior by just adding a few properties.\n\n UIView.animateWithDuration(duration, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0.8, options: nil, animations: \n \/\/ Your changes\n}, nil)\ndelay: how long it’ll wait before the animation starts.\n\nusingSpringWithDamping: the springiness of the bouncing animation. The higher the value, the less it’ll spring back. 0 will look like a ball and 1 will be smooth and linear.\n\ninitialSpringVelocity: how strong it’ll start. The higher the value, the more push it’ll have at the beginning of the animation. 1 means Hulk and 0 means, well, sleepy Hulk.\n\noptions: you just need to put nil all the time.\n\n\n0:11\n\n\n\nGestures + UIKit Dynamics\nGestures are powerful when they’re obvious and are added on top of existing interactions. Sometimes, requiring 2 or 3 taps can be replaced by a gesture. Think the Swipe to Archive on Mailbox or the Swipe to Discard on Paper.\n\n\n0:00\n\n\n\nAdding Data\nOur animations are done. Now we need to make the app more functional by adding some dummy data so we can browse Dribbble shots. We’ll also do some final touches to our prototype so it’ll look more polished.\n\n\n0:02\n\n\n\nChapter 3 has everything else\nChapter 4 is fully focused on Swift, UI and animations. If you’d like to learn how to work with Libraries, APIs and how to submit your app, I suggest heading over to Chapter 3. It’s good to have a basic understanding of Objective-C since that knowledge is easily transferrable to Swift.\n\n\nChanging the code theme\nSomething that’s nice to know is the ability to change the code colors and font sizes. To do that, go to Preferences > Fonts & Colors. Dusk looks pretty awesome, it gives a nice contrast against our white background here.\n\n\nSwift is much easier to follow, especially if you've never done iOS development before. This chapter is for designers and complete beginners. As mentioned in the Web VS Native article, I will focus on executing simple user interfaces and powerful animations instead of the language itself, which can be read in the Swift iBooks. You don’t need to have read the book before this chapter. I’ll include all the important information for designers.\n\nSimpler than Objective-C\nObjective-C always felt like an alien language from the perspective of someone who’s never done iOS development. It’s bulky and long, but thanks to the expressive syntax and world-class documentation, I got used to it and even liked it. Still, that doesn’t change the fact that to new developers, it’s confusing and unfamiliar. Swift solves that. It’s a lot more approachable.\n\nvar str = \"Hello, playground\" \/\/ Swift\nNSString *str = @\"Hello, playground\"; \/\/ Objective-C\nOne class file\n\nSwift removed the need for header (.h) and implementation (.m) files. That concept in Objective-C was new to people from the Web, so it’s nice to not have to think about it anymore.\n\n\nUsing dots\n\nSwift uses dot notation to access object members, redColor() is a method in our case. As someone who is used to JavaScript's syntax and who never liked Objective-C's brackets syntax, this is a welcome addition. It's more familiar and easier to read.\n\nUIColor.redColor() \/\/ Swift\n[UIColor redColor]; \/\/ Objective-C\nNo semicolon\n\nSemicolons are effectively removed at the end of each line, making the code cleaner.\n\nWe’re Building a Dribbble app\nThe best way to learn is to create something that you’d want to use. Knowledge is mostly useful when you’re directly manipulating results. So while we’re building things, I’ll explain things during the process. At the end of this chapter, you’ll be able to create a Dribbble app prototype.\n\n\nThe app can be interacted using gestures. As you swipe down, the next Dribbble shot appears. When you press the dialog, you get an elegant transition to the next screen. When you press the user icon at the top right, a custom popover appears. Finally, when you press on Share, options appear from the bottom of the screen.\n\n\n0:00\n\n\nSwift Playground\nPlayground allows you to quickly test snippets of code and see the results in real time. There are a few techniques that you need to know in order to be efficient at using Playground. While this isn’t an intro to coding, I can at least explain what’s happening.\n\n\n\nDesign the UI in Sketch\nWe’ll first learn how to design all the UI elements in Sketch from scratch and prepare\/export the assets. This is an intermediate level tutorial, the basic UI and techniques won’t be explained in-depth. Chapter 2 has a comprehensive list of all the tricks, techniques and resources for Sketch.\n\n\n\nBasic Prototype in Storyboards\nOnce the screens are prepared, we’ll learn how to quickly import those screens to our Assets Catalog in Xcode 6. Within 2 minutes, you’ll have a basic app up and running on your phone. But this time, I’m not going to rush things up, it’s going to take a lot more than 2 minutes because I’m going to explain all the little things in Xcode that matters to UI.\n\n\n\nImplementing in Storyboards\nSince we’re going to execute animations and interactions at the tap of specific buttons, we’ll need to break down all the design elements. In this section, we’ll learn how to prepare the buttons, images, texts and views to create a functional prototype that’s good enough to be launched to the App Store.\n\n\n\nBasic Implementation in Swift\nThe code finishes the job. Without code, you’re limited to the GUI, and unfortunately, Storyboards can’t take you all the way. However, it allowed us to separate and remove the styling code from the Class, making it much cleaner and focused.\n\nIn this lesson, we’ll learn how to create a Class file and connect the Storyboard’s View Controller to it. We’ll connect all the UI elements to the Class files using IBOutlet and IBAction for animations later on. Finally, we’ll learn how to create a Blurred Background using Xcode 6’s UIVisualEffectView.\n\n\n\nBasic Animations\nBefore trying to do advanced techniques, we’ll work with animateWithDuration. Learn this code by heart:\n\nUIView.animateWithDuration(0.5)\nSimple right? With this, you can move things, change colors and sizes. It’s really powerful.\n\n\n0:02\n\n\n\nTransform Animations\nTransforms are some of the most commonly used methods for creating animations. With Transforms, you can scale, rotate or move things.\n\nlet translate = CGAffineTransformMakeTranslation(100, 100)\nlet rotate = CGAffineTransformMakeRotation(360)\nlet scale = CGAffineTransformMakeScale(2, 2)\nYou can even combine 2 animations together.\n\nview.transform = CGAffineTransformConcat(translate, rotate)\n\n0:00\n\n\n\nSpring Animations\nThis is where the fun begins. For all the value changes and transforms, you can apply a Spring behavior by just adding a few properties.\n\n UIView.animateWithDuration(duration, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0.8, options: nil, animations: \n \/\/ Your changes\n}, nil)\ndelay: how long it’ll wait before the animation starts.\n\nusingSpringWithDamping: the springiness of the bouncing animation. The higher the value, the less it’ll spring back. 0 will look like a ball and 1 will be smooth and linear.\n\ninitialSpringVelocity: how strong it’ll start. The higher the value, the more push it’ll have at the beginning of the animation. 1 means Hulk and 0 means, well, sleepy Hulk.\n\noptions: you just need to put nil all the time.\n\n\n0:11\n\n\n\nGestures + UIKit Dynamics\nGestures are powerful when they’re obvious and are added on top of existing interactions. Sometimes, requiring 2 or 3 taps can be replaced by a gesture. Think the Swipe to Archive on Mailbox or the Swipe to Discard on Paper.\n\n\n0:00\n\n\n\nAdding Data\nOur animations are done. Now we need to make the app more functional by adding some dummy data so we can browse Dribbble shots. We’ll also do some final touches to our prototype so it’ll look more polished.\n\n\n0:02\n\n\n\nChapter 3 has everything else\nChapter 4 is fully focused on Swift, UI and animations. If you’d like to learn how to work with Libraries, APIs and how to submit your app, I suggest heading over to Chapter 3. It’s good to have a basic understanding of Objective-C since that knowledge is easily transferrable to Swift.\n\n\nChanging the code theme\nSomething that’s nice to know is the ability to change the code colors and font sizes. To do that, go to Preferences > Fonts & Colors. Dusk looks pretty awesome, it gives a nice contrast against our white background here.\n\n\nSwift is much easier to follow, especially if you've never done iOS development before. This chapter is for designers and complete beginners. As mentioned in the Web VS Native article, I will focus on executing simple user interfaces and powerful animations instead of the language itself, which can be read in the Swift iBooks. You don’t need to have read the book before this chapter. I’ll include all the important information for designers.\n\nSimpler than Objective-C\nObjective-C always felt like an alien language from the perspective of someone who’s never done iOS development. It’s bulky and long, but thanks to the expressive syntax and world-class documentation, I got used to it and even liked it. Still, that doesn’t change the fact that to new developers, it’s confusing and unfamiliar. Swift solves that. It’s a lot more approachable.\n\nvar str = \"Hello, playground\" \/\/ Swift\nNSString *str = @\"Hello, playground\"; \/\/ Objective-C\nOne class file\n\nSwift removed the need for header (.h) and implementation (.m) files. That concept in Objective-C was new to people from the Web, so it’s nice to not have to think about it anymore.\n\n\nUsing dots\n\nSwift uses dot notation to access object members, redColor() is a method in our case. As someone who is used to JavaScript's syntax and who never liked Objective-C's brackets syntax, this is a welcome addition. It's more familiar and easier to read.\n\nUIColor.redColor() \/\/ Swift\n[UIColor redColor]; \/\/ Objective-C\nNo semicolon\n\nSemicolons are effectively removed at the end of each line, making the code cleaner.\n\nWe’re Building a Dribbble app\nThe best way to learn is to create something that you’d want to use. Knowledge is mostly useful when you’re directly manipulating results. So while we’re building things, I’ll explain things during the process. At the end of this chapter, you’ll be able to create a Dribbble app prototype.\n\n\nThe app can be interacted using gestures. As you swipe down, the next Dribbble shot appears. When you press the dialog, you get an elegant transition to the next screen. When you press the user icon at the top right, a custom popover appears. Finally, when you press on Share, options appear from the bottom of the screen.\n\n\n0:00\n\n\nSwift Playground\nPlayground allows you to quickly test snippets of code and see the results in real time. There are a few techniques that you need to know in order to be efficient at using Playground. While this isn’t an intro to coding, I can at least explain what’s happening.\n\n\n\nDesign the UI in Sketch\nWe’ll first learn how to design all the UI elements in Sketch from scratch and prepare\/export the assets. This is an intermediate level tutorial, the basic UI and techniques won’t be explained in-depth. Chapter 2 has a comprehensive list of all the tricks, techniques and resources for Sketch.\n\n\n\nBasic Prototype in Storyboards\nOnce the screens are prepared, we’ll learn how to quickly import those screens to our Assets Catalog in Xcode 6. Within 2 minutes, you’ll have a basic app up and running on your phone. But this time, I’m not going to rush things up, it’s going to take a lot more than 2 minutes because I’m going to explain all the little things in Xcode that matters to UI.\n\n\n\nImplementing in Storyboards\nSince we’re going to execute animations and interactions at the tap of specific buttons, we’ll need to break down all the design elements. In this section, we’ll learn how to prepare the buttons, images, texts and views to create a functional prototype that’s good enough to be launched to the App Store.\n\n\n\nBasic Implementation in Swift\nThe code finishes the job. Without code, you’re limited to the GUI, and unfortunately, Storyboards can’t take you all the way. However, it allowed us to separate and remove the styling code from the Class, making it much cleaner and focused.\n\nIn this lesson, we’ll learn how to create a Class file and connect the Storyboard’s View Controller to it. We’ll connect all the UI elements to the Class files using IBOutlet and IBAction for animations later on. Finally, we’ll learn how to create a Blurred Background using Xcode 6’s UIVisualEffectView.\n\n\n\nBasic Animations\nBefore trying to do advanced techniques, we’ll work with animateWithDuration. Learn this code by heart:\n\nUIView.animateWithDuration(0.5)\nSimple right? With this, you can move things, change colors and sizes. It’s really powerful.\n\n\n0:02\n\n\n\nTransform Animations\nTransforms are some of the most commonly used methods for creating animations. With Transforms, you can scale, rotate or move things.\n\nlet translate = CGAffineTransformMakeTranslation(100, 100)\nlet rotate = CGAffineTransformMakeRotation(360)\nlet scale = CGAffineTransformMakeScale(2, 2)\nYou can even combine 2 animations together.\n\nview.transform = CGAffineTransformConcat(translate, rotate)\n\n0:00\n\n\n\nSpring Animations\nThis is where the fun begins. For all the value changes and transforms, you can apply a Spring behavior by just adding a few properties.\n\n UIView.animateWithDuration(duration, delay: 0, usingSpringWithDamping: 0.7, initialSpringVelocity: 0.8, options: nil, animations: \n \/\/ Your changes\n}, nil)\ndelay: how long it’ll wait before the animation starts.\n\nusingSpringWithDamping: the springiness of the bouncing animation. The higher the value, the less it’ll spring back. 0 will look like a ball and 1 will be smooth and linear.\n\ninitialSpringVelocity: how strong it’ll start. The higher the value, the more push it’ll have at the beginning of the animation. 1 means Hulk and 0 means, well, sleepy Hulk.\n\noptions: you just need to put nil all the time.\n\n\n0:11\n\n\n\nGestures + UIKit Dynamics\nGestures are powerful when they’re obvious and are added on top of existing interactions. Sometimes, requiring 2 or 3 taps can be replaced by a gesture. Think the Swipe to Archive on Mailbox or the Swipe to Discard on Paper.\n\n\n0:00\n\n\n\nAdding Data\nOur animations are done. Now we need to make the app more functional by adding some dummy data so we can browse Dribbble shots. We’ll also do some final touches to our prototype so it’ll look more polished.\n\n\n0:02\n\n\n\nChapter 3 has everything else\nChapter 4 is fully focused on Swift, UI and animations. If you’d like to learn how to work with Libraries, APIs and how to submit your app, I suggest heading over to Chapter 3. It’s good to have a basic understanding of Objective-C since that knowledge is easily transferrable to Swift.\n\n\nChanging the code theme\nSomething that’s nice to know is the ability to change the code colors and font sizes. To do that, go to Preferences > Fonts & Colors. Dusk looks pretty awesome, it gives a nice contrast against our white background here.\n\n\n",
"id" : "9",
"title" : "Design with Swift",
"author" : "MengTo",
"image" : "image2",
"avatar" : "avatar"
}
]
}