Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
djinni
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
djinni
Commits
7545e30d
Commit
7545e30d
authored
Apr 04, 2017
by
Bruno Coelho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify iOS example
parent
52f4e25e
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
26 deletions
+71
-26
example/handwritten-src/objc/TXSViewController.m
example/handwritten-src/objc/TXSViewController.m
+22
-2
example/handwritten-src/swift/TXSTextboxListenerDebugableImpl.swift
...ndwritten-src/swift/TXSTextboxListenerDebugableImpl.swift
+4
-2
example/objc/TextSort.xcodeproj/project.pbxproj
example/objc/TextSort.xcodeproj/project.pbxproj
+4
-4
example/objc/TextSort/Base.lproj/Main_iPhone.storyboard
example/objc/TextSort/Base.lproj/Main_iPhone.storyboard
+41
-18
No files found.
example/handwritten-src/objc/TXSViewController.m
View file @
7545e30d
#import "TXSItemList.h"
#import "TXSSortItems.h"
#import "TextSort-Swift.h"
#import "TXSTextboxListenerImpl.h"
#import "TXSViewController.h"
#import "TXSTextboxListener.h"
...
...
@@ -12,6 +13,8 @@
@property
(
nonatomic
)
IBOutlet
UIButton
*
button
;
@property
(
nonatomic
)
IBOutlet
UISwitch
*
switchDebugMode
;
@end
@implementation
TXSViewController
{
...
...
@@ -33,11 +36,28 @@
action:
@selector
(
dismissKeyboard
)];
[
self
.
view
addGestureRecognizer
:
tap
];
[
self
createSorter
];
}
-
(
void
)
createSorter
{
if
(
_switchDebugMode
.
isOn
)
{
// Create the Swift TXSTextboxListener
_textboxListener
=
[[
TXSTextboxListenerDebugableImpl
alloc
]
initWithUITextView
:
self
.
textView
];
}
else
{
// Create the Objective-C TXSTextboxListener
_textboxListener
=
[[
TXSTextboxListenerImpl
alloc
]
initWithUITextView
:
self
.
textView
];
}
_sortItemInterface
=
[
TXSSortItems
createWithListener
:
_textboxListener
];
}
-
(
IBAction
)
toggleDebugMode
:(
id
)
sender
{
[
self
createSorter
];
}
-
(
IBAction
)
sort
:(
id
)
sender
{
[
self
sortWithOrder
:
TXSSortOrderAscending
];
...
...
example/handwritten-src/swift/TXSTextboxListenerImpl.swift
→
example/handwritten-src/swift/TXSTextboxListener
Debugable
Impl.swift
View file @
7545e30d
...
...
@@ -8,7 +8,7 @@
import
UIKit
@objc
class
TXSTextboxListenerImpl
:
NSObject
,
TXSTextboxListener
{
@objc
class
TXSTextboxListener
Debugable
Impl
:
NSObject
,
TXSTextboxListener
{
private
var
textView_
:
UITextView
@objc
(
initWithUITextView
:)
...
...
@@ -17,6 +17,8 @@ import UIKit
}
@objc
func
update
(
_
items
:
TXSItemList
)
{
textView_
.
text
=
items
.
items
.
joined
(
separator
:
"
\n
"
)
let
string
=
items
.
items
.
joined
(
separator
:
"
\n
"
)
print
(
"TXSTextboxListenerDebugableImpl -> update
\n\(
string
)
"
)
textView_
.
text
=
string
}
}
example/objc/TextSort.xcodeproj/project.pbxproj
View file @
7545e30d
...
...
@@ -17,7 +17,7 @@
65D7FDFB19AD0CDF0038F82F
/* TXSAppDelegate.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65D7FDF519AD0CDF0038F82F
/* TXSAppDelegate.m */
;
};
65D7FDFC19AD0CDF0038F82F
/* TXSTextboxListenerImpl.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65D7FDF719AD0CDF0038F82F
/* TXSTextboxListenerImpl.m */
;
};
65D7FDFD19AD0CDF0038F82F
/* TXSViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
65D7FDF919AD0CDF0038F82F
/* TXSViewController.m */
;
};
A546A26E1E72FBAF004A8BBD
/* TXSTextboxListener
Impl.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A546A26D1E72FBAF004A8BBD
/* TXSTextboxListener
Impl.swift */
;
};
A546A26E1E72FBAF004A8BBD
/* TXSTextboxListener
DebugableImpl.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
A546A26D1E72FBAF004A8BBD
/* TXSTextboxListenerDebugable
Impl.swift */
;
};
B003051919B70561008E1F67
/* libdjinni_objc.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B003051819B70561008E1F67
/* libdjinni_objc.a */
;
};
B097B6BC19B1C07E0047653A
/* libtextsort_objc.a in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B097B6BB19B1C07E0047653A
/* libtextsort_objc.a */
;
};
/* End PBXBuildFile section */
...
...
@@ -39,7 +39,7 @@
65D7FDF719AD0CDF0038F82F
/* TXSTextboxListenerImpl.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TXSTextboxListenerImpl.m
;
sourceTree
=
"<group>"
;
};
65D7FDF819AD0CDF0038F82F
/* TXSViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TXSViewController.h
;
sourceTree
=
"<group>"
;
};
65D7FDF919AD0CDF0038F82F
/* TXSViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TXSViewController.m
;
sourceTree
=
"<group>"
;
};
A546A26D1E72FBAF004A8BBD
/* TXSTextboxListener
Impl.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
name
=
TXSTextboxListenerImpl.swift
;
path
=
"../handwritten-src/swift/TXSTextboxListener
Impl.swift"
;
sourceTree
=
"<group>"
;
};
A546A26D1E72FBAF004A8BBD
/* TXSTextboxListener
DebugableImpl.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
name
=
TXSTextboxListenerDebugableImpl.swift
;
path
=
"../handwritten-src/swift/TXSTextboxListenerDebugable
Impl.swift"
;
sourceTree
=
"<group>"
;
};
B003051819B70561008E1F67
/* libdjinni_objc.a */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
archive.ar
;
name
=
libdjinni_objc.a
;
path
=
"../../support-lib/build/Debug-iphoneos/libdjinni_objc.a"
;
sourceTree
=
"<group>"
;
};
B097B6BB19B1C07E0047653A
/* libtextsort_objc.a */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
archive.ar
;
name
=
libtextsort_objc.a
;
path
=
"../../build/Debug-iphoneos/libtextsort_objc.a"
;
sourceTree
=
"<group>"
;
};
/* End PBXFileReference section */
...
...
@@ -129,7 +129,7 @@
A546A26A1E72F967004A8BBD
/* handwritten-swift */
=
{
isa
=
PBXGroup
;
children
=
(
A546A26D1E72FBAF004A8BBD
/* TXSTextboxListenerImpl.swift */
,
A546A26D1E72FBAF004A8BBD
/* TXSTextboxListener
Debugable
Impl.swift */
,
);
name
=
"handwritten-swift"
;
sourceTree
=
"<group>"
;
...
...
@@ -208,7 +208,7 @@
65D7FDFC19AD0CDF0038F82F
/* TXSTextboxListenerImpl.m in Sources */
,
65D7FDFB19AD0CDF0038F82F
/* TXSAppDelegate.m in Sources */
,
65D7FDFD19AD0CDF0038F82F
/* TXSViewController.m in Sources */
,
A546A26E1E72FBAF004A8BBD
/* TXSTextboxListenerImpl.swift in Sources */
,
A546A26E1E72FBAF004A8BBD
/* TXSTextboxListener
Debugable
Impl.swift in Sources */
,
65D7FDFA19AD0CDF0038F82F
/* main.mm in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
...
...
example/objc/TextSort/Base.lproj/Main_iPhone.storyboard
View file @
7545e30d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment