GMSAutocompletePlaceSuggestion 클래스 참조

GMSAutocompletePlaceSuggestion 클래스 참조

개요

이 클래스는 부분적으로 입력된 문자열을 기반으로 전체 쿼리의 장소 추천을 나타냅니다.

속성

NSAttributedString * attributedFullText
 NSAttributedString으로서 추천에 대한 전체 설명입니다.
NSAttributedString * attributedPrimaryText
 추천의 기본 텍스트로, NSAttributedString으로, 일반적으로 장소의 이름입니다.
NSAttributedString * attributedSecondaryText
 추천의 보조 텍스트로, 일반적으로 장소의 위치입니다. NSAttributedString.
NSString * placeID
 추천의 장소 ID를 나타내는 속성으로, 장소 세부정보 요청에 사용하기에 적합합니다.
NSArray< NSString * > * 유형
 자동 완성 결과 유형
NSNumber * distanceMeters
 요청의 GMSAutocompleteFilter에 유효한 출발지가 지정된 경우 출발지와 이 추천 검색어 사이의 직선 거리(미터)입니다.

부동산 관련 문서

- (NSAttributedString*) attributedFullText [read, copy]

NSAttributedString으로서 추천에 대한 전체 설명입니다.

예: 'Sydney Opera House, Sydney, New South Wales, Australia'.

사용자 입력과 일치하는 모든 텍스트 범위에는 kGMSAutocompleteMatchAttribute가 있습니다. 예를 들어 enumerateAttribute를 사용하여 모든 일치 항목을 굵게 표시할 수 있습니다.

   UIFont *regularFont = [UIFont systemFontOfSize:[UIFont labelFontSize]];
   UIFont *boldFont = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
   NSMutableAttributedString *bolded = [suggestion.attributedFullText mutableCopy];
   [bolded enumerateAttribute:kGMSAutocompleteMatchAttribute
                      inRange:NSMakeRange(0, bolded.length)
                      options:0
                   usingBlock:^(id value, NSRange range, BOOL *stop) {
                     UIFont *font = (value == nil) ? regularFont : boldFont;
                     [bolded addAttribute:NSFontAttributeName value:font range:range];
                   }];
   label.attributedText = bolded;
 
- (NSAttributedString*) attributedPrimaryText [read, copy]

추천의 기본 텍스트로, NSAttributedString으로, 일반적으로 장소의 이름입니다.

(예: '시드니 오페라 하우스')

사용자 입력과 일치하는 텍스트 범위에는 kGMSAutocompleteMatchAttribute(예: attributedFullText)이 있습니다.

- (NSAttributedString*) attributedSecondaryText [read, copy]

추천의 보조 텍스트로, 일반적으로 장소의 위치입니다. NSAttributedString.

예: 'Sydney, New South Wales, Australia'.

사용자 입력과 일치하는 텍스트 범위에는 kGMSAutocompleteMatchAttribute(예: attributedFullText)이 있습니다.

nil일 수 있습니다.

- (NSString*) placeID [read, copy]

추천의 장소 ID를 나타내는 속성으로, 장소 세부정보 요청에 사용하기에 적합합니다.

- (NSArray<NSString *>*) 유형 [read, copy]

자동 완성 결과 유형

유형은 NSString이며 유효한 값은 <https://developers.google.com/places/ios-sdk/supported_types>에 설명된 모든 유형입니다.

- (NSNumber*) distanceMeters [read, assign]

요청의 GMSAutocompleteFilter에 유효한 출발지가 지정된 경우 출발지와 이 추천 검색어 사이의 직선 거리(미터)입니다.