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

test[dji8-ios] 10 Completion blocks

" Simple completion test to get a boolean (can return an error) "
DJIFlyZoneManager sharedInstance withGEOSystemEnabled: [:value :error|
	self print: (error isNil
		ifTrue:  [ 'value=',value ]
		ifFalse: [ 'error=',error description ])
]


"Get product name"
S8BlockAdaptor
	once: [:completion|
		DJISDKManager product getNameWithCompletion: completion
	] for: [:aValue :nsError |
		self print: (nsError notNil
			ifTrue: [ '// nsError=',(NSError @ nsError) description ]
			ifFalse: [ '//  value=', aValue ])
	] encoding: 'v@:@@'