-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91968ad
commit fb74c00
Showing
7 changed files
with
79 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Foundation | ||
|
||
struct CreateGroupParamsWrapper { | ||
let groupName: String | ||
let groupImageUrlSquare: String | ||
let groupDescription: String | ||
let groupPinnedFrameUrl: String | ||
|
||
static func createGroupParamsFromJson(_ authParams: String) -> CreateGroupParamsWrapper { | ||
let data = authParams.data(using: .utf8) ?? Data() | ||
let jsonOptions = (try? JSONSerialization.jsonObject(with: data, options: [])) as? [String: Any] ?? [:] | ||
|
||
let groupName = jsonOptions["name"] as? String ?? "" | ||
let groupImageUrlSquare = jsonOptions["imageUrlSquare"] as? String ?? "" | ||
let groupDescription = jsonOptions["description"] as? String ?? "" | ||
let groupPinnedFrameUrl = jsonOptions["pinnedFrameUrl"] as? String ?? "" | ||
|
||
return CreateGroupParamsWrapper( | ||
groupName: groupName, | ||
groupImageUrlSquare: groupImageUrlSquare, | ||
groupDescription: groupDescription, | ||
groupPinnedFrameUrl: groupPinnedFrameUrl | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters