OneDrive / onedrive-sdk-ios

OneDrive SDK for iOS
https://dev.onedrive.com
Other
100 stars 88 forks source link

Hot to create a new Folder in a give parent folder id ? #156

Closed spacemonkey92 closed 7 years ago

spacemonkey92 commented 7 years ago

Can someone help me on how to create a folder using this sdk ? I cannot find any docs.

kevklam commented 7 years ago

The following is copied from the iOSExplorer sample app in this repo:

    ODItem *newFolder = [[ODItem alloc] initWithDictionary:@{[ODNameConflict rename].key : [ODNameConflict rename].value}];
    newFolder.name = folderName.text;   // Or whatever name you want to choose
    newFolder.folder = [[ODFolder alloc] init];  // Create the Folder facet on the item
    [[[[[client drive] items:parentId] children] request] addItem:newFolder withCompletion:completion];