SlideShare a Scribd company logo
Learn
watchOS
Programming!
Communication Channel
Google Document for live chat - http://tiny.cc/watchOSTechTalk
Github link for the project - https://github.com/patilsnehal/watchOSTableview
Create watchOS Application with tableview
Create Project
Add tableview
Change the color of the global tint
Change Identifier
Add Group and then labels to it
Change font, alignment etc
Add a watchKit class
ScheduleInterfaceController
Change the class type as ScheduleInterfaceController
Lets do some coding finally :)
Connect table
@IBOutlet var WWCMeetupTable: WKInterfaceTable!
Set up Number of rows
WWCMeetupTable.setNumberOfRows(10, withRowType: "WWCRow");
Hit Run !
MeetupRowController
Change the class type as MeetupRowController
Add meetup.json and meetup.swift (Shared folder)
[
{
"startTime": "10:00 AM",
"endTime": "12:00 PM",
"title": "Python Meetup",
},
{
"startTime": "12:00 PM",
“endTime": "2:00 PM",
"title": "iOS Meetup",
},
{
"startTime": "2:00 PM",
"endTime": "4:00 PM",
"title": "WatchOS Meetup",
},
{
"startTime": "4:00 PM",
"endTime": "6:00 PM",
"title": "Android Meetup",
},
{
"startTime": "6:00 PM",
"endTime": "8:00 PM",
"title": "Java Meetup",
}
]
class Meetup {
let title: String
let starttime: String
let endtime: String
class func allMeetups() -> [Meetup] {
var meetups = [Meetup]()
if let path = NSBundle.mainBundle().pathForResource("Meetup", ofType: "json"),
let data = NSData(contentsOfFile: path) {
do {
let json = try NSJSONSerialization.JSONObjectWithData(data, options:
NSJSONReadingOptions.AllowFragments) as! [Dictionary<String, String>]
for dict in json {
let meetup = Meetup(dictionary: dict)
meetups.append(meetup)
}
} catch {
print(error)
}
}
return meetups
}
init( title: String, starttime: String, endtime: String) {
self.title = title
self.starttime = starttime
self.endtime = endtime
}
convenience init(dictionary: [String: String]) {
let title = dictionary["title"]!
let starttime = dictionary["startTime"]!
let endtime = dictionary["endTime"]!
self.init(title: title, starttime: starttime, endtime: endtime)
Add files and add them to app and extension target
Configure the labels on MeetupRowController
class MeetupRowController: NSObject {
@IBOutlet var timeLabel: WKInterfaceLabel!
@IBOutlet var titleLabel: WKInterfaceLabel!
// 1
var meetup: Meetup? {
// 2 Add a property observer that is triggered whenever the property is set;
didSet {
// 3 Check of meetup is not nil
if let meetup = meetup {
// 4 configure the labels using the relevant properties of meetup
timeLabel.setText(meetup.starttime)
titleLabel.setText(meetup.title)
}
}
}
}
ScheduleInterfaceController
var meetups = Meetup.allMeetups()
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
// Set up a Row count
WWCMeetupTable.setNumberOfRows(meetups.count, withRowType: "WWCRow");
// Add data for each row
for index in 0..<WWCMeetupTable.numberOfRows {
if let controller = WWCMeetupTable.rowControllerAtIndex(index) as? MeetupRowController {
controller.meetup = meetups[index]
}
}
}
Hit Run!
Add new Interface controller and add design it.
● Change Identifier and name it
as “Meetup”
● Copy a image called static
maps into the project and
assign it to the image.
● Create a group and add 2
buttons to it - YES & NO
MeetupInterfaceController
class MeetupInterfaceController: WKInterfaceController {
@IBOutlet var timeLabel: WKInterfaceLabel!
@IBOutlet var titleLabel: WKInterfaceLabel!
// 1
var meetup: Meetup? {
// 2
didSet {
// 3
if let meetup = meetup {
// 4
timeLabel.setText("(meetup.starttime) to (meetup.endtime)")
titleLabel.setText(meetup.title)
}
}
}
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
if let meetup = context as? Meetup { self.meetup = meetup }
}
}
ScheduleInterfaceController
Add a method didSelectRowAtIndex to push a viewcontroller
override func table(table: WKInterfaceTable, didSelectRowAtIndex rowIndex: Int) {
let meetup = meetups[rowIndex]
presentControllerWithName("Meetup", context: meetup)
}
Hit Run!
Learn watchOS Programming!
Learn watchOS Programming!

