Skip to content

Commit

Permalink
可成功保存用户的7个属性(图片暂时不能保存)
Browse files Browse the repository at this point in the history
  • Loading branch information
许林 authored and CoderDream committed Dec 4, 2018
1 parent bbfebd7 commit 4e10a5e
Show file tree
Hide file tree
Showing 40 changed files with 2,664 additions and 1,794 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file modified Instagram/.DS_Store
Binary file not shown.
12 changes: 8 additions & 4 deletions Instagram/Instagram.xcodeproj/project.pbxproj
Expand Up @@ -15,7 +15,7 @@
3FDC722221B563CE00295375 /* SignInViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FDC722121B563CE00295375 /* SignInViewController.swift */; };
3FDC722421B563E300295375 /* SignUpViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FDC722321B563E300295375 /* SignUpViewController.swift */; };
3FDC722621B563F800295375 /* ResetPasswordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FDC722521B563F800295375 /* ResetPasswordViewController.swift */; };
8D6517A97C5E1484359D16EE /* Pods_Instagram.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8049E89D14BE42635CD95E41 /* Pods_Instagram.framework */; };
BD1F01F99550400672418543 /* Pods_Instagram.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D7A5D95FAE388E82BC91E0C1 /* Pods_Instagram.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -31,15 +31,15 @@
3FDC722121B563CE00295375 /* SignInViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInViewController.swift; sourceTree = "<group>"; };
3FDC722321B563E300295375 /* SignUpViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignUpViewController.swift; sourceTree = "<group>"; };
3FDC722521B563F800295375 /* ResetPasswordViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ResetPasswordViewController.swift; sourceTree = "<group>"; };
8049E89D14BE42635CD95E41 /* Pods_Instagram.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Instagram.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D7A5D95FAE388E82BC91E0C1 /* Pods_Instagram.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Instagram.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
3F70D7CF21B235A9001DD234 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8D6517A97C5E1484359D16EE /* Pods_Instagram.framework in Frameworks */,
BD1F01F99550400672418543 /* Pods_Instagram.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -100,7 +100,7 @@
F9E3B2675A9F9F0DE967A264 /* Frameworks */ = {
isa = PBXGroup;
children = (
8049E89D14BE42635CD95E41 /* Pods_Instagram.framework */,
D7A5D95FAE388E82BC91E0C1 /* Pods_Instagram.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -261,6 +261,7 @@
3F70D7E221B235AA001DD234 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -322,6 +323,7 @@
3F70D7E321B235AA001DD234 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -378,6 +380,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 2DF8E8DE34D80A582DB6AC89 /* Pods-Instagram.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
Expand All @@ -403,6 +406,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 0E8FC953043D13D4BF457717 /* Pods-Instagram.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
Expand Down
31 changes: 25 additions & 6 deletions Instagram/Instagram/SignUpViewController.swift
Expand Up @@ -87,7 +87,7 @@ class SignUpViewController: UIViewController, UIImagePickerControllerDelegate, U
// }
//                                       }



// https://www.jianshu.com/p/c6ccd9880694 关于LeanCloud SDK 使用中数据提交的问题
//提交到云平台
Expand All @@ -104,11 +104,22 @@ class SignUpViewController: UIViewController, UIImagePickerControllerDelegate, U
// Incorrect argument labels in call (have 'name:data:', expected 'className:objectId:')
// let avaFile = AVFile(name: "iPhone.jpg", data: avaData!) // LCFile(url: "") //
//user["ava"] = avaFile as? LCValue
let queue = DispatchQueue(label:"llll",qos: .background)
print("### Done ###")
queue.async {
user.signUp()
}
// let queue = DispatchQueue(label:"llll",qos: .background)
// print("### Done ###")
// queue.async {
// user.signUp()
// }

// let user = LCUser()

//let username = "user" + LeanCloud.Utility.uuid()
// let password = "qwerty"

//user.username = LCString(username)
//user.password = LCString(password)
print("result: \(user)")
let result = user.signUp()
print("result: \(result)")

}

Expand Down Expand Up @@ -151,6 +162,14 @@ class SignUpViewController: UIViewController, UIImagePickerControllerDelegate, U
// 改变avaImg的外观为圆形
avaImg.layer.cornerRadius = avaImg.frame.width / 2
avaImg.clipsToBounds = true

usernameTxt.text = "CoderDream";
passwordTxt.text = "123";
repeatPasswordTxt.text = "123";
emailTxt.text = "abc@qq.com";
fullnameTxt.text = "许林";
bioTxt.text = "iOS程序猿";
webTxt.text = "http://coderdream.github.io";
}

// 检测键盘出现或消失时调用的方法
Expand Down
64 changes: 32 additions & 32 deletions Instagram/Instagram/Supporting Files/AppDelegate.swift
Expand Up @@ -19,41 +19,41 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Override point for customization after application launch.

// version iOS 8.0
LeanCloud.initialize(applicationID: "ERva8YPYgr5sPN6UJdWq5HuH-9Nh9j0Va", applicationKey: "3wnkDhfhLxv8QQQaXT4N9lWT")
/* Create an object. */
let object = LCObject(className: "Post")
object.set("words", value: "Hello World!")
/* Save the object to LeanCloud application. */
object.save { result in
switch result {
case .success: print("Success")
case .failure: print("Failure")
}
}
// LeanCloud.initialize(applicationID: "ERva8YPYgr5sPN6UJdWq5HuH-9Nh9j0Va", applicationKey: "3wnkDhfhLxv8QQQaXT4N9lWT")
// /* Create an object. */
// let object = LCObject(className: "Post")
// object.set("words", value: "Hello World!")
// /* Save the object to LeanCloud application. */
// object.save { result in
// switch result {
// case .success: print("Success")
// case .failure: print("Failure")
// }
// }


// version iOS 12.1
// LCApplication.default.set(
// id: "ERva8YPYgr5sPN6UJdWq5HuH-9Nh9j0Va", /* Your app ID */
// key: "3wnkDhfhLxv8QQQaXT4N9lWT" /* Your app key */
// )
// let post = LCObject(className: "Post")
//
// do {
// try post.set("words", value: "Hello World!")
//
// _ = post.save { result in
// switch result {
// case .success: print("Success")
// case .failure(let error):
// print("Failure")
// print("出错了:\(error)")
// break
// }
// }
// } catch {
//
// }
LCApplication.default.set(
id: "ERva8YPYgr5sPN6UJdWq5HuH-9Nh9j0Va", /* Your app ID */
key: "3wnkDhfhLxv8QQQaXT4N9lWT" /* Your app key */
)
let post = LCObject(className: "Post")

do {
try post.set("words", value: "Hello World!")

_ = post.save { result in
switch result {
case .success: print("Success")
case .failure(let error):
print("Failure")
print("出错了:\(error)")
break
}
}
} catch {

}

// AVAnalytics.trackAppOpened(launchOptions: launchOptions)

Expand Down
2 changes: 1 addition & 1 deletion Instagram/Podfile
@@ -1,4 +1,4 @@
platform :ios, '8.0' # '12.1' # '8.0'
platform :ios, '12.1' # '12.1' # '8.0'
use_frameworks!

target 'Instagram' do
Expand Down
2 changes: 1 addition & 1 deletion Instagram/Podfile.lock
Expand Up @@ -24,6 +24,6 @@ SPEC CHECKSUMS:
Alamofire: 3ec537f71edc9804815215393ae2b1a8ea33a844
LeanCloud: 62fe4e615494425081fd719c0d56fae130f764ea

PODFILE CHECKSUM: 04032892c85ee6736a91225396055278c6f064de
PODFILE CHECKSUM: a62fbfb50b1b6e5e176a78203ad967825ffd93cb

COCOAPODS: 1.5.3
5 changes: 2 additions & 3 deletions Instagram/Pods/LeanCloud/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 25 additions & 33 deletions Instagram/Pods/LeanCloud/Sources/Storage/BatchRequest.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4e10a5e

Please sign in to comment.