KTourApiSDK 1.0.1

KTourApiSDK 1.0.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Aug 2016
SPMSupports SPM

Maintained by pisces.



 
Depends on:
PSFoundation>= 0
w3action>= 0
 

  • By
  • pisces

KTourApi-iOS-SDK

KTourApiSDK는 한국관광공사 TourApi SDK 입니다.

KTourApiSDK is open source iOS SDK to use Korea Tour Api.

Example

To run the example project, clone the repo, and run pod install from the Example directory first.


Info.plist

아래 내용을 프로젝트 info.plist에 넣어 주세요. KTourApiServiceKey는 한국관광공사 TourAPI(http://api.visitkorea.or.kr)에서 발급 받은 토큰입니다.

Add or replace node below to you app info plist.

<key>KTourApiServiceKey</key>
<string>Your Service Key</string>
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
    <dict>
        <key>visitkorea.or.kr</key>
        <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
            <true/>
            <key>NSThirdPartyExceptionMinimumTLSVersion</key>
            <string>TLSv1.1</string>
            <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
            <false/>
        </dict>
    </dict>
</dict>

Example for API Call

KTourApiAppCenter.defaultCenter().call(
    path: KTourApiPath.LocationBasedList,
    params: KTourApiParameterSet.LocationBasedList(numOfRows: 10, pageNo: 1, contentTypeId: nil, mapX: 126.981611, mapY: 37.568477),
    completion: {(result: KTourApiResult<KTourApiResultItem.POI>?, error:NSError?) -> Void in
        print("result, error ->", result?.description, error?.description)
})

API Paths

public enum KTourApiPath: String {
    case
    AreaCode            = "areaCode",
    AreaBasedList       = "areaBasedList",
    CategoryCode        = "categoryCode",
    DetailCommon        = "detailCommon",
    DetailImage         = "detailImage",
    DetailInfo          = "detailInfo",
    DetailIntro         = "detailIntro",
    LocationBasedList   = "locationBasedList",
    SearchFestival      = "searchFestival",
    SearchKeyword       = "searchKeyword",
    SearchStay          = "searchStay"
}

Change Language Type

KTourApiAppCenter.defaultCenter().languageType = KTourApiLanguageType.Chs

public enum KTourApiLanguageType: String {
    case
    Chs = "ChsService",
    Cht = "ChtService",
    Eng = "EngService",
    Ger = "GerService",
    Fre = "FreService",
    Jpn = "JpnService",
    Rus = "RusService",
    Spn = "SpnService"
}

Requirements

iOS Deployment Target 8.0 higher

Installation

KTourApiSDK is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "KTourApiSDK"

Author

Steve Kim, [email protected]

License

KTourApiSDK is available under the MIT license. See the LICENSE file for more info.