More Related Content

What's hot

Cocoapods sane library management for xcode
Cocoapods   sane library management for xcodeCocoapods   sane library management for xcode
Cocoapods sane library management for xcode
leonardehrenfried
 
Monitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheusMonitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheus
Chandresh Pancholi
 
Lettuce example using simple scenario
Lettuce example using simple scenarioLettuce example using simple scenario
Lettuce example using simple scenario
Karen Wiznia
 
Retro vs volley (2)
Retro vs volley (2)Retro vs volley (2)
Retro vs volley (2)
Artjoker Digital
 
Websocket on Rails
Websocket on RailsWebsocket on Rails
Websocket on Rails
Jeroen Rosenberg
 
Kotlin workshop
Kotlin workshopKotlin workshop
Kotlin workshop
Jedsada Tiwongvokul
 
Evolution of asynchrony in (ASP).NET
Evolution of asynchrony in (ASP).NETEvolution of asynchrony in (ASP).NET
Evolution of asynchrony in (ASP).NET
Aliaksandr Famin
 
Asynchronous programming
Asynchronous programmingAsynchronous programming
Asynchronous programming
Chester Hartin
 
2014 Taverna Tutorial Biodiversity example
2014 Taverna Tutorial Biodiversity example2014 Taverna Tutorial Biodiversity example
2014 Taverna Tutorial Biodiversity example
myGrid team
 
Advanced guide to Quartz plugin
Advanced guide to Quartz pluginAdvanced guide to Quartz plugin
Advanced guide to Quartz plugin
TO THE NEW | Technology
 

What's hot (10)

Cocoapods sane library management for xcode
Cocoapods   sane library management for xcodeCocoapods   sane library management for xcode
Cocoapods sane library management for xcode
 
Monitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheusMonitoring on Kubernetes using prometheus
Monitoring on Kubernetes using prometheus
 
Lettuce example using simple scenario
Lettuce example using simple scenarioLettuce example using simple scenario
Lettuce example using simple scenario
 
Retro vs volley (2)
Retro vs volley (2)Retro vs volley (2)
Retro vs volley (2)
 
Websocket on Rails
Websocket on RailsWebsocket on Rails
Websocket on Rails
 
Kotlin workshop
Kotlin workshopKotlin workshop
Kotlin workshop
 
Evolution of asynchrony in (ASP).NET
Evolution of asynchrony in (ASP).NETEvolution of asynchrony in (ASP).NET
Evolution of asynchrony in (ASP).NET
 
Asynchronous programming
Asynchronous programmingAsynchronous programming
Asynchronous programming
 
2014 Taverna Tutorial Biodiversity example
2014 Taverna Tutorial Biodiversity example2014 Taverna Tutorial Biodiversity example
2014 Taverna Tutorial Biodiversity example
 
Advanced guide to Quartz plugin
Advanced guide to Quartz pluginAdvanced guide to Quartz plugin
Advanced guide to Quartz plugin
 

Viewers also liked

Apple - what's new in iOS 10, watchOS 3 & tvOS 10
Apple - what's new in iOS 10, watchOS 3 & tvOS 10Apple - what's new in iOS 10, watchOS 3 & tvOS 10
Apple - what's new in iOS 10, watchOS 3 & tvOS 10
Accedo
 
Dependent things dependency management for apple sw - slideshare
Dependent things   dependency management for apple sw - slideshareDependent things   dependency management for apple sw - slideshare
Dependent things dependency management for apple sw - slideshare
Cavelle Benjamin
 
