Skip to content
This repository has been archived by the owner on Feb 15, 2021. It is now read-only.

Commit

Permalink
Fixed many bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
arguiot committed Jun 21, 2019
1 parent 12a5855 commit 71a636d
Show file tree
Hide file tree
Showing 7 changed files with 666 additions and 44 deletions.
38 changes: 24 additions & 14 deletions Chirper.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
objects = {

/* Begin PBXBuildFile section */
683CAB8020F3789B0084BC06 /* PFMoveApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 683CAB7E20F3789B0084BC06 /* PFMoveApplication.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
680921AA22BCFAF00075FBC0 /* PFMoveApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 680921A922BCFAF00075FBC0 /* PFMoveApplication.m */; };
680921AD22BCFB830075FBC0 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 680921AC22BCFB830075FBC0 /* Alamofire.framework */; };
680921AE22BCFB830075FBC0 /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 680921AC22BCFB830075FBC0 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
685861D520E2626E00BA691E /* AuthVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 685861D320E2626E00BA691E /* AuthVC.swift */; };
685861D820E262DE00BA691E /* Cred.swift in Sources */ = {isa = PBXBuildFile; fileRef = 685861D720E262DE00BA691E /* Cred.swift */; };
6877C4A120EE1A3000D6E0FD /* MediaVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6877C4A020EE1A3000D6E0FD /* MediaVC.swift */; };
68796ABA20DFE0230012642D /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68796AB920DFE0230012642D /* Alamofire.framework */; };
68796ABB20DFE0230012642D /* Alamofire.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 68796AB920DFE0230012642D /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
6892FC3620E07D6D00C8BDA7 /* access_token.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6892FC3520E07D6D00C8BDA7 /* access_token.swift */; };
68A69DA7214CB047006B0F76 /* Tweet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68A69DA6214CB047006B0F76 /* Tweet.swift */; };
68C3FF9720EC08A4002D367A /* Welcome.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68C3FF9520EC08A4002D367A /* Welcome.swift */; };
Expand All @@ -30,20 +30,20 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
68796ABB20DFE0230012642D /* Alamofire.framework in Embed Frameworks */,
680921AE22BCFB830075FBC0 /* Alamofire.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
683CAB7E20F3789B0084BC06 /* PFMoveApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PFMoveApplication.m; sourceTree = "<group>"; };
683CAB7F20F3789B0084BC06 /* PFMoveApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PFMoveApplication.h; sourceTree = "<group>"; };
680921A622BCFAA00075FBC0 /* PFMoveApplication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PFMoveApplication.h; sourceTree = "<group>"; };
680921A922BCFAF00075FBC0 /* PFMoveApplication.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PFMoveApplication.m; sourceTree = "<group>"; };
680921AC22BCFB830075FBC0 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/Mac/Alamofire.framework; sourceTree = "<group>"; };
685861D320E2626E00BA691E /* AuthVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthVC.swift; sourceTree = "<group>"; };
685861D720E262DE00BA691E /* Cred.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cred.swift; sourceTree = "<group>"; };
6877C4A020EE1A3000D6E0FD /* MediaVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaVC.swift; sourceTree = "<group>"; };
68796AB920DFE0230012642D /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Alamofire.framework; path = Carthage/Build/Mac/Alamofire.framework; sourceTree = "<group>"; };
6892FC3520E07D6D00C8BDA7 /* access_token.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = access_token.swift; sourceTree = "<group>"; };
68A69DA6214CB047006B0F76 /* Tweet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tweet.swift; sourceTree = "<group>"; };
68C3FF9520EC08A4002D367A /* Welcome.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Welcome.swift; sourceTree = "<group>"; };
Expand All @@ -62,22 +62,30 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
68796ABA20DFE0230012642D /* Alamofire.framework in Frameworks */,
680921AD22BCFB830075FBC0 /* Alamofire.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
683CAB7720F376AE0084BC06 /* LetsMove */ = {
680921A722BCFAC20075FBC0 /* LetsMove */ = {
isa = PBXGroup;
children = (
683CAB7F20F3789B0084BC06 /* PFMoveApplication.h */,
683CAB7E20F3789B0084BC06 /* PFMoveApplication.m */,
680921A622BCFAA00075FBC0 /* PFMoveApplication.h */,
680921A922BCFAF00075FBC0 /* PFMoveApplication.m */,
);
path = LetsMove;
sourceTree = "<group>";
};
680921AB22BCFB830075FBC0 /* Frameworks */ = {
isa = PBXGroup;
children = (
680921AC22BCFB830075FBC0 /* Alamofire.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
685861D220E2624300BA691E /* View Controllers */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -110,9 +118,9 @@
68C4ECDF20DF283C004B5C5B = {
isa = PBXGroup;
children = (
68796AB920DFE0230012642D /* Alamofire.framework */,
68C4ECEA20DF283C004B5C5B /* Chirper */,
68C4ECE920DF283C004B5C5B /* Products */,
680921AB22BCFB830075FBC0 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand All @@ -127,7 +135,7 @@
68C4ECEA20DF283C004B5C5B /* Chirper */ = {
isa = PBXGroup;
children = (
683CAB7720F376AE0084BC06 /* LetsMove */,
680921A722BCFAC20075FBC0 /* LetsMove */,
6892FC3320E07D3000C8BDA7 /* Buffer API */,
68C4ECEB20DF283C004B5C5B /* AppDelegate.swift */,
685861D220E2624300BA691E /* View Controllers */,
Expand Down Expand Up @@ -220,11 +228,11 @@
68C4ECEE20DF283C004B5C5B /* ViewController.swift in Sources */,
68A69DA7214CB047006B0F76 /* Tweet.swift in Sources */,
6877C4A120EE1A3000D6E0FD /* MediaVC.swift in Sources */,
683CAB8020F3789B0084BC06 /* PFMoveApplication.m in Sources */,
6892FC3620E07D6D00C8BDA7 /* access_token.swift in Sources */,
685861D520E2626E00BA691E /* AuthVC.swift in Sources */,
68C4ECEC20DF283C004B5C5B /* AppDelegate.swift in Sources */,
68C3FF9D20EC135E002D367A /* Profiles.swift in Sources */,
680921AA22BCFAF00075FBC0 /* PFMoveApplication.m in Sources */,
68C3FF9720EC08A4002D367A /* Welcome.swift in Sources */,
685861D820E262DE00BA691E /* Cred.swift in Sources */,
);
Expand Down Expand Up @@ -363,6 +371,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = NO;
CODE_SIGN_ENTITLEMENTS = Chirper/Chirper.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
Expand Down Expand Up @@ -393,6 +402,7 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = NO;
CODE_SIGN_ENTITLEMENTS = Chirper/Chirper.entitlements;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_STYLE = Automatic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>Chirper.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>
10 changes: 7 additions & 3 deletions Chirper/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14810.11" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.18"/>
<plugIn identifier="com.apple.WebKit2IBPlugin" version="14313.18"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14810.11"/>
<plugIn identifier="com.apple.WebKit2IBPlugin" version="14810.11"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -366,6 +366,10 @@ DQ
</textView>
</subviews>
</clipView>
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="uoq-eW-kgA">
<rect key="frame" x="-100" y="-100" width="100" height="0.0"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="ABs-xP-53o">
<rect key="frame" x="385" y="0.0" width="15" height="200"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down
15 changes: 11 additions & 4 deletions Chirper/Buffer API/Access/access_token.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ class AccessToken {
wkview = webview
}
func getCode() {
wkview.evaluateJavaScript("api.getCode()") { (result, error) in
self.token = result as? String
self.request(result as! String) // Doing the request
if wkview.isLoading == false {
wkview.evaluateJavaScript("api.getCode()") { (result, error) in
guard result is String else { return }
self.token = result as? String
self.request(result as! String) // Doing the request
}
} else {
DispatchQueue.main.asyncAfter(deadline: DispatchTime(uptimeNanoseconds: NSEC_PER_SEC)) {
self.getCode()
}
}
}

Expand All @@ -35,7 +42,7 @@ class AccessToken {
]
Alamofire.request("https://api.bufferapp.com/1/oauth2/token.json", method: .post, parameters: params, encoding: URLEncoding.default).responseJSON { (response) in
if let json = response.result.value {
let acToken = (json as AnyObject)["access_token"] as! String
let acToken = (json as AnyObject)["access_token"]! as! String
UserDefaults.standard.set(acToken, forKey: "token")

let prof = Profiles(acToken)
Expand Down
32 changes: 32 additions & 0 deletions Chirper/LetsMove/PFMoveApplication.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// PFMoveApplication.h, version 1.24
// LetsMove
//
// Created by Andy Kim at Potion Factory LLC on 9/17/09
//
// The contents of this file are dedicated to the public domain.

#ifdef __cplusplus
extern "C" {
#endif

#import <Foundation/Foundation.h>

/**
Moves the running application to ~/Applications or /Applications if the former does not exist.
After the move, it relaunches app from the new location.
DOES NOT work for sandboxed applications.
Call from \c NSApplication's delegate method \c -applicationWillFinishLaunching: method. */
void PFMoveToApplicationsFolderIfNecessary(void);

/**
Check whether an app move is currently in progress.
Returns YES if LetsMove is currently in-progress trying to move the app to the Applications folder, or NO otherwise.
This can be used to work around a crash with apps that terminate after last window is closed.
See https://github.com/potionfactory/LetsMove/issues/64 for details. */
BOOL PFMoveIsInProgress(void);

#ifdef __cplusplus
}
#endif
Loading

0 comments on commit 71a636d

Please sign in to comment.