인기 검색어
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
인기 급상승 검색어 보기
인기 급상승 검색어를 가져오려면 ContextualSearchRuntime
에서 getTrendingSearches
메서드를 호출합니다. 이 메서드는 반환되는 인기 급상승 검색어의 최대 개수를 지정할 수 있는 단일 GetTrendingSearchesOptions를 사용합니다.
반환된 SearchSuggestions
객체에는 액세스 가능한 속성이 없습니다. 여기에는 인기 급상승 검색어를 렌더링하는 데 필요한 모든 정보가 포함되어 있지만 그 외에는 불투명합니다.
Swift는 Swift 동시 실행 스타일을 사용하고 Objective-C는 콜백 함수를 사용합니다.
Objective-C
getTrendingSearchesWithOptions
[searchRuntime
getTrendingSearchesWithOptions:
[[GetTrendingSearchesOptions alloc] init]
completionHandler:^(SearchSuggestions *_Nullable suggestions,
NSError *_Nullable error) {
// error will be not null if there is an error.
// On success, suggestions will be non null.
}];
디스플레이
인기 급상승 검색어 칩을 표시하려면 추천 검색어와 동일한 방법을 사용하세요.
다음: 검색 결과 표시arrow_forward
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eUtilize the \u003ccode\u003egetTrendingSearches\u003c/code\u003e method within \u003ccode\u003eContextualSearchRuntime\u003c/code\u003e to retrieve current trending searches, specifying the desired maximum number through \u003ccode\u003eGetTrendingSearchesOptions\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe returned \u003ccode\u003eSearchSuggestions\u003c/code\u003e object, while crucial for rendering trends, doesn't expose direct properties for data access.\u003c/p\u003e\n"],["\u003cp\u003eSwift leverages Swift Concurrency with \u003ccode\u003eTask\u003c/code\u003e and \u003ccode\u003eawait\u003c/code\u003e, while Objective-C relies on a callback function for handling results and errors.\u003c/p\u003e\n"],["\u003cp\u003eTrending searches can be displayed using the same approach as standard search suggestions, ensuring visual consistency.\u003c/p\u003e\n"]]],["To retrieve trending searches, use the `getTrendingSearches` method of `ContextualSearchRuntime`, providing `GetTrendingSearchesOptions` to set the maximum results. Swift employs async/await, while Objective-C utilizes a completion handler. The `SearchSuggestions` object returned is opaque, solely intended for rendering. Display trending search chips similarly to search suggestions using the method described in another page. Both languages provide the necessary tools to retrieve and handle trending search data.\n"],null,["# Trending Searches\n\nGet Trendings\n-------------\n\nTo get trending searches, call the `getTrendingSearches` method on the\n`ContextualSearchRuntime`. This method takes a single\n[GetTrendingSearchesOptions](/search-in-apps/ios/reference/api/swift_reference/Classes/GetTrendingSearchesOptions)\nwhere you can specify the maximum number of trendings returned.\n\nThe returned `SearchSuggestions` object does not contain any accessible\nproperties. It contains all of the necessary information to render trending\nsearches, but otherwise is opaque.\n\nSwift uses the Swift Concurrency style, Objective-C uses a callback function. \n\n### Swift\n\n[getTrendingSearches(withOptions:)](/search-in-apps/ios/reference/api/swift_reference/Classes/ContextualSearchRuntime#gettrendingsearcheswithoptions:) \n\n Task {\n let suggestions = try await searchRuntime.getTrendingSearches(\n withOptions: GetTrendingSearchesOptions())\n }\n\n### Objective-C\n\n[getTrendingSearchesWithOptions](/search-in-apps/ios/reference/api/objc_reference/Classes/ContextualSearchRuntime#-gettrendingsearcheswithoptions:completionhandler:) \n\n [searchRuntime\n getTrendingSearchesWithOptions:\n [[GetTrendingSearchesOptions alloc] init]\n completionHandler:^(SearchSuggestions *_Nullable suggestions,\n NSError *_Nullable error) {\n // error will be not null if there is an error.\n // On success, suggestions will be non null.\n }];\n\nDisplay\n-------\n\nTo display trending searches chips, use the same [way](/search-in-apps/ios/search_suggestions#display)\nas the search suggestions.\n\n[Next: Display search resultsarrow_forward](/search-in-apps/ios/display_search_results)"]]