Apple Watch Technology & WatchOS 2
Apple Watch Technology & WatchOS 2Apple Watch Technology & WatchOS 2
Apple Watch Technology & WatchOS 2
Saransh Viswari
 
[CocoaHeads Tricity] watchOS 2 - native apps are coming
[CocoaHeads Tricity] watchOS 2 - native apps are coming[CocoaHeads Tricity] watchOS 2 - native apps are coming
[CocoaHeads Tricity] watchOS 2 - native apps are coming
Mateusz Klimczak
 
watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話
Kohki Miki
 
Transfer data from iPhone to iWatch
Transfer data from iPhone to iWatchTransfer data from iPhone to iWatch
Transfer data from iPhone to iWatch
Pawan Ramteke
 
C language in our world 2016
C language in our world 2016C language in our world 2016
C language in our world 2016
Juraj Michálek
 
Apple watch course
Apple watch courseApple watch course
Apple watch course
bestonlinecoursescoupon
 
D2 OPEN SEMINAR - WWDC 핫 이슈
D2 OPEN SEMINAR - WWDC 핫 이슈D2 OPEN SEMINAR - WWDC 핫 이슈
D2 OPEN SEMINAR - WWDC 핫 이슈
NAVER D2
 
Development of Mobile Applications
Development of Mobile ApplicationsDevelopment of Mobile Applications
Development of Mobile Applications
Dávid Kaya
 

Viewers also liked (10)

Apple - what's new in iOS 10, watchOS 3 & tvOS 10
Apple - what's new in iOS 10, watchOS 3 & tvOS 10Apple - what's new in iOS 10, watchOS 3 & tvOS 10
Apple - what's new in iOS 10, watchOS 3 & tvOS 10
 
Dependent things dependency management for apple sw - slideshare
Dependent things   dependency management for apple sw - slideshareDependent things   dependency management for apple sw - slideshare
Dependent things dependency management for apple sw - slideshare
 
Apple Watch Technology & WatchOS 2
Apple Watch Technology & WatchOS 2Apple Watch Technology & WatchOS 2
Apple Watch Technology & WatchOS 2
 
[CocoaHeads Tricity] watchOS 2 - native apps are coming
[CocoaHeads Tricity] watchOS 2 - native apps are coming[CocoaHeads Tricity] watchOS 2 - native apps are coming
[CocoaHeads Tricity] watchOS 2 - native apps are coming
 
watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話watchOS 2でゲーム作ってみた話
watchOS 2でゲーム作ってみた話
 
Transfer data from iPhone to iWatch
Transfer data from iPhone to iWatchTransfer data from iPhone to iWatch
Transfer data from iPhone to iWatch
 
C language in our world 2016
C language in our world 2016C language in our world 2016
C language in our world 2016
 
Apple watch course
Apple watch courseApple watch course
Apple watch course
 
D2 OPEN SEMINAR - WWDC 핫 이슈
D2 OPEN SEMINAR - WWDC 핫 이슈D2 OPEN SEMINAR - WWDC 핫 이슈
D2 OPEN SEMINAR - WWDC 핫 이슈
 
Development of Mobile Applications
Development of Mobile ApplicationsDevelopment of Mobile Applications
Development of Mobile Applications
 

Similar to Learn watchOS Programming!

Bot builder v4 HOL
Bot builder v4 HOLBot builder v4 HOL
Bot builder v4 HOL
Cheah Eng Soon
 
To-Do App With Flutter: Step By Step Guide
To-Do App With Flutter: Step By Step GuideTo-Do App With Flutter: Step By Step Guide
To-Do App With Flutter: Step By Step Guide
Biztech Consulting & Solutions
 
WF 4.0 Overview
WF 4.0 OverviewWF 4.0 Overview
WF 4.0 Overview
dannicola
 
Extending Retrofit for fun and profit
Extending Retrofit for fun and profitExtending Retrofit for fun and profit
Extending Retrofit for fun and profit
Matthew Clarke
 
How to build to do app using vue composition api and vuex 4 with typescript
How to build to do app using vue composition api and vuex 4 with typescriptHow to build to do app using vue composition api and vuex 4 with typescript
How to build to do app using vue composition api and vuex 4 with typescript
Katy Slemon
 
Ruby on Rails vs ASP.NET MVC
Ruby on Rails vs ASP.NET MVCRuby on Rails vs ASP.NET MVC
Ruby on Rails vs ASP.NET MVC
Simone Chiaretta
 
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84
Mahmoud Samir Fayed
 
Re-architecting the designer-developer workflow
Re-architecting the designer-developer workflowRe-architecting the designer-developer workflow
Re-architecting the designer-developer workflow
Richard Lord
 
TDD by Controlling Dependencies
TDD by Controlling DependenciesTDD by Controlling Dependencies
TDD by Controlling Dependencies
Jorge Ortiz
 
Why Spring <3 Kotlin
Why Spring <3 KotlinWhy Spring <3 Kotlin
Why Spring <3 Kotlin
VMware Tanzu
 
Effective Java. By materials of Josch Bloch's book
Effective Java. By materials of Josch Bloch's bookEffective Java. By materials of Josch Bloch's book
Effective Java. By materials of Josch Bloch's book
Roman Tsypuk
 
Gwt and Xtend
Gwt and XtendGwt and Xtend
Gwt and Xtend
Sven Efftinge
 
Android architecture blueprints overview
Android architecture blueprints overviewAndroid architecture blueprints overview
Android architecture blueprints overview
Chih-Chung Lee
 
DataFX - JavaOne 2013
DataFX - JavaOne 2013DataFX - JavaOne 2013
DataFX - JavaOne 2013
Hendrik Ebbers
 
GWT MVP Case Study
GWT MVP Case StudyGWT MVP Case Study
GWT MVP Case Study
David Chandler
 
Kitura Todolist tutorial
Kitura Todolist tutorialKitura Todolist tutorial
Kitura Todolist tutorial
Robert F. Dickerson
 
Cross platform mobile development
Cross platform mobile development Cross platform mobile development
Cross platform mobile development
Alberto De Bortoli
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
Yiguang Hu
 
CP3108B (Mozilla) Sharing Session on Add-on SDK
CP3108B (Mozilla) Sharing Session on Add-on SDKCP3108B (Mozilla) Sharing Session on Add-on SDK
CP3108B (Mozilla) Sharing Session on Add-on SDK
Mifeng
 
Reactive clean architecture
Reactive clean architectureReactive clean architecture
Reactive clean architecture
Viktor Nyblom
 

Similar to Learn watchOS Programming! (20)

Bot builder v4 HOL
Bot builder v4 HOLBot builder v4 HOL
Bot builder v4 HOL
 
To-Do App With Flutter: Step By Step Guide
To-Do App With Flutter: Step By Step GuideTo-Do App With Flutter: Step By Step Guide
To-Do App With Flutter: Step By Step Guide
 
WF 4.0 Overview
WF 4.0 OverviewWF 4.0 Overview
WF 4.0 Overview
 
Extending Retrofit for fun and profit
Extending Retrofit for fun and profitExtending Retrofit for fun and profit
Extending Retrofit for fun and profit
 
How to build to do app using vue composition api and vuex 4 with typescript
How to build to do app using vue composition api and vuex 4 with typescriptHow to build to do app using vue composition api and vuex 4 with typescript
How to build to do app using vue composition api and vuex 4 with typescript
 
Ruby on Rails vs ASP.NET MVC
Ruby on Rails vs ASP.NET MVCRuby on Rails vs ASP.NET MVC
Ruby on Rails vs ASP.NET MVC
 
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 5 of 84
 
Re-architecting the designer-developer workflow
Re-architecting the designer-developer workflowRe-architecting the designer-developer workflow
Re-architecting the designer-developer workflow
 
