Swift#9 Diff between SVN & GIT?

SVN relies on a centralised system for version management. It’s a central repository where working copies are generated and a network connection is required for access.

GIT relies on a distributed system for version management. You will have a local repository on which you can work, with a network connection only required to synchronise.

Swift#8 SiriKit

SiriKit: Handle user requests for your app’s services that originate from Siri or Maps.

We use SiriKit to implement app extensions that integrate your services with Siri and Maps.

SiriKit supports two types of app extensions:

  • An Intents app extension receives user requests from SiriKit and turns them into app-specific actions. For example, the user might ask Siri to send a message, book a ride, or start a workout using your app.
  • An Intents UI app extension displays branding or other customized content in the Siri or Maps interface after your Intents app extension fulfills a user request. Creation of this extension is optional.

Limitations:

  • Not a substitute for a full app only an extension.
  • SiriKit cannot use all app types.
  • Siri requires a consistent Internet connection to work.
  • Siri service needs to communicate Apple Servers.

Source: Apple Documentation

Swift#7 The 3 Rules of TDD

Test Driven Development has 3 simple rules:

  1. You are not allowed to write any production code unless it is to make a failing unit test pass.
  2. You are not allowed to write any more of a unit test than is sufficient to fail and compilation failures are failures.
  3. You are not allowed to write any more production code than is sufficient to pass the one failing unit test.

Source: http://butunclebob.com/ArticleS.UncleBob.TheThreeRulesOfTdd

Swift#6 Whats new in Swift 3.0?

New in Swift 3:

• Swift-enhanced API for Grand Central Dispatch and Core Graphics
• Uniform API style across all of Swift 3, including frameworks in the platform SDKs
• Playgrounds support for open source toolchains from Swift.org
• Xcode migrators help move your existing Swift code to Swift 3
• Swift 2.3 aids the transition to Swift 3 while providing access to the latest SDKs

 

Source:

https://itunes.apple.com/us/app/xcode/id497799835

Xkcd-Comics

Description:

Xkcd: http://xkcd.com/

Access Xkcd comics using this app.
Xkcd updates every Monday, Wednesday, and Friday.

Warning: 
This comic occasionally contains strong language
 (which may be unsuitable for children), 
unusual humor (which may be unsuitable for adults), 
and 
advanced mathematics (which may be unsuitable for liberal-arts majors).










Screenshots:

 

Link:

https://itunes.apple.com/us/app/xkcd-comics/id1151911894

 

Swift#5

ButtonAndLabelActivitySpinner 0.1.1

Label and Button that can display activity spinner in place of text to indicate that request is being processed.

Animating.gif

Usage:

Add a label or button and declare its class as For Button: ButtonActivitySpinner For Label: LabelActivitySpinner and Module as ButtonAndLabelActivitySpinner

Screen Shot 2016-09-05 at 2.33.06 PM.png Screen Shot 2016-09-05 at 2.33.20 PM.png

Then in the code while request is being processed, use

Button.startAnimating()
Label.startAnimating()

to start the activity indicator in the center of button of label.

To Stop Animating, Use

Button.stopanimating()
Label.stopanimating()

to stop the activity indicator from animating.

You can also change the color of activityIndicator by

Button.activityIndicator.color = UIColor.blueColor()

Cocoa Pods:

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoa pods

To integrate ButtonAndLableActivitySpinner into your Xcode project using CocoaPods, specify this in your Podfile:

source 'https://reddymk@bitbucket.org/reddymk/buttonandlabelactivityspinner.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'ButtonAndLabelActivitySpinner', '~> 0.1.1'
end

Run the following command:

$ pod install

Link:

https://cocoapods.org/pods/ButtonAndLabelActivitySpinner

https://www.cocoacontrols.com/controls/button-label-spinner

https://github.com/reddymk/buttonandlabelactivityspinner

https://bitbucket.org/reddymk/buttonandlabelactivityspinner

 

Author

Manish Reddy

Swift#3 Enumeration

  • Enumeration(Enums) in swift are much more powerful than Objective C.
  • Unlike Obj C, Swift enums can assign strings, characters or floats as values for each member besides integers.
  • The Convenient toRaw() method returns the values assigned to each member.
  • Enums can also be parameterized (give or assign values to it.)
  • Swift structs can have method and are passed by value.