Manos Chorianopoulos

finish GiftsView

Showing 23 changed files with 591 additions and 129 deletions
{
"images" : [
{
"filename" : "coupon_bg.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "coupon_bg-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "coupon_bg-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "filters_btn.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "filters_btn-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "filters_btn-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "location_icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "location_icon-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "location_icon-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "search_icon.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "search_icon-1.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "search_icon-2.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -7,7 +7,7 @@
<key>Pods-WarplySDKFrameworkIOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
<integer>1</integer>
</dict>
</dict>
</dict>
......
......@@ -7,7 +7,7 @@
<key>WarplySDKFrameworkIOS.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
......
......@@ -8,139 +8,497 @@
#if canImport(SwiftUI)
import SwiftUI
import Combine
import Foundation
import UIKit
class CouponSetItemModel {
let uuid: String?
let admin_name: String?
let name: String?
let img_preview: String?
let expiration: String?
let description: String?
let short_description: String?
let discount: String?
init(dictionary: [String: Any]) {
self.uuid = dictionary["uuid"] as? String? ?? ""
self.admin_name = dictionary["admin_name"] as? String? ?? ""
self.name = dictionary["name"] as? String? ?? ""
self.img_preview = dictionary["img_preview"] as? String? ?? ""
self.description = dictionary["description"] as? String? ?? ""
self.short_description = dictionary["short_description"] as? String? ?? ""
self.discount = dictionary["discount"] as? String? ?? ""
let expirationObject = dictionary["expiration"] as? [String: Any]? ?? ["":""]
let expirationString = expirationObject?["value"] as? String? ?? ""
// Example expirationString: Optional(2022-12-05 01:55)
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd hh:mm"
let date = dateFormatter.date(from: expirationString ?? "")
dateFormatter.dateFormat = "dd/MM/yyyy"
let resultString = dateFormatter.string(from: date!)
self.expiration = resultString
}
}
class CouponDataModel {
var data: Array<NSDictionary> = []
var data: Array<CouponSetItemModel> = []
init() { //initializer method
let instanceOfMyApi = MyApi()
let couponSets = instanceOfMyApi.getCouponSets(withActive: true, andVisible: true, andUuids: nil)
let coupons = instanceOfMyApi.getCoupons() as AnyObject?
var couponSetsArray:Array<CouponSetItemModel> = []
if let myCouponsSetsDictionary = couponSets as? [String : AnyObject] {
let couponSetsData = (myCouponsSetsDictionary["MAPP_COUPON"] as! Array<NSMutableDictionary>)
if let myCouponsDictionary = coupons as? [String : AnyObject] {
let couponsData = (myCouponsDictionary["result"] as! Array<NSMutableDictionary>)
if let sets = couponSetsData as? NSArray {
for set in sets {
let s = set as! NSDictionary
if let cpns = couponsData as? NSArray {
for coupon in cpns {
var c = coupon as! NSDictionary
// var temp = NSMutableDictionary(dictionary: s);
if c["couponset_uuid"] as! String == s["uuid"] as! String {
var temp = NSMutableDictionary(dictionary: s);
temp.addEntries(from: c as! [AnyHashable : Any])
self.data.append(temp as NSDictionary)
}
}
}
}
}
let couponSetsData = (myCouponsSetsDictionary["MAPP_COUPON"] as! NSArray)
for couponset in couponSetsData {
let tempCouponset = CouponSetItemModel(dictionary: couponset as! [String : Any])
couponSetsArray.append(tempCouponset)
}
}
self.data = couponSetsArray
}
var getData: Array<NSDictionary> {
var getData: Array<CouponSetItemModel> {
get { // getter
return data
}
}
}
class CampaignItemModel {
let index_url: String?
let logo_url: String?
let offer_category: String?
let title: String?
let subtitle: String?
let session_uuid: String?
let subcategory: String?
init(dictionary: [String: Any]) {
self.index_url = dictionary["index_url"] as? String? ?? ""
self.logo_url = dictionary["logo_url"] as? String? ?? ""
self.offer_category = dictionary["offer_category"] as? String? ?? ""
self.title = dictionary["title"] as? String? ?? ""
self.subtitle = dictionary["subtitle"] as? String? ?? ""
self.session_uuid = dictionary["session_uuid"] as? String? ?? ""
// let extra_fields = dictionary["extra_fields"] as? [String: Any]? ?? ["":""]
let extra_fields = dictionary["extra_fields"] as AnyObject
var extra_fields_parsed:[String: Any]
let json = extra_fields.data(using: String.Encoding.utf8.rawValue)
do {
if let jsonArray = try JSONSerialization.jsonObject(with: json!, options: .allowFragments) as? [String:AnyObject]
{
extra_fields_parsed = jsonArray;
self.subcategory = extra_fields_parsed["subcategory"] as? String? ?? ""
} else {
self.subcategory = ""
print("bad json")
}
} catch let error as NSError {
self.subcategory = ""
print(error)
}
}
}
class CampaignDataModel {
var data: Array<NSDictionary> = []
var data: Array<CampaignItemModel> = []
init() { //initializer method
let instanceOfMyApi = MyApi()
let products = instanceOfMyApi.getInbox()
print("======== Inbox print =========")
print(products?[0])
print("======== Inbox dump =========")
dump(products?[0])
print("======== Inbox =========")
// let couponSets = instanceOfMyApi.getCouponSets(withActive: true, andVisible: true, andUuids: nil)
// let coupons = instanceOfMyApi.getCoupons() as AnyObject?
// if let myCouponsSetsDictionary = couponSets as? [String : AnyObject] {
// let couponSetsData = (myCouponsSetsDictionary["MAPP_COUPON"] as! Array<NSMutableDictionary>)
// if let myCouponsDictionary = coupons as? [String : AnyObject] {
// let couponsData = (myCouponsDictionary["result"] as! Array<NSMutableDictionary>)
// if let sets = couponSetsData as? NSArray {
// for set in sets {
// let s = set as! NSDictionary
// if let cpns = couponsData as? NSArray {
// for coupon in cpns {
// var c = coupon as! NSDictionary
// // var temp = NSMutableDictionary(dictionary: s);
// if c["couponset_uuid"] as! String == s["uuid"] as! String {
// var temp = NSMutableDictionary(dictionary: s);
// temp.addEntries(from: c as! [AnyHashable : Any])
// self.data.append(temp as NSDictionary)
// }
// }
// }
// }
// }
// }
// }
let products = instanceOfMyApi.getInbox() as NSMutableArray?
var giftsArray:Array<CampaignItemModel> = []
for gift in products ?? [] {
let tempGift = CampaignItemModel(dictionary: gift as! [String : Any])
giftsArray.append(tempGift)
}
self.data = giftsArray;
}
var getData: Array<NSDictionary> {
var getData: Array<CampaignItemModel> {
get { // getter
return data
}
}
}
extension String {
func htmlToString() -> String {
return try! NSAttributedString(data: self.data(using: .utf8)!,
options: [.documentType: NSAttributedString.DocumentType.html],
documentAttributes: nil).string
}
}
extension View {
func cornerRadius(_ radius: CGFloat, corners: UIRectCorner) -> some View {
clipShape( RoundedCorner(radius: radius, corners: corners) )
}
}
struct RoundedCorner: Shape {
var radius: CGFloat = .infinity
var corners: UIRectCorner = .allCorners
func path(in rect: CGRect) -> Path {
let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
return Path(path.cgPath)
}
}
class ImageLoaderGifts: ObservableObject {
var didChange = PassthroughSubject<Data, Never>()
var data = Data() {
didSet {
didChange.send(data)
}
}
init(urlString:String) {
guard let url = URL(string: urlString) else { return }
let task = URLSession.shared.dataTask(with: url) { data, response, error in
guard let data = data else { return }
DispatchQueue.main.async {
self.data = data
}
}
task.resume()
}
}
extension GiftsView {
struct headerView: View {
var goBack: () -> ()
var uiscreen = UIScreen.main.bounds
var body: some View {
ZStack {
Image("ic_back", bundle: Bundle(for: MyEmptyClass.self))
.resizable()
.frame(width: self.uiscreen.height * 0.025, height: self.uiscreen.height * 0.02)
.offset(x: -self.uiscreen.width / 2 + self.uiscreen.width * 0.05, y: self.uiscreen.height * 0.07)
Text("Όλα τα κουπόνια μου")
.frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.025, alignment: .center)
.offset( y: self.uiscreen.height * 0.07)
.frame(width: self.uiscreen.width)
HStack(alignment: .center) {
Button {
// Button Action
print("Back Button tapped!")
goBack()
} label: {
Image("ic_back", bundle: Bundle(for: MyEmptyClass.self))
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: self.uiscreen.height * 0.025, height: self.uiscreen.height * 0.02)
}
Text("Gifts for You")
.fontWeight(.medium)
.font(.system(size: 16))
.foregroundColor(Color(red: 0.20784313725490197, green: 0.3176470588235294, blue: 0.40784313725490196))
.multilineTextAlignment(.center)
.frame(maxWidth: .infinity)
.padding(.horizontal)
Button {
// Button Action
print("Location tapped!")
} label: {
Image("location_icon", bundle: Bundle(for: MyEmptyClass.self))
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: self.uiscreen.height * 0.04, height: self.uiscreen.height * 0.04)
}
}
.frame(maxWidth: .infinity)
.padding(.horizontal)
.padding(.vertical, 10)
}
}
struct giftView: View {
// @Binding var result: NSDictionary
struct searchView: View {
@State var searchText: String = ""
var uiscreen = UIScreen.main.bounds
var body: some View {
ZStack {
// URLImage(url: URL(string: result["img_preview"] as! String? ?? ""))
// .resizable()
// .frame(width: self.uiscreen.height * 0.04, height: self.uiscreen.height * 0.04)
// .cornerRadius(CGFloat(self.uiscreen.height * 0.02))
// .offset(x: -self.uiscreen.width / 2 + self.uiscreen.width * 0.14, y: -self.uiscreen.height * 0.07)
HStack(alignment: .center) {
HStack(alignment: .center) {
Image("search_icon", bundle: Bundle(for: MyEmptyClass.self))
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: self.uiscreen.height * 0.025, height: self.uiscreen.height * 0.025)
.padding([.top, .leading, .bottom], 10)
TextField("Βρες το gift που σε ενδιαφέρει", text: $searchText)
.frame(maxWidth: .infinity)
.padding(.all, 10)
.foregroundColor(Color(red: 0.48627450980392156, green: 0.48627450980392156, blue: 0.48627450980392156))
.font(.system(size: 16, weight: .regular, design: .default))
}
.overlay(
RoundedRectangle(cornerRadius: 9)
.stroke(Color(red: 0.8235294117647058, green: 0.8235294117647058, blue: 0.8235294117647058), lineWidth: 1)
)
Button {
// Button Action
print("Filters tapped!")
} label: {
Image("filters_btn", bundle: Bundle(for: MyEmptyClass.self))
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: self.uiscreen.height * 0.06, height: self.uiscreen.height * 0.04)
.padding(.leading, 5)
}
}
.frame(maxWidth: .infinity)
.padding(.horizontal, 20)
.padding(.vertical, 5)
}
}
struct ImageView: View {
@ObservedObject var imageLoader:ImageLoaderGifts
@State var image:UIImage = UIImage()
@State var width:CGFloat
@State var isFill:Bool
var uiscreen = UIScreen.main.bounds
init(withURL url:String , width:CGFloat, isFill:Bool) {
imageLoader = ImageLoaderGifts(urlString:url)
self.width = width
self.isFill = isFill
}
var body: some View {
Image(uiImage: image)
.resizable()
.aspectRatio(contentMode: isFill ? .fill : .fit)
.frame(width: self.width)
.frame(maxHeight: .infinity)
.onReceive(imageLoader.didChange) { data in
self.image = UIImage(data: data) ?? UIImage()
}
}
}
struct giftItemView: View {
var item: CampaignItemModel
var isFirst: Bool
var isLast: Bool
var uiscreen = UIScreen.main.bounds
var body: some View {
Button {
// GiftItem Action
print("GiftItem tapped!")
} label: {
HStack(alignment: .center) {
ImageView(withURL: item.logo_url ?? "", width: self.uiscreen.width * 0.5, isFill: true)
Text(item.title ?? "")
.fontWeight(.regular)
.font(.system(size: 16))
.foregroundColor(Color(red: 0.22745098039215686, green: 0.3215686274509804, blue: 0.4))
.multilineTextAlignment(.center)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding(.all, 10)
.background(Color.white)
}
}
.frame(width: self.uiscreen.width * 0.9, height: self.uiscreen.height * 0.16)
.background(Color.white)
.cornerRadius(5)
.shadow(color: Color(red: 0, green: 0, blue: 0, opacity: 0.16), radius: 30, x: 0, y: 3)
.padding(.leading, isFirst ? 18 : 0)
.padding(.trailing, isLast ? 18 : 0)
}
}
struct giftsContainer: View {
@State var gifts:Array<CampaignItemModel> = []
@State var title:String = ""
var uiscreen = UIScreen.main.bounds
var body: some View {
VStack(alignment: .leading) {
Text(title)
.fontWeight(.bold)
.font(.system(size: 17))
.foregroundColor(Color.white)
.multilineTextAlignment(.leading)
.padding(.horizontal)
.padding(.top, self.uiscreen.height * 0.05)
.padding(.bottom, self.uiscreen.height * 0.015)
ScrollView(.horizontal, showsIndicators: false) {
HStack(alignment: .center) {
ForEach(Array(gifts.enumerated()), id: \.offset) { index, item in
giftItemView(item: item, isFirst: index == 0, isLast: index == (gifts.count-1))
}
}
.frame(maxWidth: .infinity)
}
.frame(maxWidth: .infinity)
}
.frame(maxWidth: .infinity)
}
}
struct couponsContainer: View {
@State var coupons:Array<CouponSetItemModel> = []
@State var title:String = ""
var uiscreen = UIScreen.main.bounds
var body: some View {
VStack(alignment: .leading) {
Text(title)
.fontWeight(.bold)
.font(.system(size: 17))
.foregroundColor(Color.white)
.multilineTextAlignment(.leading)
.padding(.horizontal)
.padding(.top, self.uiscreen.height * 0.05)
.padding(.bottom, self.uiscreen.height * 0.015)
ScrollView(.horizontal, showsIndicators: false) {
HStack(alignment: .center) {
ForEach(Array(coupons.enumerated()), id: \.offset) { index, item in
couponItemView(item: item, isFirst: index == 0, isLast: index == (coupons.count-1))
}
}
.frame(maxWidth: .infinity)
}
.frame(maxWidth: .infinity)
}
.frame(maxWidth: .infinity)
.padding(.bottom, self.uiscreen.height * 0.1)
}
}
struct couponItemView: View {
var item: CouponSetItemModel
var isFirst: Bool
var isLast: Bool
var uiscreen = UIScreen.main.bounds
var body: some View {
Button {
// GiftItem Action
print("GiftItem tapped!")
} label: {
HStack(alignment: .center) {
ImageView(withURL: item.img_preview ?? "", width: self.uiscreen.width * 0.15, isFill: false)
VLine()
.stroke(style: StrokeStyle(lineWidth: 1, dash: [5]))
.foregroundColor(Color(red: 0.4392156862745098, green: 0.4392156862745098, blue: 0.4392156862745098))
.frame(width: 1)
.padding(.leading, 10)
VStack(alignment: .leading) {
Text(item.name ?? "")
.fontWeight(.medium)
.font(.system(size: 16))
.foregroundColor(Color(red: 0.22745098039215686, green: 0.3215686274509804, blue: 0.4))
.multilineTextAlignment(.leading)
.lineLimit(1)
// .frame(maxWidth: .infinity)
HStack(alignment: .center) {
Text((item.discount ?? "")+"€")
.fontWeight(.bold)
.font(.system(size: 25))
.foregroundColor(Color(red: 0.22745098039215686, green: 0.3215686274509804, blue: 0.4))
.multilineTextAlignment(.leading)
.lineLimit(1)
// .frame(width: self.uiscreen.width * 0.3)
// .frame(maxWidth: .infinity, maxHeight: .infinity)
Text(item.short_description ?? "")
.fontWeight(.medium)
.font(.system(size: 11))
.foregroundColor(Color(red: 0.3803921568627451, green: 0.44313725490196076, blue: 0.5058823529411764))
.multilineTextAlignment(.leading)
.lineLimit(3)
// .frame(maxWidth: .infinity)
// .padding(.leading, 10)
}
// .padding(.vertical, 5)
.frame(maxHeight: .infinity)
Text("Ισχύει έως "+(item.expiration ?? ""))
.fontWeight(.medium)
.font(.system(size: 11))
.foregroundColor(Color(red: 0.3803921568627451, green: 0.44313725490196076, blue: 0.5058823529411764))
.multilineTextAlignment(.leading)
// .frame(maxWidth: .infinity)
// .frame(maxWidth: .infinity, maxHeight: .infinity)
// .padding(.all, 10)
}
.padding(.all, 10)
// .frame(maxWidth: .infinity, maxHeight: .infinity)
Spacer()
}
.padding(.leading, 28)
.padding(.trailing)
}
.frame(width: self.uiscreen.width * 0.9, height: self.uiscreen.height * 0.14)
.cornerRadius(5)
.shadow(color: Color(red: 0, green: 0, blue: 0, opacity: 0.16), radius: 30, x: 0, y: 3)
.padding(.leading, isFirst ? 18 : 0)
.padding(.trailing, isLast ? 18 : 0)
.background(
Image("coupon_bg", bundle: Bundle(for: MyEmptyClass.self))
.resizable(resizingMode: .stretch)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding(.leading, isFirst ? 18 : 0)
.padding(.trailing, isLast ? 18 : 0)
)
}
}
struct VLine: Shape {
func path(in rect: CGRect) -> Path {
Path { path in
path.move(to: CGPoint(x: rect.midX, y: rect.minY))
path.addLine(to: CGPoint(x: rect.midX, y: rect.maxY))
}
// .background(
// Image("coupons_container", bundle: Bundle(for: MyEmptyClass.self))
// .resizable()
//// .edgesIgnoringSafeArea(.all)
// .frame(width: UIScreen.main.bounds.width * 0.8, height: UIScreen.main.bounds.height * 0.17)
// )
}
}
......@@ -148,48 +506,63 @@ extension GiftsView {
@available(iOS 13.0.0, *)
struct GiftsView: View {
var parentView: UIView
var data:Array<NSDictionary> = CouponDataModel().getData
var campains:Any = CampaignDataModel()
var coupons:Array<CouponSetItemModel> = CouponDataModel().getData
var campains:Array<CampaignItemModel> = CampaignDataModel().getData.filter { $0.offer_category == "gifts_for_you" }
var uiscreen = UIScreen.main.bounds
func goBack(){
for subview in parentView.subviews {
if(subview.tag == 5) {
subview.removeFromSuperview()
}
}
}
var body: some View {
VStack {
headerView()
// ScrollView {
// VStack {
// if (data.count) > 0 {
// ForEach(data, id: \.self) { result in
// couponView(result: result)
// }
// }
// }
// .frame(width:self.uiscreen.width, height:self.uiscreen.height )
// }
headerView(goBack: goBack)
searchView()
ScrollView(showsIndicators: false) {
VStack {
if (campains.filter { $0.subcategory == "gifts" }.count) > 0 {
giftsContainer(gifts: campains.filter { $0.subcategory == "gifts" }, title: "ΔΩΡΑ")
}
if (campains.filter { $0.subcategory == "rewards" }.count) > 0 {
giftsContainer(gifts: campains.filter { $0.subcategory == "rewards"}, title: "ΕΠΙΒΡΑΒΕΥΣΕΙΣ" )
}
if (coupons.count) > 0 {
couponsContainer(coupons: coupons, title: "ΚΟΥΠΟΝΙΑ" )
}
}
.frame(width:self.uiscreen.width)
}
.background(
LinearGradient(gradient: Gradient(colors: [Color(red: 0.06, green: 0.67, blue: 0.84), Color(red: 0.47, green: 0.75, blue: 0.43)]), startPoint: .top, endPoint: .bottom)
)
.cornerRadius(30, corners: [.topLeft])
.frame(width:self.uiscreen.width)
.frame(maxHeight: .infinity)
}
.edgesIgnoringSafeArea([.bottom])
.frame(width:self.uiscreen.width)
.frame(maxHeight: .infinity)
}
}
#endif
//struct ProfileView_Previews: PreviewProvider {
//@available(iOS 13.0.0, *)
//struct GiftsView_Previews: PreviewProvider {
// static var previews: some View {
// ProfileView()
//
// GiftsView()
//
// }
//}
@available(iOS 13.0.0, *)
struct Previews_GiftsView_Previews: PreviewProvider {
static var uiscreen = UIScreen.main.bounds
static var previews: some View {
ZStack {
Image("ic_back", bundle: Bundle(for: MyEmptyClass.self))
.resizable()
.frame(width: self.uiscreen.height * 0.025, height: self.uiscreen.height * 0.02)
.offset(x: -self.uiscreen.width / 2 + self.uiscreen.width * 0.05, y: self.uiscreen.height * 0.07)
Text("Όλα τα κουπόνια μου")
.frame(width: self.uiscreen.width * 0.8, height: self.uiscreen.height * 0.025, alignment: .center)
.offset( y: self.uiscreen.height * 0.07)
}
}
}
......
......@@ -11,8 +11,8 @@ import SwiftUI
@available(iOS 13.0.0, *)
@objc public class GiftsViewInterface : NSObject {
@objc static public func giftsViewController() -> UIViewController {
return UIHostingController(rootView: GiftsView())
@objc(giftsViewController:) static public func giftsViewController(parentView: UIView?) -> UIViewController {
return UIHostingController(rootView: GiftsView(parentView: parentView!))
}
}
......
......@@ -16,7 +16,7 @@
- (void) setToStage;
- (void) setLang:(NSString*) lang;
- (UIViewController *) openCoupons:(UIView*) parentView;
- (UIViewController *) openGifts;
- (UIViewController *) openGifts:(UIView*) parentView;
- (void) applicationDidEnterBackground:(UIApplication *)application;
- (void) applicationWillEnterForeground:(UIApplication *)application;
- (void) applicationDidBecomeActive:(UIApplication *)application;
......
......@@ -52,12 +52,9 @@ NSString *LANG;
return couponsViewController;
}
- (UIViewController *) openGifts{
- (UIViewController *) openGifts:(UIView*) parentView{
UIViewController *giftsViewController = [GiftsViewInterface giftsViewController];
// controller = [[UINavigationController alloc]initWithRootViewController:profileViewController];
// [window makeKeyAndVisible];
UIViewController *giftsViewController = [GiftsViewInterface giftsViewController:parentView];
return giftsViewController;
}
......