TDD by Controlling Dependencies
TDD by Controlling DependenciesTDD by Controlling Dependencies
TDD by Controlling Dependencies
 
Why Spring <3 Kotlin
Why Spring <3 KotlinWhy Spring <3 Kotlin
Why Spring <3 Kotlin
 
Effective Java. By materials of Josch Bloch's book
Effective Java. By materials of Josch Bloch's bookEffective Java. By materials of Josch Bloch's book
Effective Java. By materials of Josch Bloch's book
 
Gwt and Xtend
Gwt and XtendGwt and Xtend
Gwt and Xtend
 
Android architecture blueprints overview
Android architecture blueprints overviewAndroid architecture blueprints overview
Android architecture blueprints overview
 
DataFX - JavaOne 2013
DataFX - JavaOne 2013DataFX - JavaOne 2013
DataFX - JavaOne 2013
 
GWT MVP Case Study
GWT MVP Case StudyGWT MVP Case Study
GWT MVP Case Study
 
Kitura Todolist tutorial
Kitura Todolist tutorialKitura Todolist tutorial
Kitura Todolist tutorial
 
Cross platform mobile development
Cross platform mobile development Cross platform mobile development
Cross platform mobile development
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
CP3108B (Mozilla) Sharing Session on Add-on SDK
CP3108B (Mozilla) Sharing Session on Add-on SDKCP3108B (Mozilla) Sharing Session on Add-on SDK
CP3108B (Mozilla) Sharing Session on Add-on SDK
 
Reactive clean architecture
Reactive clean architectureReactive clean architecture
Reactive clean architecture
 

Recently uploaded

一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
Paris Salesforce Developer Group
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
Pallavi Sharma
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
felixwold
 
Lateral load-resisting systems in buildings.pptx
Lateral load-resisting systems in buildings.pptxLateral load-resisting systems in buildings.pptx
Lateral load-resisting systems in buildings.pptx
DebendraDevKhanal1
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
EMERSON EDUARDO RODRIGUES
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
openshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoinopenshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoin
snaprevwdev
 
Flow Through Pipe: the analysis of fluid flow within pipes
Flow Through Pipe:  the analysis of fluid flow within pipesFlow Through Pipe:  the analysis of fluid flow within pipes
Flow Through Pipe: the analysis of fluid flow within pipes
Indrajeet sahu
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
Butterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdfButterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdf
Lubi Valves
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
pvpriya2
 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Balvir Singh
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
Dwarkadas J Sanghvi College of Engineering
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
MuhammadJazib15
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
paraasingh12 #V08
 

Recently uploaded (20)

一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
AI + Data Community Tour - Build the Next Generation of Apps with the Einstei...
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdfAsymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
Asymmetrical Repulsion Magnet Motor Ratio 6-7.pdf
 
Lateral load-resisting systems in buildings.pptx
Lateral load-resisting systems in buildings.pptxLateral load-resisting systems in buildings.pptx
Lateral load-resisting systems in buildings.pptx
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
openshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoinopenshift technical overview - Flow of openshift containerisatoin
openshift technical overview - Flow of openshift containerisatoin
 
Flow Through Pipe: the analysis of fluid flow within pipes
Flow Through Pipe:  the analysis of fluid flow within pipesFlow Through Pipe:  the analysis of fluid flow within pipes
Flow Through Pipe: the analysis of fluid flow within pipes
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
Butterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdfButterfly Valves Manufacturer (LBF Series).pdf
Butterfly Valves Manufacturer (LBF Series).pdf
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
Impartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 StandardImpartiality as per ISO /IEC 17025:2017 Standard
Impartiality as per ISO /IEC 17025:2017 Standard
 
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls ChennaiCall Girls Chennai +91-8824825030 Vip Call Girls Chennai
Call Girls Chennai +91-8824825030 Vip Call Girls Chennai
 

