LuxChat  2.0
Instant messenger for iOS
Instance Methods | Properties | List of all members
JSQLocationMediaItem Class Reference

#import <JSQLocationMediaItem.h>

Inheritance diagram for JSQLocationMediaItem:
JSQMediaItem <JSQMessageMediaData> <JSQMessageMediaData>

Instance Methods

(instancetype) - initWithLocation:
 
(void) - setLocation:withCompletionHandler:
 
(void) - setLocation:region:withCompletionHandler:
 
- Instance Methods inherited from JSQMediaItem
(instancetype) - initWithMaskAsOutgoing:
 
(void) - clearCachedMediaViews
 
- Instance Methods inherited from <JSQMessageMediaData>
(UIView *) - mediaView
 
(CGSize) - mediaViewDisplaySize
 
(UIView *) - mediaPlaceholderView
 
(NSUInteger) - mediaHash
 

Properties

CLLocation * location
 
CLLocationCoordinate2D coordinate
 
- Properties inherited from JSQMediaItem
BOOL appliesMediaViewMaskAsOutgoing
 

Detailed Description

The JSQLocationMediaItem class is a concrete JSQMediaItem subclass that implements the JSQMessageMediaData protocol and represents a location media message. An initialized JSQLocationMediaItem object can be passed to a JSQMediaMessage object during its initialization to construct a valid media message object. You may wish to subclass JSQLocationMediaItem to provide additional functionality or behavior.

Method Documentation

- (instancetype) initWithLocation: (CLLocation *)  location

Initializes and returns a location media item object having the given location.

Parameters
locationThe location for the media item. This value may be nil.
Returns
An initialized JSQLocationMediaItem if successful, nil otherwise.

If the location data must be dowloaded from the network, you may initialize a JSQLocationMediaItem object with a nil location. Once the location data has been retrieved, you can then set the location property using setLocation: withCompletionHandler:

- (void) setLocation: (CLLocation *)  location
region: (MKCoordinateRegion)  region
withCompletionHandler: (JSQLocationMediaItemCompletionBlock)  completion 

Sets the specified location for the location media item and immediately begins creating a map view snapshot image on a background thread.

The specified block is executed upon completion of creating the snapshot image and is executed on the app’s main thread.

Parameters
locationThe location for the media item.
regionThe map region that you want to capture.
completionThe block to call after the map view snapshot for the given location has been created.
- (void) setLocation: (CLLocation *)  location
withCompletionHandler: (JSQLocationMediaItemCompletionBlock)  completion 

Sets the specified location for the location media item and immediately begins creating a map view snapshot image on a background thread. The map view zooms to a default region whose center point is the location coordinate and whose span is 500 meters for both the latitudinal and longitudinal meters.

The specified block is executed upon completion of creating the snapshot image and is executed on the app’s main thread.

Parameters
locationThe location for the media item.
completionThe block to call after the map view snapshot for the given location has been created.

Property Documentation

- (CLLocationCoordinate2D) coordinate
readnonatomicassign

The coordinate of the location property.

- (CLLocation*) location
readwritenonatomiccopy

The location for the media item. The default value is nil.


The documentation for this class was generated from the following files: