[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

mobile[iosTesting]Two tabs app for testing in ios

[ SwikiCodeRobot @> #(#U8 #mobile #iosTesting) ] valueDeferred: 500

Two tabs

| spec dates tab1 tab2 mobileApplication |
dates := (
  (#class -> #MobileEditor ),
  (#configuration -> ( 
    (#listeners -> ( (#needsTitle -> [:coordinator | #Dates] ) ) ),
    (#widgets -> ( 
      (#information -> (
        (#class -> #MobileSelector ),
        (#configuration -> (
          (#order -> 1),
          (#listeners -> (
            (#needsTitle -> [:coordinator | 'Dates for - ',coordinator model class name ]),
            (#needsItems -> [:coordinator | Array
              with: #( 'Earliest Date' #earliestDate )
              with: #( 'Latest Date' #latestDate )
              with: #( 'Planned Date' #plannedDate ) ]),
            (#configureCell:for:in:coordinator: -> [:cell :item :aList :coordinator |
              coordinator
              configure: cell title: item first
              detail: item second ] )
          ))
        ))
      )) 
    ))
  ))
).
tab1 := (
  (#tool -> #sample),
  (#coordinator -> (
    (#class -> #MobileEditor),
    (#configuration -> (
      (#title -> 'Tab 1')
    ))
  ))
).
tab2 := (
  (#tool -> #mobile),
  (#coordinator -> (
    (#class -> #MobileEditor),
    (#configuration -> (
      (#title -> 'Tab 2'),
      (#widgets -> (
        (#information -> (
          (#class -> #MobileSelector ),
          (#configuration -> (
            (#order -> 1),
            (#listeners ->(
              (#needsTitle -> [:coordinator | #Information]),
              (#needsItems -> [:coordinator | #( #( #calendar #Dates #datePlanned ) ) ] ),
              (#configureCell:for:in:coordinator: -> [:cell :item :aList :coordinator |
                coordinator configure: cell title: item second detail: item third ]),
              (#needsIconSourceFor:in:coordinator: ->  [:item :aList :coordinator |
                coordinator iconSourceFor: item object first group: (coordinator widgetAt: #information )]),
              (#selected: -> [:item :coordinator | coordinator thread next: ((coordinator newTemplateAt: #dates) model: coordinator model;yourself) ])
            ))
          ))
        ))
      ))
    ))
  ))
).
spec := (
  (#threads -> (
    (1 -> tab2),
    (2 -> tab1)
  )),
  (#templates -> ((#dates -> dates)) ),
  (#listeners -> (#needsModel -> [ #none ]))
) json.
mobileApplication := MobileApplication new.
mobileApplication fromJSon: spec.
App := mobileApplication.
mobileApplication open.