Learn watchOS Programming!

  • 2. Communication Channel Google Document for live chat - http://tiny.cc/watchOSTechTalk Github link for the project - https://github.com/patilsnehal/watchOSTableview
  • 3. Create watchOS Application with tableview
  • 6. Change the color of the global tint
  • 8. Add Group and then labels to it
  • 10. Add a watchKit class
  • 12. Change the class type as ScheduleInterfaceController
  • 13. Lets do some coding finally :) Connect table @IBOutlet var WWCMeetupTable: WKInterfaceTable! Set up Number of rows WWCMeetupTable.setNumberOfRows(10, withRowType: "WWCRow");
  • 16. Change the class type as MeetupRowController
  • 17. Add meetup.json and meetup.swift (Shared folder) [ { "startTime": "10:00 AM", "endTime": "12:00 PM", "title": "Python Meetup", }, { "startTime": "12:00 PM", “endTime": "2:00 PM", "title": "iOS Meetup", }, { "startTime": "2:00 PM", "endTime": "4:00 PM", "title": "WatchOS Meetup", }, { "startTime": "4:00 PM", "endTime": "6:00 PM", "title": "Android Meetup", }, { "startTime": "6:00 PM", "endTime": "8:00 PM", "title": "Java Meetup", } ] class Meetup { let title: String let starttime: String let endtime: String class func allMeetups() -> [Meetup] { var meetups = [Meetup]() if let path = NSBundle.mainBundle().pathForResource("Meetup", ofType: "json"), let data = NSData(contentsOfFile: path) { do { let json = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.AllowFragments) as! [Dictionary<String, String>] for dict in json { let meetup = Meetup(dictionary: dict) meetups.append(meetup) } } catch { print(error) } } return meetups } init( title: String, starttime: String, endtime: String) { self.title = title self.starttime = starttime self.endtime = endtime } convenience init(dictionary: [String: String]) { let title = dictionary["title"]! let starttime = dictionary["startTime"]! let endtime = dictionary["endTime"]! self.init(title: title, starttime: starttime, endtime: endtime)
  • 18. Add files and add them to app and extension target
  • 19. Configure the labels on MeetupRowController class MeetupRowController: NSObject { @IBOutlet var timeLabel: WKInterfaceLabel! @IBOutlet var titleLabel: WKInterfaceLabel! // 1 var meetup: Meetup? { // 2 Add a property observer that is triggered whenever the property is set; didSet { // 3 Check of meetup is not nil if let meetup = meetup { // 4 configure the labels using the relevant properties of meetup timeLabel.setText(meetup.starttime) titleLabel.setText(meetup.title) } } } }
  • 20. ScheduleInterfaceController var meetups = Meetup.allMeetups() override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context) // Set up a Row count WWCMeetupTable.setNumberOfRows(meetups.count, withRowType: "WWCRow"); // Add data for each row for index in 0..<WWCMeetupTable.numberOfRows { if let controller = WWCMeetupTable.rowControllerAtIndex(index) as? MeetupRowController { controller.meetup = meetups[index] } } }
  • 22. Add new Interface controller and add design it. ● Change Identifier and name it as “Meetup” ● Copy a image called static maps into the project and assign it to the image. ● Create a group and add 2 buttons to it - YES & NO
  • 23. MeetupInterfaceController class MeetupInterfaceController: WKInterfaceController { @IBOutlet var timeLabel: WKInterfaceLabel! @IBOutlet var titleLabel: WKInterfaceLabel! // 1 var meetup: Meetup? { // 2 didSet { // 3 if let meetup = meetup { // 4 timeLabel.setText("(meetup.starttime) to (meetup.endtime)") titleLabel.setText(meetup.title) } } } override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context) if let meetup = context as? Meetup { self.meetup = meetup } } }
  • 24. ScheduleInterfaceController Add a method didSelectRowAtIndex to push a viewcontroller override func table(table: WKInterfaceTable, didSelectRowAtIndex rowIndex: Int) { let meetup = meetups[rowIndex] presentControllerWithName("Meetup", context: meetup) }