├── .gitignore ├── LICENSE ├── Podfile ├── Podfile.lock ├── README.md ├── iBBS.sketch ├── iBBS.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── Augus.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Augus.xcuserdatad │ └── xcschemes │ ├── iBBS(Chinese).xcscheme │ ├── iBBS.xcscheme │ └── xcschememanagement.plist ├── iBBS.xcworkspace ├── contents.xcworkspacedata └── xcuserdata │ └── Augus.xcuserdatad │ ├── UserInterfaceState (Augus' MBP's conflicted copy 2015-10-10).xcuserstate │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist └── iBBS ├── Additions ├── .gitignore ├── Alamofire3-SwiftyJSON.swift ├── AlertController.swift ├── CAAnimation+Additions.swift ├── CheckEmailAddress+Additions.swift ├── DEBUGLog.swift ├── DrawCornerRadiusImage.swift ├── Encrypt+Additions.swift ├── FPSLabel.swift ├── NSString+Additions.swift ├── NSUserDefaults+Extension.swift ├── PaddingLabel.swift ├── PanDirectionGestureRecognizer+Addtions.swift ├── TopMostViewController+Additions.swift ├── UIButton+Extension.swift ├── UIColor+Additions.swift ├── UIColor+Hex.swift ├── UIDevice+Extension.swift ├── UIImageView+Extension.swift ├── UILabel+Additions.swift ├── UINavigationBar+Extension.swift ├── UIScreen+Extension.swift ├── UIStoryboard+Extension.swift ├── UITextView+Additions.swift ├── UIView+Extension.swift ├── UIViewController+Extension.swift └── Utils.swift ├── AppDelegate.swift ├── Assets.xcassets ├── Administrator.imageset │ ├── Administrator.png │ └── Contents.json ├── AppIcon.appiconset │ ├── Contents.json │ ├── Icon-29.png │ ├── Icon-29@2x-1.png │ ├── Icon-29@2x.png │ ├── Icon-29@3x.png │ ├── Icon-40.png │ ├── Icon-40@2x-1.png │ ├── Icon-40@2x.png │ ├── Icon-40@3x.png │ ├── Icon-60@2x.png │ ├── Icon-60@3x.png │ ├── Icon-76.png │ ├── Icon-76@2x.png │ └── Icon-83.5@2x.png ├── Contents.json ├── avatar_placeholder.imageset │ ├── Contents.json │ └── avatar_placeholder@2x.png ├── back_button.imageset │ ├── Contents.json │ ├── back_button.png │ ├── back_button@2x.png │ └── back_button@3x.png ├── bg_image_black.imageset │ ├── Contents.json │ └── bg_image_black.jpg ├── bg_image_blue.imageset │ ├── Contents.json │ └── bg_image_blue.jpg ├── bg_image_green.imageset │ ├── Contents.json │ └── bg_image_green.jpg ├── bg_image_pink.imageset │ ├── Contents.json │ └── bg_image_pink.jpg ├── bg_image_purple.imageset │ ├── Contents.json │ └── bg_image_purple.jpg ├── bg_image_red.imageset │ ├── Contents.json │ └── bg_image_red.jpg ├── bg_image_yellow.imageset │ ├── Contents.json │ └── bg_image_yellow.jpg ├── blank_button.imageset │ ├── Contents.json │ ├── blank_button.png │ ├── blank_button@2x.png │ └── blank_button@3x.png ├── checkButton.imageset │ ├── Contents.json │ └── checkButton.png ├── clear_color_image.imageset │ ├── Contents.json │ └── clear_color_image.png ├── close.imageset │ ├── Contents.json │ ├── close@2x.png │ └── close@3x.png ├── color.imageset │ ├── Contents.json │ └── rgb_circle_2.png ├── continue.imageset │ ├── Contents.json │ ├── continue.png │ ├── continue@2x.png │ └── continue@3x.png ├── home.imageset │ ├── Contents.json │ ├── home.png │ ├── home@2x.png │ └── home@3x.png ├── message.imageset │ ├── Contents.json │ ├── message.png │ ├── message@2x.png │ └── message@3x.png ├── message_is_read_marker.imageset │ ├── Contents.json │ ├── message_read_1.png │ ├── message_read_1@2x.png │ └── message_read_1@3x.png ├── node.imageset │ ├── Contents.json │ ├── node.png │ ├── node@2x.png │ └── node@3x.png ├── plus_button.imageset │ ├── Contents.json │ ├── plus_button.png │ ├── plus_button@2x.png │ └── plus_button@3x.png ├── register_button.imageset │ ├── Contents.json │ ├── register_button.png │ ├── register_button@2x.png │ └── register_button@3x.png ├── send.imageset │ ├── Contents.json │ └── send.png ├── send_message.imageset │ ├── Contents.json │ └── send_message@2x.png ├── settings.imageset │ ├── Contents.json │ ├── settings@2x.png │ └── settings@3x.png ├── star.imageset │ ├── Contents.json │ └── filled_star.png ├── trash.imageset │ ├── Contents.json │ ├── delete.png │ └── trash@2x.png ├── unstar.imageset │ ├── Contents.json │ └── star.png └── xButton.imageset │ ├── Contents.json │ └── xButton.png ├── Base.lproj └── LaunchScreen.storyboard ├── BaseViewController.swift ├── CWStatusBarNotification ├── CWStatusBarNotification.swift ├── CWStatusBarNotificationUtils.swift └── IBBSToast.swift ├── FrostedSidebar ├── .DS_Store └── FrostedSidebar.swift ├── IBBSAPIClient.swift ├── IBBSAvatarImageView.swift ├── IBBSBaseSettingsViewController.swift ├── IBBSBaseViewController.swift ├── IBBSChatViewController.swift ├── IBBSColorPickerViewController.swift ├── IBBSCommentViewController.swift ├── IBBSConstants.swift ├── IBBSContainerViewController.swift ├── IBBSContext.swift ├── IBBSCustomSelectedBackgroundView.swift ├── IBBSDetailHeaderView.swift ├── IBBSDetailHeaderView.xib ├── IBBSDetailViewController.swift ├── IBBSEditingViewController.swift ├── IBBSEditorBaseViewController.swift ├── IBBSEffectViewController.swift ├── IBBSFavoriteContainerViewController.swift ├── IBBSFavoriteViewController.swift ├── IBBSLocalizableStrings.swift ├── IBBSLoginKey.swift ├── IBBSLoginModel.swift ├── IBBSMessageModel.swift ├── IBBSMessageTableViewCell.swift ├── IBBSMessageTableViewCell.xib ├── IBBSMessagesViewController.swift ├── IBBSModel.swift ├── IBBSNodeModel.swift ├── IBBSNodeTableViewCell.swift ├── IBBSNodeTableViewCell.xib ├── IBBSNodeTopicListModel.swift ├── IBBSNodeViewController.swift ├── IBBSNodesCell.swift ├── IBBSNodesCollectionViewCell.swift ├── IBBSNodesCollectionViewController.swift ├── IBBSPickerViewController.swift ├── IBBSPostViewController.swift ├── IBBSRegisterViewController.swift ├── IBBSReplyCell.swift ├── IBBSReplyCell.xib ├── IBBSReplyMessageModel.swift ├── IBBSRootNavigationController.swift ├── IBBSSettingContainerViewController.swift ├── IBBSSettingViewController.swift ├── IBBSSlidePanelViewController.swift ├── IBBSTabBarController.swift ├── IBBSTableViewCell.swift ├── IBBSTableViewCell.xib ├── IBBSThemes.swift ├── IBBSTopicListModel.swift ├── IBBSTopicModel.swift ├── IBBSUserTopicModel.swift ├── IBBSUserTopicTableViewCell.swift ├── IBBSUserTopicTableViewCell.xib ├── IBBSUserViewController+UploadAvatar.swift ├── IBBSUserViewController.swift ├── IBBSViewController.swift ├── Info.plist ├── KolodaView └── .DS_Store ├── MWFeedParser ├── GTMNSString+HTML.h ├── GTMNSString+HTML.m ├── NSString+HTML.h └── NSString+HTML.m ├── Main.storyboard ├── MainViewController.swift ├── PasscodeLock ├── Base.lproj │ └── PasscodeLock.strings ├── PasscodeLock │ ├── ChangePasscodeState.swift │ ├── ConfirmPasscodeState.swift │ ├── EnterPasscodeState.swift │ ├── PasscodeLock.swift │ └── SetPasscodeState.swift ├── PasscodeLockController │ ├── Functions.swift │ ├── PasscodeLockConfiguration.swift │ ├── PasscodeLockPresenter.swift │ ├── PasscodeLockViewController.swift │ └── UserDefaultsPasscodeRepository.swift ├── Protocols │ ├── PasscodeLockConfigurationType.swift │ ├── PasscodeLockStateType.swift │ ├── PasscodeLockType.swift │ └── PasscodeRepositoryType.swift ├── Views │ ├── Base.lproj │ │ └── PasscodeLockView.xib │ ├── PasscodeSignButton.swift │ ├── PasscodeSignPlaceholderView.swift │ └── TouchID.xcassets │ │ ├── Contents.json │ │ └── Passcode_Lock_Touch_ID.imageset │ │ ├── Contents.json │ │ ├── Passcode_Lock_Touch_ID@2x.png │ │ └── Passcode_Lock_Touch_ID@3x.png ├── zh-Hans.lproj │ └── PasscodeLock.strings └── zh-Hant.lproj │ └── PasscodeLock.strings ├── SlidePanel.storyboard ├── TinderSwipeCardsSwift ├── DraggableView.swift └── DraggableViewBackground.swift ├── User.storyboard ├── ZSSRichTextEditor ├── Images │ ├── ZSSbgcolor.png │ ├── ZSSbgcolor@2x.png │ ├── ZSSbold.png │ ├── ZSSbold@2x.png │ ├── ZSScenterjustify.png │ ├── ZSScenterjustify@2x.png │ ├── ZSSclearstyle.png │ ├── ZSSclearstyle@2x.png │ ├── ZSSforcejustify.png │ ├── ZSSforcejustify@2x.png │ ├── ZSSh1.png │ ├── ZSSh1@2x.png │ ├── ZSSh2.png │ ├── ZSSh2@2x.png │ ├── ZSSh3.png │ ├── ZSSh3@2x.png │ ├── ZSSh4.png │ ├── ZSSh4@2x.png │ ├── ZSSh5.png │ ├── ZSSh5@2x.png │ ├── ZSSh6.png │ ├── ZSSh6@2x.png │ ├── ZSShorizontalrule.png │ ├── ZSShorizontalrule@2x.png │ ├── ZSSimage.png │ ├── ZSSimage@2x.png │ ├── ZSSindent.png │ ├── ZSSindent@2x.png │ ├── ZSSinsertkeyword.png │ ├── ZSSinsertkeyword@2x.png │ ├── ZSSitalic.png │ ├── ZSSitalic@2x.png │ ├── ZSSkeyboard.png │ ├── ZSSkeyboard@2x.png │ ├── ZSSleftjustify.png │ ├── ZSSleftjustify@2x.png │ ├── ZSSlink.png │ ├── ZSSlink@2x.png │ ├── ZSSorderedlist.png │ ├── ZSSorderedlist@2x.png │ ├── ZSSoutdent.png │ ├── ZSSoutdent@2x.png │ ├── ZSSparagraph.png │ ├── ZSSparagraph@2x.png │ ├── ZSSpicker.png │ ├── ZSSpicker@2x.png │ ├── ZSSquicklink.png │ ├── ZSSquicklink@2x.png │ ├── ZSSredo.png │ ├── ZSSredo@2x.png │ ├── ZSSrightjustify.png │ ├── ZSSrightjustify@2x.png │ ├── ZSSstrikethrough.png │ ├── ZSSstrikethrough@2x.png │ ├── ZSSsubscript.png │ ├── ZSSsubscript@2x.png │ ├── ZSSsuperscript.png │ ├── ZSSsuperscript@2x.png │ ├── ZSStable.png │ ├── ZSStable@2x.png │ ├── ZSStextcolor.png │ ├── ZSStextcolor@2x.png │ ├── ZSSunderline.png │ ├── ZSSunderline@2x.png │ ├── ZSSundo.png │ ├── ZSSundo@2x.png │ ├── ZSSunlink.png │ ├── ZSSunlink@2x.png │ ├── ZSSunorderedlist.png │ ├── ZSSunorderedlist@2x.png │ ├── ZSSviewsource.png │ └── ZSSviewsource@2x.png ├── Third Party │ ├── CYRLayoutManager.h │ ├── CYRLayoutManager.m │ ├── CYRTextStorage.h │ ├── CYRTextStorage.m │ ├── CYRTextView.h │ ├── CYRTextView.m │ ├── CYRToken.h │ ├── CYRToken.m │ ├── HRBrightnessCursor.h │ ├── HRBrightnessCursor.m │ ├── HRCgUtil.h │ ├── HRCgUtil.m │ ├── HRColorCursor.h │ ├── HRColorCursor.m │ ├── HRColorPickerMacros.h │ ├── HRColorPickerView.h │ ├── HRColorPickerView.m │ ├── HRColorPickerViewController.h │ ├── HRColorPickerViewController.m │ ├── HRColorUtil.h │ └── HRColorUtil.m ├── ZSSBarButtonItem.h ├── ZSSBarButtonItem.m ├── ZSSRichTextEditor.h ├── ZSSRichTextEditor.js ├── ZSSRichTextEditor.m ├── ZSSTextView.h ├── ZSSTextView.m └── editor.html ├── en.lproj └── Localizable.strings ├── iBBS-Bridging-Header.h ├── loadmore ├── RefreshBaseView.swift ├── RefreshConst.swift ├── RefreshFooterView.swift ├── UIScrollView+Refresh.swift └── arrow@2x.png └── zh-Hans.lproj └── Localizable.strings /LICENSE: -------------------------------------------------------------------------------- 1 | iBBS-Swift 2 | https://github.com/iAugux/iBBS-Swift 3 | 4 | Copyright © 2016 iAugus 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | platform :ios, '8.0' 3 | use_frameworks! 4 | 5 | target 'iBBS' do 6 | 7 | pod 'SnapKit' 8 | pod 'GearRefreshControl', '~> 0.3' 9 | pod 'Alamofire', '~> 3.3' 10 | pod 'SwiftyJSON'#, :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git' 11 | pod 'Kingfisher', '~> 1.6' 12 | pod 'KYNavigationProgress' 13 | pod 'SwiftColorPicker', :git => 'https://github.com/MrMatthias/SwiftColorPicker', :commit => '47611ac2adf323a3f92c875fb2f8f7feb459f80c' 14 | 15 | # ObjC 16 | pod 'Qiniu', '~> 7.0' 17 | 18 | end -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.6.3): 3 | - AFNetworking/NSURLConnection (= 2.6.3) 4 | - AFNetworking/NSURLSession (= 2.6.3) 5 | - AFNetworking/Reachability (= 2.6.3) 6 | - AFNetworking/Security (= 2.6.3) 7 | - AFNetworking/Serialization (= 2.6.3) 8 | - AFNetworking/UIKit (= 2.6.3) 9 | - AFNetworking/NSURLConnection (2.6.3): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.6.3): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.6.3) 18 | - AFNetworking/Security (2.6.3) 19 | - AFNetworking/Serialization (2.6.3) 20 | - AFNetworking/UIKit (2.6.3): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | - Alamofire (3.3.1) 24 | - GearRefreshControl (0.3.0) 25 | - HappyDNS (0.2.3) 26 | - Kingfisher (1.9.3) 27 | - KYNavigationProgress (1.0.0) 28 | - Qiniu (7.0.17): 29 | - AFNetworking (~> 2.0) 30 | - HappyDNS (~> 0.2) 31 | - SnapKit (0.20.0) 32 | - SwiftColorPicker (0.0.5) 33 | - SwiftyJSON (2.3.2) 34 | 35 | DEPENDENCIES: 36 | - Alamofire (~> 3.3) 37 | - GearRefreshControl (~> 0.3) 38 | - Kingfisher (~> 1.6) 39 | - KYNavigationProgress 40 | - Qiniu (~> 7.0) 41 | - SnapKit 42 | - SwiftColorPicker (from `https://github.com/MrMatthias/SwiftColorPicker`, commit 43 | `47611ac2adf323a3f92c875fb2f8f7feb459f80c`) 44 | - SwiftyJSON 45 | 46 | EXTERNAL SOURCES: 47 | SwiftColorPicker: 48 | :commit: 47611ac2adf323a3f92c875fb2f8f7feb459f80c 49 | :git: https://github.com/MrMatthias/SwiftColorPicker 50 | 51 | CHECKOUT OPTIONS: 52 | SwiftColorPicker: 53 | :commit: 47611ac2adf323a3f92c875fb2f8f7feb459f80c 54 | :git: https://github.com/MrMatthias/SwiftColorPicker 55 | 56 | SPEC CHECKSUMS: 57 | AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60 58 | Alamofire: 369bc67b6f5ac33ded3648d7bd21c5bfb91c2ecc 59 | GearRefreshControl: c7b1abac8a298f180df48c1bc450469e98840c46 60 | HappyDNS: 6d85942e64c28b4fa61f8c76580398f52d6d1d11 61 | Kingfisher: 9e37d2a78a082dc123bfe8a16de65de85518daae 62 | KYNavigationProgress: 98df05cf12545f7c2a74570b2b23770dac4551a6 63 | Qiniu: 2c05af1f9d580c036b18faf832cc98e98bfb21bc 64 | SnapKit: 5fce3c1bbbf1fbd31de9aa92f33eb9fa03f15650 65 | SwiftColorPicker: aee0bb6991feb70f675c6ee5c91a55164ed128d7 66 | SwiftyJSON: 04ccea08915aa0109039157c7974cf0298da292a 67 | 68 | COCOAPODS: 0.39.0 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #`ABANDONED | 已废弃` 2 | # iBBS-Swift 3 | ![Language](https://img.shields.io/badge/language-Swift%202.2-orange.svg) 4 | ![GitHub license](http://img.shields.io/github/license/mashape/apistatus.svg) 5 | [![Tweet](https://img.shields.io/badge/Tweet-%40iAugux-1B95E0.svg)](https://twitter.com/iaugux) 6 | 7 | A BBS client in Swift. 8 | 9 | ## Requirements 10 | 11 | - iOS 8.0+ 12 | - Xcode 7.3+ 13 | - Swift 2.2 14 | 15 | ## Usage 16 | 17 | #####Trail account: 18 | 19 | - Username:``Guest`` 20 | - Password:``123456`` 21 | 22 | #####Register new account: 23 | 24 | - Multiple users logged in with the same account in the same time may cause ``token`` to ``lose effectiveness``. I highly recommend you guys to register a new account. 25 | - Slide to left panel in app and long press the avatar icon to choose registration button. 26 | - Or just click [here](http://obbs.sinaapp.com) to register. 27 | 28 | ## Screenshots 29 | 30 |
31 | 32 |
33 |
34 | 35 |
36 | 37 |
38 |
39 | 40 |
41 | 42 |
43 |
44 | 45 |
46 | 47 |
48 |
49 | 50 |
51 | 52 |
53 | 54 | ## Contributions 55 | 56 | ``Specially thanks to:`` 57 | 58 | - Backstage of this BBS designed by my friend [mw2c](https://github.com/mw2c) . 59 | - [Alamofire](https://github.com/Alamofire/Alamofire) 60 | - [FrostedSidebar](https://github.com/edekhayser/FrostedSidebar) 61 | - [GearRefreshControl](https://github.com/andreamazz/GearRefreshControl) 62 | - [Kingfisher](https://github.com/onevcat/Kingfisher) 63 | - [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON) 64 | - [ZSSRichTextEditor](https://github.com/nnhubbard/ZSSRichTextEditor) 65 | 66 | ``Sorted by alphabet except the first one.`` 67 | 68 | ## The MIT License (MIT) 69 | `iBBS-Swift` is available under the MIT license. See the `LICENSE` file for more info. 70 | 71 | Copyright © 2015 - 2016 iAugus 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /iBBS.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS.sketch -------------------------------------------------------------------------------- /iBBS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iBBS.xcodeproj/project.xcworkspace/xcuserdata/Augus.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS.xcodeproj/project.xcworkspace/xcuserdata/Augus.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iBBS.xcodeproj/xcuserdata/Augus.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | iBBS(Chinese).xcscheme 8 | 9 | orderHint 10 | 5 11 | 12 | iBBS.xcscheme 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | B179392D1B96DDD3002E1B21 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /iBBS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /iBBS.xcworkspace/xcuserdata/Augus.xcuserdatad/UserInterfaceState (Augus' MBP's conflicted copy 2015-10-10).xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS.xcworkspace/xcuserdata/Augus.xcuserdatad/UserInterfaceState (Augus' MBP's conflicted copy 2015-10-10).xcuserstate -------------------------------------------------------------------------------- /iBBS.xcworkspace/xcuserdata/Augus.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS.xcworkspace/xcuserdata/Augus.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iBBS.xcworkspace/xcuserdata/Augus.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /iBBS/Additions/Alamofire3-SwiftyJSON.swift: -------------------------------------------------------------------------------- 1 | import Alamofire 2 | import SwiftyJSON 3 | 4 | extension Request { 5 | public static func SwiftyJSONResponseSerializer( 6 | options options: NSJSONReadingOptions = .AllowFragments) 7 | -> ResponseSerializer 8 | { 9 | return ResponseSerializer { _, _, data, error in 10 | guard error == nil else { return .Failure(error!) } 11 | 12 | guard let validData = data where validData.length > 0 else { 13 | let failureReason = "JSON could not be serialized. Input data was nil or zero length." 14 | let error = Error.errorWithCode(.JSONSerializationFailed, failureReason: failureReason) 15 | return .Failure(error) 16 | } 17 | 18 | let json:JSON = SwiftyJSON.JSON(data: validData) 19 | if let jsonError = json.error { 20 | return Result.Failure(jsonError) 21 | } 22 | 23 | return Result.Success(json) 24 | } 25 | } 26 | 27 | public func responseSwiftyJSON( 28 | options options: NSJSONReadingOptions = .AllowFragments, 29 | completionHandler: Response -> Void) 30 | -> Self 31 | { 32 | return response( 33 | responseSerializer: Request.SwiftyJSONResponseSerializer(options: options), 34 | completionHandler: completionHandler 35 | ) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /iBBS/Additions/CAAnimation+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CAAnimation+Additions.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 10/10/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIViewController { 12 | func presentViewControllerLikePushAnimation(destinationVC: UIViewController) { 13 | let transition = CATransition() 14 | transition.duration = 0.3 15 | transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) 16 | transition.type = kCATransitionPush 17 | transition.subtype = kCATransitionFromRight 18 | self.view.window?.layer.addAnimation(transition, forKey: nil) 19 | 20 | self.presentViewController(destinationVC, animated: false, completion: nil) 21 | 22 | } 23 | 24 | func dismissViewControllerLikePopAnimation() { 25 | let transition = CATransition() 26 | transition.duration = 0.3 27 | transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) 28 | transition.type = kCATransitionPush 29 | transition.subtype = kCATransitionFromLeft 30 | self.view.window?.layer.addAnimation(transition, forKey: nil) 31 | 32 | self.dismissViewControllerAnimated(false , completion: nil) 33 | } 34 | 35 | 36 | } -------------------------------------------------------------------------------- /iBBS/Additions/CheckEmailAddress+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CheckEmailAddress+Additions.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 10/3/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | extension NSString { 13 | func isValidEmail() -> Bool { 14 | let emailRegEx = "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$" 15 | 16 | let emailTest = NSPredicate(format:"SELF MATCHES %@", emailRegEx) 17 | return emailTest.evaluateWithObject(self) 18 | } 19 | 20 | func isValidPassword() -> Bool { 21 | let passwdRegex = "^([a-zA-Z0-9]|[*_ !^?#@%$&=+-]){4,16}$" 22 | let passwdTest = NSPredicate(format: "SELF MATCHES %@", passwdRegex) 23 | return passwdTest.evaluateWithObject(self) 24 | } 25 | 26 | 27 | } -------------------------------------------------------------------------------- /iBBS/Additions/DEBUGLog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DEBUGLog.swift 3 | // 4 | // Created by Augus on 2/21/16. 5 | // Copyright © 2016 iAugus. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | 10 | #if DEBUG 11 | 12 | func DEBUGLog(message: String?, filename: NSString = #file, function: String = #function, line: Int = #line) { 13 | NSLog("[\(filename.lastPathComponent):\(line)] \(function) - \(message.debugDescription)") 14 | } 15 | 16 | func DEBUGLog(message: AnyObject?, filename: NSString = #file, function: String = #function, line: Int = #line) { 17 | NSLog("[\(filename.lastPathComponent):\(line)] \(function) - \(message.debugDescription)") 18 | } 19 | 20 | func DEBUGPrint(message: Any?) { 21 | guard message != nil else { return } 22 | print(message) 23 | } 24 | 25 | #else 26 | 27 | func DEBUGLog(message: String?, filename: String = #file, function: String = #function, line: Int = #line) { } 28 | 29 | func DEBUGLog(message: AnyObject?, filename: NSString = #file, function: String = #function, line: Int = #line) { } 30 | 31 | func DEBUGPrint(message: Any?) { } 32 | 33 | #endif -------------------------------------------------------------------------------- /iBBS/Additions/Encrypt+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Encrypt+Additions.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/24/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Int { 12 | func hexString() -> NSString { 13 | return NSString(format:"%02x", self) 14 | } 15 | } 16 | 17 | extension NSData { 18 | func hexString() -> String { 19 | var string = String() 20 | for i in UnsafeBufferPointer(start: UnsafeMutablePointer(bytes), count: length) { 21 | string += Int(i).hexString() as String 22 | } 23 | return string 24 | } 25 | 26 | func MD5() -> NSData { 27 | let result = NSMutableData(length: Int(CC_MD5_DIGEST_LENGTH))! 28 | CC_MD5(bytes, CC_LONG(length), UnsafeMutablePointer(result.mutableBytes)) 29 | return NSData(data: result) 30 | } 31 | 32 | func SHA1() -> NSData { 33 | let result = NSMutableData(length: Int(CC_SHA1_DIGEST_LENGTH))! 34 | CC_SHA1(bytes, CC_LONG(length), UnsafeMutablePointer(result.mutableBytes)) 35 | return NSData(data: result) 36 | } 37 | } 38 | 39 | extension String { 40 | func MD5() -> String { 41 | return (self as NSString).dataUsingEncoding(NSUTF8StringEncoding)!.MD5().hexString() 42 | } 43 | 44 | func SHA1() -> String { 45 | return (self as NSString).dataUsingEncoding(NSUTF8StringEncoding)!.SHA1().hexString() 46 | } 47 | } -------------------------------------------------------------------------------- /iBBS/Additions/FPSLabel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FPSLabel.swift 3 | // 4 | // Created by Augus on 4/13/16. 5 | // Copyright © 2016 iAugus. All rights reserved. 6 | // 7 | 8 | 9 | import UIKit 10 | 11 | //REFERENCE: https://github.com/ibireme/YYText/blob/master/Demo/YYTextDemo/YYFPSLabel.m 12 | 13 | class FPSLabel: UILabel { 14 | 15 | private var link: CADisplayLink! 16 | private lazy var count: Int = 0 17 | private lazy var lastTime: NSTimeInterval = 0 18 | 19 | override init(frame: CGRect) { 20 | super.init(frame: frame) 21 | 22 | center = CGPointMake(18, UIScreen.mainScreen().bounds.height - 40) 23 | 24 | if frame != CGRectZero { 25 | self.frame = frame 26 | } 27 | 28 | layer.cornerRadius = 5 29 | clipsToBounds = true 30 | textAlignment = .Center 31 | textColor = UIColor.whiteColor() 32 | backgroundColor = UIColor(white: 0, alpha: 0.7) 33 | font = UIFont(name: "HelveticaNeue", size: 14) 34 | userInteractionEnabled = false 35 | 36 | weak var weakSelf = self 37 | link = CADisplayLink(target: weakSelf!, selector:#selector(FPSLabel.tick(_:)) ); 38 | link.addToRunLoop(NSRunLoop .mainRunLoop(), forMode:NSRunLoopCommonModes) 39 | } 40 | 41 | convenience init(center: CGPoint) { 42 | self.init() 43 | self.center = center 44 | } 45 | 46 | required init?(coder aDecoder: NSCoder) { 47 | fatalError("init(coder:) has not been implemented") 48 | } 49 | 50 | override func layoutSubviews() { 51 | super.layoutSubviews() 52 | sizeToFit() 53 | } 54 | 55 | @objc private func tick(link: CADisplayLink) { 56 | 57 | if lastTime == 0 { 58 | lastTime = link.timestamp 59 | return 60 | } 61 | 62 | count += 1 63 | let delta = link.timestamp - lastTime 64 | 65 | guard delta >= 1 else { return } 66 | 67 | lastTime = link.timestamp 68 | let fps = Double(count) / delta 69 | count = 0 70 | 71 | let progress = fps / 60.0; 72 | textColor = UIColor(hue: CGFloat(0.27 * (progress - 0.2)), saturation: 1, brightness: 0.9, alpha: 1) 73 | text = "\(Int(fps + 0.5)) FPS " 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /iBBS/Additions/NSString+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Addtions.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/5/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | 15 | extension NSString { 16 | 17 | func ausCalculateSize(size: CGSize, font: UIFont) -> CGSize { 18 | var expectedLabelSize: CGSize = CGSizeZero 19 | let paragraphStyle = NSMutableParagraphStyle() 20 | paragraphStyle.lineBreakMode = NSLineBreakMode.ByWordWrapping 21 | let attributes: [String : AnyObject] = [NSFontAttributeName: font, NSParagraphStyleAttributeName: paragraphStyle.copy()] 22 | expectedLabelSize = self.boundingRectWithSize(size, options: NSStringDrawingOptions.UsesLineFragmentOrigin, attributes: attributes, context: nil).size 23 | return CGSizeMake(ceil(expectedLabelSize.width), ceil(expectedLabelSize.height)) 24 | } 25 | 26 | func ausTrimHtmlInWhitespaceAndNewlineCharacterSet() -> NSString { 27 | var str = self 28 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "

")) 29 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "

")) 30 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "
")) 31 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "
")) 32 | // str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: " ")) 33 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 34 | return str 35 | } 36 | 37 | } 38 | 39 | extension String { 40 | func ausTrimHtmlInWhitespaceAndNewlineCharacterSet() -> String { 41 | var str = self 42 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "

")) 43 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "

")) 44 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "
")) 45 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "
")) 46 | // str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: " ")) 47 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 48 | return str 49 | } 50 | 51 | func ausTrimHtmlInNewlineCharacterSet() -> String { 52 | var str = self 53 | str = str.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "

")) 54 | return str 55 | } 56 | } -------------------------------------------------------------------------------- /iBBS/Additions/NSUserDefaults+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSUserDefaults+Extension.swift 3 | // 4 | // Created by Augus on 2/15/16. 5 | // Copyright © 2016 iAugus. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | extension NSUserDefaults { 12 | 13 | func getBool(key: String, defaultKeyValue: Bool) -> Bool { 14 | if valueForKey(key) == nil { 15 | setBool(defaultKeyValue, forKey: key) 16 | synchronize() 17 | } 18 | return boolForKey(key) 19 | } 20 | } 21 | 22 | extension NSUserDefaults { 23 | 24 | func getInteger(key: String, defaultKeyValue: Int) -> Int { 25 | if valueForKey(key) == nil { 26 | setInteger(defaultKeyValue, forKey: key) 27 | synchronize() 28 | } 29 | return integerForKey(key) 30 | } 31 | } 32 | 33 | extension NSUserDefaults { 34 | 35 | func getDouble(key: String, defaultKeyValue: Double) -> Double { 36 | if valueForKey(key) == nil { 37 | setDouble(defaultKeyValue, forKey: key) 38 | synchronize() 39 | } 40 | return doubleForKey(key) 41 | } 42 | } 43 | 44 | extension NSUserDefaults { 45 | 46 | func getObject(key: String, defaultkeyValue: AnyObject) -> AnyObject? { 47 | if objectForKey(key) == nil { 48 | setObject(defaultkeyValue, forKey: key) 49 | synchronize() 50 | } 51 | return objectForKey(key) 52 | } 53 | } 54 | 55 | 56 | // MARK: - 57 | 58 | extension NSUserDefaults { 59 | 60 | func colorForKey(key: String) -> UIColor? { 61 | var color: UIColor? 62 | if let colorData = dataForKey(key) { 63 | color = NSKeyedUnarchiver.unarchiveObjectWithData(colorData) as? UIColor 64 | } 65 | return color 66 | } 67 | 68 | func setColor(color: UIColor?, forKey key: String) { 69 | var colorData: NSData? 70 | if let color = color { 71 | colorData = NSKeyedArchiver.archivedDataWithRootObject(color) 72 | } 73 | setObject(colorData, forKey: key) 74 | } 75 | } 76 | 77 | extension NSUserDefaults { 78 | 79 | func setArchivedData(object: AnyObject?, forKey key: String) { 80 | var data: NSData? 81 | if let object = object { 82 | data = NSKeyedArchiver.archivedDataWithRootObject(object) 83 | } 84 | setObject(data, forKey: key) 85 | } 86 | 87 | func unarchiveObjectWithDataForKey(key: String) -> AnyObject? { 88 | guard let object = objectForKey(key) else { return nil } 89 | guard let data = object as? NSData else { return nil } 90 | return NSKeyedUnarchiver.unarchiveObjectWithData(data) 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /iBBS/Additions/PaddingLabel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PaddingLabel.swift 3 | // 4 | // Created by Augus on 4/16/16. 5 | // Copyright © 2016 iAugus. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | 10 | class PaddingLabel: UILabel { 11 | 12 | var padding = UIEdgeInsets(top: 2, left: 6, bottom: 2, right: 6) 13 | 14 | override init(frame: CGRect) { 15 | super.init(frame: frame) 16 | } 17 | 18 | convenience init(padding: UIEdgeInsets) { 19 | self.init() 20 | self.padding = padding 21 | } 22 | 23 | required init?(coder aDecoder: NSCoder) { 24 | fatalError("init(coder:) has not been implemented") 25 | } 26 | 27 | override func drawTextInRect(rect: CGRect) { 28 | super.drawTextInRect(UIEdgeInsetsInsetRect(rect, padding)) 29 | } 30 | 31 | // Override -intrinsicContentSize: for Auto layout code 32 | override func intrinsicContentSize() -> CGSize { 33 | let superContentSize = super.intrinsicContentSize() 34 | let width = superContentSize.width + padding.left + padding.right 35 | let heigth = superContentSize.height + padding.top + padding.bottom 36 | return CGSize(width: width, height: heigth) 37 | } 38 | 39 | // Override -sizeThatFits: for Springs & Struts code 40 | override func sizeThatFits(size: CGSize) -> CGSize { 41 | let superSizeThatFits = super.sizeThatFits(size) 42 | let width = superSizeThatFits.width + padding.left + padding.right 43 | let heigth = superSizeThatFits.height + padding.top + padding.bottom 44 | return CGSize(width: width, height: heigth) 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /iBBS/Additions/PanDirectionGestureRecognizer+Addtions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PanDirectionGestureRecognizer+Addtions.swift 3 | // TinderSwipeCellSwift 4 | // 5 | // Created by Augus on 8/23/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // http://stackoverflow.com/a/30607392/4656574 8 | 9 | import UIKit 10 | import UIKit.UIGestureRecognizerSubclass 11 | 12 | enum PanDirection { 13 | case Vertical 14 | case Horizontal 15 | } 16 | 17 | class PanDirectionGestureRecognizer: UIPanGestureRecognizer { 18 | 19 | let direction : PanDirection 20 | 21 | init(direction: PanDirection, target: AnyObject, action: Selector) { 22 | self.direction = direction 23 | super.init(target: target, action: action) 24 | } 25 | override func touchesMoved(touches: Set, withEvent event: UIEvent) { 26 | super.touchesMoved(touches, withEvent: event) 27 | if state == .Began { 28 | let velocity = velocityInView(self.view!) 29 | switch direction { 30 | 31 | case .Horizontal where fabs(velocity.y) > fabs(velocity.x): 32 | state = .Cancelled 33 | case .Vertical where fabs(velocity.x) > fabs(velocity.y): 34 | state = .Cancelled 35 | default: 36 | break 37 | } 38 | } 39 | 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /iBBS/Additions/TopMostViewController+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TopMostViewController+Additions.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/26/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /** 12 | Description: the toppest view controller of presenting view controller 13 | How to use: UIApplication.topMostViewController 14 | Where to use: controllers are not complex 15 | */ 16 | 17 | extension UIApplication { 18 | class var topMostViewController: UIViewController? { 19 | var topController = UIApplication.sharedApplication().keyWindow?.rootViewController 20 | while topController?.presentedViewController != nil { 21 | topController = topController?.presentedViewController 22 | } 23 | return topController 24 | } 25 | 26 | } 27 | 28 | 29 | /** 30 | Description: the toppest view controller of presenting view controller 31 | How to use: UIApplication.sharedApplication().keyWindow?.rootViewController?.topMostViewController 32 | Where to use: There are lots of kinds of controllers (UINavigationControllers, UITabbarControllers, UIViewController) 33 | */ 34 | 35 | extension UIViewController { 36 | var topMostViewController: UIViewController? { 37 | // Handling Modal views 38 | if let presentedViewController = self.presentedViewController { 39 | return presentedViewController.topMostViewController 40 | } 41 | // Handling UIViewController's added as subviews to some other views. 42 | else { 43 | for view in self.view.subviews 44 | { 45 | // Key property which most of us are unaware of / rarely use. 46 | if let subViewController = view.nextResponder() { 47 | if subViewController is UIViewController { 48 | let viewController = subViewController as! UIViewController 49 | return viewController.topMostViewController 50 | } 51 | } 52 | } 53 | return self 54 | } 55 | } 56 | } 57 | 58 | extension UITabBarController { 59 | override var topMostViewController: UIViewController? { 60 | return self.selectedViewController?.topMostViewController 61 | } 62 | } 63 | 64 | extension UINavigationController { 65 | override var topMostViewController: UIViewController? { 66 | return self.visibleViewController?.topMostViewController 67 | } 68 | } -------------------------------------------------------------------------------- /iBBS/Additions/UIButton+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Extension.swift 3 | // 4 | // Created by Augus on 2/6/16. 5 | // Copyright © 2016 iAugus. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | 10 | 11 | 12 | extension UIButton { 13 | 14 | 15 | override public func hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? { 16 | 17 | let minimalWidthAndHeight: CGFloat = 60 18 | 19 | let buttonSize = frame.size 20 | let widthToAdd = (minimalWidthAndHeight - buttonSize.width > 0) ? minimalWidthAndHeight - buttonSize.width : 0 21 | let heightToAdd = (minimalWidthAndHeight - buttonSize.height > 0) ? minimalWidthAndHeight - buttonSize.height : 0 22 | let largerFrame = CGRect(x: 0-(widthToAdd / 2), y: 0-(heightToAdd / 2), width: buttonSize.width + widthToAdd, height: buttonSize.height + heightToAdd) 23 | return CGRectContainsPoint(largerFrame, point) ? self : nil 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /iBBS/Additions/UIColor+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Additions.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/4/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | 15 | extension UIColor { 16 | class func randomColor() -> UIColor { 17 | let randomRed = CGFloat(drand48()) 18 | let randomGreen = CGFloat(drand48()) 19 | let randomBlue = CGFloat(drand48()) 20 | return UIColor(red: randomRed, green: randomGreen, blue: randomBlue, alpha: 1.0) 21 | } 22 | 23 | class func randomColorFilterDarkerOut() -> UIColor { 24 | var h = CGFloat(0) 25 | var s = CGFloat(0) 26 | var b = CGFloat(0) 27 | var a = CGFloat(0) 28 | randomColor().getHue(&h, saturation: &s, brightness: &b, alpha: &a) 29 | b = CGFloat(arc4random_uniform(10) + 5) / 10 // 0.5 < b < 1.0 30 | return UIColor(hue: h, saturation: s * 0.4, brightness: b, alpha: a) 31 | } 32 | 33 | func darkerColor(delta: CGFloat) -> UIColor { 34 | var h = CGFloat(0) 35 | var s = CGFloat(0) 36 | var b = CGFloat(0) 37 | var a = CGFloat(0) 38 | self.getHue(&h, saturation: &s, brightness: &b, alpha: &a) 39 | return UIColor(hue: h, saturation: s, brightness: b * delta, alpha: a) 40 | } 41 | 42 | func lighterColor(delta: CGFloat) -> UIColor { 43 | var h = CGFloat(0) 44 | var s = CGFloat(0) 45 | var b = CGFloat(0) 46 | var a = CGFloat(0) 47 | self.getHue(&h, saturation: &s, brightness: &b, alpha: &a) 48 | return UIColor(hue: h, saturation: s * delta, brightness: b, alpha: a) 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /iBBS/Additions/UIColor+Hex.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | extension UIColor { 4 | public convenience init(hex: String) { 5 | let noHasString = hex.stringByReplacingOccurrencesOfString( 6 | "#", 7 | withString: "") 8 | let scanner = NSScanner(string: noHasString) 9 | scanner.charactersToBeSkipped = NSCharacterSet.symbolCharacterSet() 10 | 11 | var hexInt: UInt32 = 0 12 | if (scanner.scanHexInt(&hexInt)) { 13 | let red = (hexInt >> 16) & 0xFF 14 | let green = (hexInt >> 8) & 0xFF 15 | let blue = (hexInt) & 0xFF 16 | 17 | self.init( 18 | red: CGFloat(red) / 255.0, 19 | green: CGFloat(green) / 255.0, 20 | blue: CGFloat(blue) / 255.0, 21 | alpha: 1.0 22 | ) 23 | } else { 24 | self.init( 25 | red: 0.0, 26 | green: 0.0, 27 | blue: 0.0, 28 | alpha: 0.0) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /iBBS/Additions/UIDevice+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIDevice+Extension.swift 3 | // 4 | // Created by Augus on 3/23/16. 5 | // Copyright © 2016 iAugus. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | 10 | 11 | extension UIDevice { 12 | 13 | static var isPad: Bool { 14 | return UIDevice.currentDevice().userInterfaceIdiom == .Pad 15 | } 16 | } 17 | 18 | 19 | // MARK: - Check if device supports blur 20 | // REFERENCE: - http://stackoverflow.com/a/29997626/4656574 21 | 22 | extension UIDevice { 23 | 24 | var isBlurSupported: Bool { 25 | var supported = Set() 26 | supported.insert("iPad") 27 | supported.insert("iPad1,1") 28 | supported.insert("iPhone1,1") 29 | supported.insert("iPhone1,2") 30 | supported.insert("iPhone2,1") 31 | supported.insert("iPhone3,1") 32 | supported.insert("iPhone3,2") 33 | supported.insert("iPhone3,3") 34 | supported.insert("iPod1,1") 35 | supported.insert("iPod2,1") 36 | supported.insert("iPod2,2") 37 | supported.insert("iPod3,1") 38 | supported.insert("iPod4,1") 39 | supported.insert("iPad2,1") 40 | supported.insert("iPad2,2") 41 | supported.insert("iPad2,3") 42 | supported.insert("iPad2,4") 43 | supported.insert("iPad3,1") 44 | supported.insert("iPad3,2") 45 | supported.insert("iPad3,3") 46 | 47 | return !supported.contains(hardwareString()) 48 | } 49 | 50 | private func hardwareString() -> String { 51 | var name: [Int32] = [CTL_HW, HW_MACHINE] 52 | var size: Int = 2 53 | sysctl(&name, 2, nil, &size, &name, 0) 54 | var hw_machine = [CChar](count: Int(size), repeatedValue: 0) 55 | sysctl(&name, 2, &hw_machine, &size, &name, 0) 56 | 57 | let hardware: String = String.fromCString(hw_machine)! 58 | return hardware 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /iBBS/Additions/UIImageView+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+Extension.swift 3 | // 4 | // Created by Augus on 10/11/15. 5 | // Copyright © 2015 iAugus. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | extension UIImageView { 12 | 13 | func changeImageColor(tintColor: UIColor) { 14 | self.image = self.image?.imageWithRenderingMode(.AlwaysTemplate) 15 | self.tintColor = tintColor 16 | } 17 | 18 | func changeImageWithAnimation(name: String, duration: NSTimeInterval = 1.0, animation: Bool = true) { 19 | 20 | let img = UIImage(named: name) 21 | _changeImageWithAnimation(img, duration: duration, animation: animation) 22 | } 23 | 24 | func _changeImageWithAnimation(img: UIImage?, duration: NSTimeInterval = 1.0, animation: Bool = true) { 25 | 26 | if animation { 27 | let transition = CATransition() 28 | transition.duration = duration 29 | transition.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) 30 | transition.type = kCATransitionFade 31 | layer.addAnimation(transition, forKey: nil) 32 | } 33 | 34 | // change image now 35 | image = img 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /iBBS/Additions/UILabel+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+Additions.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/8/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | 15 | extension UILabel { 16 | 17 | /** 18 | Methods to allow using HTML code with CoreText 19 | 20 | */ 21 | func ausAttributedText(data: String) { 22 | do { 23 | let formatedData = data.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) 24 | let text = try NSAttributedString(data: formatedData.dataUsingEncoding(NSUnicodeStringEncoding,allowLossyConversion: false)!, 25 | options: [ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], 26 | documentAttributes: nil) 27 | self.attributedText = text 28 | }catch{ 29 | print("something error with NSAttributedString") 30 | } 31 | } 32 | 33 | /** 34 | calculate size of UILabel 35 | 36 | :returns: CGSize 37 | */ 38 | func ausReturnFrameSizeAfterResizingLabel() -> CGSize { 39 | let fixedWidth = self.frame.size.width 40 | self.sizeThatFits(CGSize(width: fixedWidth, height: CGFloat.max)) 41 | let newSize = self.sizeThatFits(CGSize(width: fixedWidth, height: CGFloat.max)) 42 | var newFrame = self.frame 43 | newFrame.size = CGSize(width: max(newSize.width, fixedWidth), height: newSize.height) 44 | self.frame = newFrame 45 | return self.frame.size 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /iBBS/Additions/UINavigationBar+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+Extension.swift 3 | // 4 | // Created by Augus on 12/7/15. 5 | // Copyright © 2015 iAugus. All rights reserved. 6 | // 7 | 8 | 9 | import UIKit 10 | 11 | extension UINavigationBar { 12 | 13 | func hideBottomHairline() { 14 | let navigationBarImageView = hairlineImageViewInNavigationBar(self) 15 | navigationBarImageView?.hidden = true 16 | } 17 | 18 | func showBottomHairline() { 19 | let navigationBarImageView = hairlineImageViewInNavigationBar(self) 20 | navigationBarImageView?.hidden = false 21 | } 22 | 23 | private func hairlineImageViewInNavigationBar(view: UIView) -> UIImageView? { 24 | if view.isKindOfClass(UIImageView) && view.bounds.height <= 1.0 { 25 | return view as? UIImageView 26 | } 27 | 28 | let subviews = view.subviews as [UIView] 29 | for subview: UIView in subviews { 30 | if let imageView = hairlineImageViewInNavigationBar(subview) { 31 | return imageView 32 | } 33 | } 34 | 35 | return nil 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /iBBS/Additions/UIScreen+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIScreen+Extension.swift 3 | // 4 | // Created by Augus on 9/8/15. 5 | // Copyright © 2015 iAugus. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | 10 | extension UIScreen { 11 | 12 | class var width: CGFloat { 13 | return UIScreen.mainScreen().bounds.width 14 | } 15 | 16 | class var height: CGFloat { 17 | return UIScreen.mainScreen().bounds.height 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /iBBS/Additions/UIStoryboard+Extension.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIStoryboard+Extension.swift 3 | // 4 | // Created by Augus on 4/30/16. 5 | // Copyright © 2016 iAugus. All rights reserved. 6 | // 7 | 8 | import UIKit 9 | 10 | 11 | extension UIStoryboard { 12 | 13 | static var Main: UIStoryboard { 14 | return UIStoryboard(name: "Main", bundle: nil) 15 | } 16 | 17 | class var SlidePanel: UIStoryboard { 18 | return UIStoryboard(name: "SlidePanel", bundle: nil) 19 | } 20 | 21 | class var User: UIStoryboard { 22 | return UIStoryboard(name: "User", bundle: nil) 23 | } 24 | } -------------------------------------------------------------------------------- /iBBS/Additions/UITextView+Additions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UITextView+Additions.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/8/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | 15 | 16 | extension UITextView { 17 | 18 | /** 19 | Methods to allow using HTML code with CoreText 20 | 21 | */ 22 | 23 | func ausAttributedText(data: String) { 24 | 25 | var formatedData = data.stringByDecodingHTMLEntities() 26 | formatedData = formatedData.stringByReplacingOccurrencesOfString("\\\"", withString: "\"") 27 | 28 | let text = try? NSAttributedString(data: formatedData.dataUsingEncoding(NSUnicodeStringEncoding, allowLossyConversion: false)!, 29 | options: [ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], 30 | documentAttributes: nil) 31 | 32 | self.attributedText = text 33 | } 34 | 35 | 36 | /** 37 | calculate size of UITextView 38 | 39 | :returns: CGSize 40 | */ 41 | func ausReturnFrameSizeAfterResizingTextView() -> CGSize { 42 | let fixedWidth = self.frame.size.width 43 | self.sizeThatFits(CGSize(width: fixedWidth, height: CGFloat.max)) 44 | let newSize = self.sizeThatFits(CGSize(width: fixedWidth, height: CGFloat.max)) 45 | var newFrame = self.frame 46 | newFrame.size = CGSize(width: max(newSize.width, fixedWidth), height: newSize.height) 47 | self.frame = newFrame 48 | return self.frame.size 49 | } 50 | 51 | 52 | } 53 | 54 | 55 | func ausTextViewSizeForAttributedText(text: String) -> CGSize { 56 | let calculationView = UITextView() 57 | calculationView.ausAttributedText(text) 58 | let size = calculationView.sizeThatFits(CGSizeMake(CGFloat.max, CGFloat.max)) 59 | return size 60 | } -------------------------------------------------------------------------------- /iBBS/Additions/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.swift 3 | // 4 | // Created by Augus on 11/10/15. 5 | // Copyright © 2015 iAugus. All rights reserved. 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | 12 | public typealias CompletionHandler = () -> () 13 | 14 | 15 | class Utils { 16 | 17 | class var documentPath: String { 18 | return NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true).first! 19 | } 20 | 21 | class func appGroupDocumentPath(appGroupId: String) -> String { 22 | let url = NSFileManager.defaultManager().containerURLForSecurityApplicationGroupIdentifier(appGroupId) 23 | let path = url!.absoluteString.stringByReplacingOccurrencesOfString("file:", withString: "", options: .LiteralSearch, range: nil) 24 | return path 25 | 26 | } 27 | 28 | } 29 | 30 | 31 | // MARK: - GCD 32 | 33 | var GlobalMainQueue: dispatch_queue_t { 34 | return dispatch_get_main_queue() 35 | } 36 | 37 | var GlobalUserInteractiveQueue: dispatch_queue_t { 38 | return dispatch_get_global_queue(Int(QOS_CLASS_USER_INTERACTIVE.rawValue), 0) 39 | } 40 | 41 | var GlobalUserInitiatedQueue: dispatch_queue_t { 42 | return dispatch_get_global_queue(Int(QOS_CLASS_USER_INITIATED.rawValue), 0) 43 | } 44 | 45 | var GlobalUtilityQueue: dispatch_queue_t { 46 | return dispatch_get_global_queue(Int(QOS_CLASS_UTILITY.rawValue), 0) 47 | } 48 | 49 | var GlobalBackgroundQueue: dispatch_queue_t { 50 | return dispatch_get_global_queue(Int(QOS_CLASS_BACKGROUND.rawValue), 0) 51 | } 52 | 53 | // MARK: - Delay 54 | 55 | func executeAfterDelay(seconds: Double, completion: (() -> Void)) { 56 | let delayInSeconds: Double = seconds 57 | let popTime = dispatch_time(DISPATCH_TIME_NOW, Int64(Double(NSEC_PER_SEC) * delayInSeconds)) 58 | dispatch_after(popTime, dispatch_get_main_queue(), { 59 | completion() 60 | }) 61 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/Administrator.imageset/Administrator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/Administrator.imageset/Administrator.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/Administrator.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Administrator.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "29x29", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-29@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "29x29", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-29@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "40x40", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-40@2x.png", 19 | "scale" : "2x" 20 | }, 21 | { 22 | "size" : "40x40", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-40@3x.png", 25 | "scale" : "3x" 26 | }, 27 | { 28 | "size" : "60x60", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-60@2x.png", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "size" : "60x60", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-60@3x.png", 37 | "scale" : "3x" 38 | }, 39 | { 40 | "size" : "29x29", 41 | "idiom" : "ipad", 42 | "filename" : "Icon-29.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "29x29", 47 | "idiom" : "ipad", 48 | "filename" : "Icon-29@2x-1.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "40x40", 53 | "idiom" : "ipad", 54 | "filename" : "Icon-40.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "40x40", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-40@2x-1.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "76x76", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-76.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "76x76", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-76@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "83.5x83.5", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-83.5@2x.png", 79 | "scale" : "2x" 80 | } 81 | ], 82 | "info" : { 83 | "version" : 1, 84 | "author" : "xcode" 85 | } 86 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-29.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-29@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-29@2x-1.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-40.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-40@2x-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-40@2x-1.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-76.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-76@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/AppIcon.appiconset/Icon-83.5@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/avatar_placeholder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "avatar_placeholder@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/avatar_placeholder.imageset/avatar_placeholder@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/avatar_placeholder.imageset/avatar_placeholder@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/back_button.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "back_button.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "back_button@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "back_button@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/back_button.imageset/back_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/back_button.imageset/back_button.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/back_button.imageset/back_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/back_button.imageset/back_button@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/back_button.imageset/back_button@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/back_button.imageset/back_button@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_black.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg_image_black.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_black.imageset/bg_image_black.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/bg_image_black.imageset/bg_image_black.jpg -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_blue.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg_image_blue.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_blue.imageset/bg_image_blue.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/bg_image_blue.imageset/bg_image_blue.jpg -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_green.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "bg_image_green.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_green.imageset/bg_image_green.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/bg_image_green.imageset/bg_image_green.jpg -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_pink.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg_image_pink.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_pink.imageset/bg_image_pink.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/bg_image_pink.imageset/bg_image_pink.jpg -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_purple.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "bg_image_purple.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_purple.imageset/bg_image_purple.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/bg_image_purple.imageset/bg_image_purple.jpg -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_red.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "bg_image_red.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_red.imageset/bg_image_red.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/bg_image_red.imageset/bg_image_red.jpg -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_yellow.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "bg_image_yellow.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/bg_image_yellow.imageset/bg_image_yellow.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/bg_image_yellow.imageset/bg_image_yellow.jpg -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/blank_button.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "blank_button.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "blank_button@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "blank_button@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/blank_button.imageset/blank_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/blank_button.imageset/blank_button.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/blank_button.imageset/blank_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/blank_button.imageset/blank_button@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/blank_button.imageset/blank_button@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/blank_button.imageset/blank_button@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/checkButton.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "checkButton.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/checkButton.imageset/checkButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/checkButton.imageset/checkButton.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/clear_color_image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "clear_color_image.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/clear_color_image.imageset/clear_color_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/clear_color_image.imageset/clear_color_image.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/close.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "close@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "close@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/close.imageset/close@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/close.imageset/close@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/close.imageset/close@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/close.imageset/close@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/color.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "filename" : "rgb_circle_2.png", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/color.imageset/rgb_circle_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/color.imageset/rgb_circle_2.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/continue.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "continue.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "continue@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "continue@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/continue.imageset/continue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/continue.imageset/continue.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/continue.imageset/continue@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/continue.imageset/continue@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/continue.imageset/continue@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/continue.imageset/continue@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/home.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "home.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "home@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "home@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/home.imageset/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/home.imageset/home.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/home.imageset/home@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/home.imageset/home@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/home.imageset/home@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/home.imageset/home@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/message.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "message.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "message@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "message@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/message.imageset/message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/message.imageset/message.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/message.imageset/message@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/message.imageset/message@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/message.imageset/message@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/message.imageset/message@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/message_is_read_marker.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "message_read_1.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "message_read_1@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "message_read_1@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/message_is_read_marker.imageset/message_read_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/message_is_read_marker.imageset/message_read_1.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/message_is_read_marker.imageset/message_read_1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/message_is_read_marker.imageset/message_read_1@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/message_is_read_marker.imageset/message_read_1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/message_is_read_marker.imageset/message_read_1@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/node.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "node.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "node@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "node@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/node.imageset/node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/node.imageset/node.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/node.imageset/node@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/node.imageset/node@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/node.imageset/node@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/node.imageset/node@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/plus_button.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "plus_button.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "plus_button@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "plus_button@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/plus_button.imageset/plus_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/plus_button.imageset/plus_button.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/plus_button.imageset/plus_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/plus_button.imageset/plus_button@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/plus_button.imageset/plus_button@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/plus_button.imageset/plus_button@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/register_button.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "register_button.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "register_button@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "register_button@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/register_button.imageset/register_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/register_button.imageset/register_button.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/register_button.imageset/register_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/register_button.imageset/register_button@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/register_button.imageset/register_button@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/register_button.imageset/register_button@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/send.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "send.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/send.imageset/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/send.imageset/send.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/send_message.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "send_message@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/send_message.imageset/send_message@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/send_message.imageset/send_message@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/settings.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "settings@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "settings@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/settings.imageset/settings@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/settings.imageset/settings@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/settings.imageset/settings@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/settings.imageset/settings@3x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/star.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "filename" : "filled_star.png", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/star.imageset/filled_star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/star.imageset/filled_star.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/trash.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "trash@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "delete.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/trash.imageset/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/trash.imageset/delete.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/trash.imageset/trash@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/trash.imageset/trash@2x.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/unstar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "filename" : "star.png", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/unstar.imageset/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/unstar.imageset/star.png -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/xButton.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "xButton.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /iBBS/Assets.xcassets/xButton.imageset/xButton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/Assets.xcassets/xButton.imageset/xButton.png -------------------------------------------------------------------------------- /iBBS/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /iBBS/BaseViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseViewController.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/2/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftyJSON 11 | 12 | class BaseViewController: UIViewController { 13 | struct VCIdentifiers { 14 | static let mainDetailVC = "mainDetailViewController" 15 | 16 | } 17 | 18 | override func viewDidLoad() { 19 | super.viewDidLoad() 20 | self.changeStatusBarColorOnSwipe() 21 | } 22 | 23 | override func didReceiveMemoryWarning() { 24 | super.didReceiveMemoryWarning() 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | var datasource: Array!{ 29 | didSet{ 30 | // print(datasource) 31 | 32 | } 33 | } 34 | 35 | // after swiping, navigation bar has been hidden, but background color of status bar is clearColor, so I need to set status bar' color to navigation bar' tintcolor 36 | func changeStatusBarColorOnSwipe(){ 37 | let statusBarView: UIToolbar = UIToolbar(frame: CGRectMake(0, 0, kScreenWidth, 22)) 38 | statusBarView.barStyle = UIBarStyle.Default 39 | // statusBarView.barTintColor = UIColor.redColor() 40 | 41 | self.view.addSubview(statusBarView) 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /iBBS/CWStatusBarNotification/IBBSToast.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSToast.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 4/23/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | 12 | class IBBSToast { 13 | 14 | private static var notification: CWStatusBarNotification = { 15 | let notification = CWStatusBarNotification() 16 | notification.notificationAnimationInStyle = .Top 17 | notification.notificationAnimationOutStyle = .Top 18 | return notification 19 | }() 20 | 21 | static func make(message: String, delay: NSTimeInterval = 0, interval: NSTimeInterval = 1.0) { 22 | 23 | let make = { 24 | notification.displayNotificationWithMessage(message, forDuration: interval) 25 | } 26 | 27 | dispatch_async(dispatch_get_main_queue()) { 28 | 29 | if delay != 0 { 30 | let delayInSeconds: Double = delay 31 | let popTime = dispatch_time(DISPATCH_TIME_NOW, Int64(Double(NSEC_PER_SEC) * delayInSeconds)) 32 | dispatch_after(popTime, dispatch_get_main_queue(), { 33 | make() 34 | }) 35 | } else { 36 | make() 37 | } 38 | } 39 | 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /iBBS/FrostedSidebar/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/FrostedSidebar/.DS_Store -------------------------------------------------------------------------------- /iBBS/IBBSAvatarImageView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSAvatarImageView.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 11/3/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SnapKit 11 | 12 | 13 | struct User { 14 | var id: Int 15 | var name: String 16 | 17 | init(id: Int, name: String) { 18 | self.id = id 19 | self.name = name 20 | } 21 | } 22 | 23 | private let overlayImage: UIImage = { 24 | let radius: CGFloat = 15 25 | let innerSize = CGSizeMake(30, 30) 26 | let image = UIGraphicsDrawAntiRoundedCornerImageWithRadius(radius, outerSize: innerSize, innerSize: innerSize, fillColor: UIColor.whiteColor()) 27 | return image 28 | }() 29 | 30 | class IBBSAvatarImageView: UIImageView { 31 | 32 | var user: User! 33 | 34 | var antiOffScreenRendering: Bool = true { 35 | didSet { 36 | guard !antiOffScreenRendering else { return } 37 | guard let _ = overlayView?.removeFromSuperview() else { return } 38 | 39 | layer.cornerRadius = frame.width / 2 40 | layoutIfNeeded() 41 | } 42 | } 43 | 44 | private var overlayView: UIImageView! 45 | 46 | required init?(coder aDecoder: NSCoder) { 47 | super.init(coder: aDecoder) 48 | 49 | clipsToBounds = true 50 | backgroundColor = UIColor.randomColorFilterDarkerOut() 51 | 52 | overlayView = UIImageView() 53 | overlayView.image = overlayImage 54 | overlayView.contentMode = .ScaleToFill 55 | addSubview(overlayView) 56 | overlayView.snp_makeConstraints { (make) in 57 | make.edges.equalTo(UIEdgeInsetsZero) 58 | } 59 | 60 | userInteractionEnabled = true 61 | 62 | let recognizer = UITapGestureRecognizer(target: self, action: #selector(IBBSAvatarImageView.avatarDidTap)) 63 | addGestureRecognizer(recognizer) 64 | } 65 | 66 | @objc private func avatarDidTap() { 67 | 68 | guard user != nil else { return } 69 | 70 | guard let nav = UIStoryboard.User.instantiateViewControllerWithIdentifier("UserNavigationViewController") as? UINavigationController else { return } 71 | 72 | guard let vc = nav.viewControllers.first as? IBBSUserViewController else { return } 73 | 74 | vc.user = user 75 | 76 | UIApplication.topMostViewController?.presentViewController(nav, animated: true, completion: nil) 77 | } 78 | 79 | } -------------------------------------------------------------------------------- /iBBS/IBBSColorPickerViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSColorPickerViewController.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 5/4/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftColorPicker 11 | 12 | 13 | protocol ColorPickerViewControllerDelegate { 14 | func colorDidChange(color: UIColor) 15 | } 16 | 17 | class IBBSColorPickerViewController: UIViewController { 18 | 19 | var delegate: ColorPickerViewControllerDelegate! 20 | 21 | var pickerController: ColorPickerController? 22 | 23 | @IBOutlet private weak var colorPicker: ColorPicker! { 24 | didSet { 25 | colorPicker.backgroundColor = UIColor.clearColor() 26 | colorPicker.layer.cornerRadius = 8 27 | } 28 | } 29 | 30 | @IBOutlet private weak var huePicker: HuePicker! { 31 | didSet{ 32 | huePicker.backgroundColor = UIColor.clearColor() 33 | huePicker.layer.cornerRadius = 8 34 | } 35 | } 36 | 37 | override func viewDidLoad() { 38 | super.viewDidLoad() 39 | view.backgroundColor = UIColor.clearColor() 40 | 41 | pickerController = ColorPickerController(svPickerView: colorPicker, huePickerView: huePicker, colorWell: ColorWell()) 42 | 43 | pickerController?.color = UIColor.redColor() 44 | 45 | pickerController?.onColorChange = { (color, _) in 46 | self.delegate?.colorDidChange(color) 47 | } 48 | } 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /iBBS/IBBSConstants.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSConstants.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/16/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | 15 | 16 | let kThemeDidChangeNotification = "kThemeDidChangeNotification" 17 | let kShouldHideCornerActionButton = "kShouldHideCornerActionButton" 18 | let kShouldShowCornerActionButton = "kShouldShowCornerActionButton" 19 | let kShouldReloadDataAfterPosting = "kShouldReloadDataAfterPosting" 20 | let kJustLoggedinNotification = "kJustLoggedinNotification" 21 | 22 | 23 | var SHOULD_HIDE_NAVIGATIONBAR = false 24 | 25 | let BLUR_VIEW_ALPHA_OF_BG_IMAGE: CGFloat = 0.70 26 | 27 | let isIphone3_5Inch: Bool = UIScreen.mainScreen().bounds.size.height == 480 ? true : false 28 | 29 | let HEADER_TITLE_FONT_SIZE: CGFloat = 17 30 | let HEADER_CONTENT_FONT_SIZE: CGFloat = 15.0 31 | 32 | let TITLE_FOR_HEADER_IN_SECTION_FONT_SIZE: CGFloat = 15.0 33 | 34 | let TIME_OF_TOAST_OF_REGISTER_SUCCESS: Double = 3.0 35 | let TIME_OF_TOAST_OF_REPLY_SUCCESS: Double = 1.0 36 | let TIME_OF_TOAST_OF_POST_SUCCESS: Double = 3.5 37 | let TIME_OF_TOAST_OF_POST_FAILED: Double = 3.0 38 | let TIME_OF_TOAST_OF_COMMENT_SUCCESS: Double = 3.5 39 | let TIME_OF_TOAST_OF_COMMENT_FAILED: Double = 3 40 | let TIME_OF_TOAST_OF_TOKEN_ILLEGAL: Double = 1.0 41 | let TIME_OF_TOAST_OF_SERVER_ERROR: Double = 3.0 42 | let TIME_OF_TOAST_OF_NO_MORE_DATA: Double = 0.8 43 | 44 | let SWIPE_LEFT_TO_CANCEL_RIGHT_TO_CONTINUE = true 45 | 46 | 47 | 48 | let AVATAR_PLACEHOLDER_IMAGE = UIImage(named: "avatar_placeholder") 49 | 50 | 51 | @objc class ConstantsForObjc: NSObject { 52 | class var customThemeColorForObjc: UIColor { 53 | return CUSTOM_THEME_COLOR 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /iBBS/IBBSCustomSelectedBackgroundView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSCustomSelectedBackgroundView.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 10/6/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | 13 | class IBBSCustomSelectedBackgroundView: UIView { 14 | 15 | var fillColor = CUSTOM_THEME_COLOR.lighterColor(0.8) 16 | 17 | override func drawRect(rect: CGRect) { 18 | let aRef = UIGraphicsGetCurrentContext() 19 | CGContextSaveGState(aRef) 20 | let bezierPath = UIBezierPath(roundedRect: rect, cornerRadius: 8.0) 21 | bezierPath.lineWidth = 8.0 22 | UIColor.whiteColor().setStroke() 23 | 24 | fillColor.setFill() 25 | 26 | bezierPath.stroke() 27 | bezierPath.fill() 28 | CGContextRestoreGState(aRef) 29 | } 30 | } -------------------------------------------------------------------------------- /iBBS/IBBSDetailHeaderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSDetailHeaderView.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/4/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | import SwiftyJSON 15 | 16 | class IBBSDetailHeaderView: UIView { 17 | 18 | @IBOutlet weak var headerTitleLabel: UILabel! { 19 | didSet{ 20 | headerTitleLabel.numberOfLines = 0 21 | } 22 | } 23 | 24 | @IBOutlet weak var avatarImageView: IBBSAvatarImageView! 25 | @IBOutlet weak var usernameLabel: UILabel! 26 | @IBOutlet weak var timeLabel: UILabel! 27 | @IBOutlet weak var content: UITextView! 28 | 29 | var nodeName: String? 30 | 31 | func loadData(json: JSON) { 32 | 33 | let model = IBBSTopicModel(json: json) 34 | 35 | avatarImageView.kf_setImageWithURL(model.avatarUrl, placeholderImage: AVATAR_PLACEHOLDER_IMAGE) 36 | 37 | avatarImageView.user = User(id: model.uid, name: model.username) 38 | 39 | nodeName = model.board 40 | usernameLabel.text = model.username 41 | headerTitleLabel.text = model.title 42 | timeLabel.text = model.postTime 43 | content.ausAttributedText(model.content) 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /iBBS/IBBSEffectViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSEffectViewController.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/26/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SnapKit 11 | 12 | class IBBSEffectViewController: UIViewController { 13 | 14 | override func viewDidLoad() { 15 | super.viewDidLoad() 16 | 17 | view.backgroundColor = UIColor(patternImage: BACKGROUNDER_IMAGE!) 18 | 19 | // blur view 20 | let blurView = UIVisualEffectView(effect: UIBlurEffect(style: .Light)) 21 | blurView.alpha = BLUR_VIEW_ALPHA_OF_BG_IMAGE 22 | view.addSubview(blurView) 23 | blurView.snp_makeConstraints { (make) in 24 | make.edges.equalTo(UIEdgeInsetsZero) 25 | } 26 | 27 | let gesture = UITapGestureRecognizer(target: self, action: #selector(IBBSEffectViewController.blurViewDidTap)) 28 | blurView.addGestureRecognizer(gesture) 29 | } 30 | 31 | override func didReceiveMemoryWarning() { 32 | super.didReceiveMemoryWarning() 33 | // Dispose of any resources that can be recreated. 34 | } 35 | 36 | @objc private func blurViewDidTap() { 37 | dismissViewControllerAnimated(true , completion: nil) 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /iBBS/IBBSFavoriteViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSFavoriteViewController.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 10/10/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class IBBSFavoriteViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | let image = UIImage(named: "close")?.imageWithRenderingMode(.AlwaysTemplate) 17 | navigationItem.leftBarButtonItem = UIBarButtonItem(image: image, style: .Plain, target: self, action: #selector(dismissViewController)) 18 | 19 | navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName : CUSTOM_THEME_COLOR] 20 | } 21 | 22 | override func didReceiveMemoryWarning() { 23 | super.didReceiveMemoryWarning() 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /iBBS/IBBSLoginModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSLoginModel.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 4/24/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import SwiftyJSON 10 | 11 | 12 | struct IBBSLoginModel { 13 | 14 | var message: String! 15 | var token: String! 16 | var isAdmin: Bool! 17 | var success: Bool! 18 | var expire: NSDate! 19 | var avatar: NSURL! 20 | var userId: Int! 21 | var username: String! 22 | 23 | init(json: JSON) { 24 | message = json["msg"].stringValue 25 | token = json["token"].stringValue 26 | isAdmin = json["is_admin"].boolValue 27 | success = json["code"].boolValue 28 | expire = NSDate(timeIntervalSince1970: json["expire"].doubleValue) 29 | avatar = NSURL(string: json["avatar"].stringValue) 30 | userId = json["uid"].intValue 31 | username = json["username"].stringValue 32 | } 33 | } -------------------------------------------------------------------------------- /iBBS/IBBSMessageModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSMessageModel.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 4/18/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import SwiftyJSON 10 | 11 | 12 | struct IBBSMessageModel { 13 | 14 | var id: Int! 15 | var avatarUrl: NSURL! 16 | var sender: String! 17 | var senderUid: Int! 18 | var content: String! 19 | var sendTime: String! 20 | var isRead: Bool! 21 | var isAdministrator: Bool! 22 | 23 | init(json: JSON) { 24 | avatarUrl = NSURL(string: json["sender_avatar"].stringValue) 25 | id = json["id"].intValue 26 | sender = json["sender"].stringValue 27 | senderUid = json["sender_uid"].intValue 28 | content = json["title"].stringValue 29 | sendTime = json["send_time"].stringValue 30 | isRead = json["is_read"].intValue == 0 ? true : false 31 | isAdministrator = json["type"].boolValue 32 | } 33 | } 34 | 35 | 36 | struct IBBSReadMessageModel { 37 | 38 | var username: String! 39 | var title: String! 40 | var content: String! 41 | 42 | init(json: JSON) { 43 | username = json["msg"]["username"].stringValue 44 | content = json["msg"]["content"].stringValue 45 | title = json["title"].stringValue 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /iBBS/IBBSMessageTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSMessageTableViewCell.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/16/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | import SwiftyJSON 15 | 16 | 17 | class IBBSMessageTableViewCell: UITableViewCell { 18 | 19 | @IBOutlet var avatarImageView: IBBSAvatarImageView! 20 | @IBOutlet var isMessageRead: UIImageView! 21 | @IBOutlet var timeLabel: UILabel! 22 | @IBOutlet var contentLabel: UILabel! 23 | @IBOutlet var usernameLabel: UILabel! 24 | 25 | var isRead: Bool = false 26 | 27 | override func awakeFromNib() { 28 | super.awakeFromNib() 29 | layoutMargins = UIEdgeInsetsZero 30 | separatorInset = UIEdgeInsetsZero 31 | selectionStyle = UITableViewCellSelectionStyle.None 32 | } 33 | 34 | override func setSelected(selected: Bool, animated: Bool) { 35 | super.setSelected(selected, animated: animated) 36 | 37 | // Configure the view for the selected state 38 | } 39 | 40 | 41 | 42 | func loadDataToCell(json: JSON) { 43 | 44 | let model = IBBSMessageModel(json: json) 45 | 46 | avatarImageView.kf_setImageWithURL(model.avatarUrl, placeholderImage: AVATAR_PLACEHOLDER_IMAGE) 47 | 48 | timeLabel.text = model.sendTime 49 | contentLabel.text = model.content 50 | isRead = model.isRead 51 | 52 | isMessageRead.image = UIImage(named: "message_is_read_marker") 53 | isRead ? isMessageRead.changeImageColor(CUSTOM_THEME_COLOR.lighterColor(0.7)) : () 54 | 55 | if !model.isAdministrator { 56 | avatarImageView.backgroundColor = UIColor.blackColor() 57 | avatarImageView.image = UIImage(named: "administrator") 58 | usernameLabel.text = "Admin" 59 | avatarImageView.user = User(id: model.senderUid, name: "Admin") 60 | } else { 61 | usernameLabel.text = model.sender 62 | avatarImageView.user = User(id: model.senderUid, name: model.sender) 63 | } 64 | 65 | } 66 | 67 | func changeColorForMessageMarker() { 68 | 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /iBBS/IBBSModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSModel.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 4/24/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import SwiftyJSON 10 | 11 | 12 | struct IBBSModel { 13 | 14 | var success: Bool 15 | var message: String! 16 | 17 | init(json: JSON?) { 18 | if json != nil { 19 | success = json!["code"].boolValue 20 | message = json!["msg"].stringValue 21 | } else { 22 | success = false 23 | message = "" 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /iBBS/IBBSNodeModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSNodeModel.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 4/26/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import SwiftyJSON 10 | 11 | 12 | struct IBBSNodeModel { 13 | 14 | var id: Int! 15 | var name: String! 16 | var numberOfTotal: Int! 17 | var numberOfToday: Int! 18 | 19 | init(json: JSON) { 20 | id = json["id"].intValue 21 | name = json["name"].stringValue 22 | numberOfTotal = json["post_num"].intValue 23 | numberOfToday = json["post_today"].intValue 24 | } 25 | } -------------------------------------------------------------------------------- /iBBS/IBBSNodeTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSNodeTableViewCell.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/2/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | import SwiftyJSON 15 | 16 | class IBBSNodeTableViewCell: UITableViewCell { 17 | 18 | @IBOutlet weak var userProfireImage: IBBSAvatarImageView! 19 | @IBOutlet weak var topicLabel: UILabel! 20 | @IBOutlet weak var userName: UILabel! 21 | @IBOutlet weak var postTime: UILabel! 22 | 23 | override func awakeFromNib() { 24 | super.awakeFromNib() 25 | 26 | // Initialization code 27 | // backgroundColor = UIColor.clearColor() 28 | preservesSuperviewLayoutMargins = false 29 | separatorInset = UIEdgeInsetsZero 30 | layoutMargins = UIEdgeInsetsZero 31 | } 32 | 33 | 34 | override func setSelected(selected: Bool, animated: Bool) { 35 | super.setSelected(selected, animated: animated) 36 | 37 | // Configure the view for the selected state 38 | } 39 | 40 | func loadDataToCell(json: JSON) { 41 | 42 | let model = IBBSNodeTopicListModel(json: json) 43 | 44 | userProfireImage.kf_setImageWithURL(model.avatarUrl, placeholderImage: AVATAR_PLACEHOLDER_IMAGE) 45 | 46 | userProfireImage.user = User(id: model.uid, name: model.username) 47 | 48 | topicLabel.text = model.title 49 | userName.text = model.username 50 | postTime.text = model.postTime 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /iBBS/IBBSNodeTopicListModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSNodeTopicListModel.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 4/18/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import SwiftyJSON 10 | 11 | 12 | struct IBBSNodeTopicListModel { 13 | 14 | var title: String! 15 | var uid: Int! 16 | var username: String! 17 | var postTime: String! 18 | var avatarUrl: NSURL! 19 | 20 | init(json: JSON) { 21 | title = json["title"].stringValue 22 | uid = json["uid"].intValue 23 | username = json["username"].stringValue 24 | postTime = json["post_time"].stringValue 25 | avatarUrl = NSURL(string: json["avatar"].stringValue) 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /iBBS/IBBSNodesCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSNodesCell.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/10/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | 15 | class IBBSNodesCell: UITableViewCell { 16 | 17 | 18 | override init(style: UITableViewCellStyle, reuseIdentifier: String?) { 19 | super.init(style: .Default, reuseIdentifier: nil) 20 | layoutMargins = UIEdgeInsetsZero 21 | separatorInset = UIEdgeInsetsZero 22 | } 23 | 24 | required init?(coder aDecoder: NSCoder) { 25 | fatalError("init(coder:) has not been implemented") 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /iBBS/IBBSNodesCollectionViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSNodesCollectionViewCell.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 10/6/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class IBBSNodesCollectionViewCell: UICollectionViewCell { 12 | 13 | var customBackgroundView: IBBSCustomSelectedBackgroundView! 14 | 15 | @IBOutlet var infoLabel: UILabel! { 16 | didSet{ 17 | infoLabel.text = nil 18 | // infoLabel.textColor = CUSTOM_THEME_COLOR 19 | } 20 | } 21 | 22 | @IBOutlet var imageView: UIImageView! { 23 | didSet{ 24 | imageView.backgroundColor = CUSTOM_THEME_COLOR.lighterColor(0.75) 25 | imageView.layer.cornerRadius = 7.0 26 | // imageView.layer.borderWidth = 1 27 | // imageView.layer.borderColor = CUSTOM_THEME_COLOR.darkerColor(0.9).CGColor 28 | imageView.layer.shadowColor = CUSTOM_THEME_COLOR.darkerColor(0.9).CGColor 29 | imageView.layer.shadowOffset = CGSizeMake(1, 1) 30 | imageView.layer.shadowOpacity = 0.5 31 | 32 | } 33 | } 34 | 35 | override init(frame: CGRect) { 36 | super.init(frame: frame) 37 | 38 | } 39 | 40 | required init?(coder aDecoder: NSCoder) { 41 | super.init(coder: aDecoder) 42 | customBackgroundView = IBBSCustomSelectedBackgroundView() 43 | selectedBackgroundView = customBackgroundView 44 | 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /iBBS/IBBSPickerViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSPickerViewController.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/15/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | 15 | class IBBSPickerViewController: UIViewController { 16 | 17 | var textField: UITextField! 18 | var isInsertImagePicker: Bool! 19 | var demoView: IBBSEditorBaseViewController! 20 | 21 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) { 22 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 23 | 24 | // Custom initialization 25 | } 26 | 27 | override func viewDidLoad() { 28 | super.viewDidLoad() 29 | 30 | title = "Picker" 31 | view.backgroundColor = UIColor.redColor() 32 | 33 | let saveButton = UIBarButtonItem(barButtonSystemItem: .Save, target: self, action: #selector(saveURL)) 34 | navigationItem.rightBarButtonItem = saveButton 35 | 36 | navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Cancel, target: self, action: #selector(cancel)) 37 | 38 | textField = UITextField(frame: CGRectMake(20, 20, view.frame.size.width - 40, 40)) 39 | textField.text = !isInsertImagePicker ? "http://www.apple.com" : "http://fineprintnyc.com/images/blog/history-of-apple-logo/apple-logo-2.jpg" 40 | textField.layer.borderColor = UIColor.grayColor().CGColor 41 | textField.layer.borderWidth = 0.5 42 | textField.clearButtonMode = UITextFieldViewMode.Always 43 | view.addSubview(textField) 44 | } 45 | 46 | @objc private func cancel() { 47 | dismissViewControllerAnimated(true , completion: nil) 48 | } 49 | 50 | @objc private func saveURL() { 51 | dismissViewControllerAnimated(true , completion: nil) 52 | let vc = demoView 53 | if !isInsertImagePicker { 54 | vc.showInsertLinkDialogWithLink(textField.text, title: nil) 55 | } else { 56 | vc.showInsertLinkDialogWithLink(textField.text, title: nil) 57 | } 58 | } 59 | 60 | required init?(coder aDecoder: NSCoder) { 61 | fatalError("init(coder:) has not been implemented") 62 | } 63 | 64 | override func didReceiveMemoryWarning() { 65 | super.didReceiveMemoryWarning() 66 | // Dispose of any resources that can be recreated. 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /iBBS/IBBSReplyMessageModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSMessageModel.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 4/18/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import SwiftyJSON 10 | 11 | struct IBBSReplyMessageModel { 12 | 13 | var id: Int! 14 | var avatarUrl: NSURL! 15 | var uid: Int! 16 | var username: String! 17 | var content: String! 18 | 19 | init(json: JSON) { 20 | id = json["id"].intValue 21 | avatarUrl = NSURL(string: json["avatar"].stringValue) 22 | uid = json["uid"].intValue 23 | username = json["username"].stringValue 24 | content = json["comment_content"].stringValue 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /iBBS/IBBSRootNavigationController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RootNavigationController.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/13/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | 15 | class RootNavigationController: UINavigationController { 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | override func didReceiveMemoryWarning() { 23 | super.didReceiveMemoryWarning() 24 | // Dispose of any resources that can be recreated. 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /iBBS/IBBSSettingContainerViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSSettingContainerViewController.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 5/5/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class IBBSSettingContainerViewController: UITableViewController { 12 | 13 | @IBOutlet weak var passcodeSwitch: UISwitch! { 14 | didSet { 15 | passcodeSwitch.onTintColor = CUSTOM_THEME_COLOR 16 | } 17 | } 18 | 19 | private let configuration: PasscodeLockConfigurationType! 20 | 21 | init(configuration: PasscodeLockConfigurationType) { 22 | 23 | self.configuration = configuration 24 | 25 | super.init(nibName: nil, bundle: nil) 26 | } 27 | 28 | required init?(coder aDecoder: NSCoder) { 29 | 30 | let repository = UserDefaultsPasscodeRepository() 31 | configuration = PasscodeLockConfiguration(repository: repository) 32 | 33 | super.init(coder: aDecoder) 34 | } 35 | 36 | override func viewDidLoad() { 37 | super.viewDidLoad() 38 | tableView.tableFooterView = UIView() 39 | } 40 | 41 | override func viewWillAppear(animated: Bool) { 42 | super.viewWillAppear(animated) 43 | updatePasscodeView() 44 | } 45 | 46 | override func didReceiveMemoryWarning() { 47 | super.didReceiveMemoryWarning() 48 | // Dispose of any resources that can be recreated. 49 | } 50 | 51 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 52 | return 2 53 | } 54 | 55 | override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { 56 | 57 | switch indexPath.row { 58 | case 1: changePasscode() 59 | 60 | default: return 61 | } 62 | } 63 | 64 | private func changePasscode() { 65 | 66 | let repo = UserDefaultsPasscodeRepository() 67 | let config = PasscodeLockConfiguration(repository: repo) 68 | 69 | let passcodeLock = PasscodeLockViewController(state: .ChangePasscode, configuration: config) 70 | 71 | presentViewController(passcodeLock, animated: true, completion: nil) 72 | } 73 | 74 | 75 | @IBAction func passcodeSwitchDidTap(sender: UISwitch) { 76 | 77 | let passcodeVC: PasscodeLockViewController 78 | 79 | if !configuration.repository.hasPasscode { 80 | 81 | passcodeVC = PasscodeLockViewController(state: .SetPasscode, configuration: configuration) 82 | 83 | } else { 84 | 85 | passcodeVC = PasscodeLockViewController(state: .RemovePasscode, configuration: configuration) 86 | 87 | passcodeVC.successCallback = { lock in 88 | 89 | lock.repository.deletePasscode() 90 | self.updatePasscodeView() 91 | } 92 | } 93 | 94 | presentViewController(passcodeVC, animated: true, completion: nil) 95 | } 96 | 97 | private func updatePasscodeView() { 98 | let hasPasscode = configuration.repository.hasPasscode 99 | passcodeSwitch.on = hasPasscode 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /iBBS/IBBSSettingViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSSettingViewController.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 10/10/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class IBBSSettingViewController: IBBSBaseSettingsViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /iBBS/IBBSTabBarController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarController.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/12/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | import SnapKit 15 | 16 | 17 | class TabBarController: UITabBarController { 18 | 19 | private var statusBarView: UIToolbar! 20 | 21 | override func viewDidLoad() { 22 | super.viewDidLoad() 23 | 24 | changeStatusBarColorOnSwipe() 25 | tabBar.items?[0].title = TITLE_HOME 26 | tabBar.items?[1].title = TITLE_NODE 27 | tabBar.items?[2].title = TITLE_MESSAGE 28 | 29 | NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(changeTabBarTintColor), name: kThemeDidChangeNotification, object: nil) 30 | } 31 | 32 | override func viewDidLayoutSubviews() { 33 | super.viewDidLayoutSubviews() 34 | statusBarView?.frame = UIApplication.sharedApplication().statusBarFrame 35 | } 36 | 37 | private func changeStatusBarColorOnSwipe() { 38 | 39 | if SHOULD_HIDE_NAVIGATIONBAR { 40 | statusBarView = UIToolbar(frame: UIApplication.sharedApplication().statusBarFrame) 41 | statusBarView.barStyle = UIBarStyle.Default 42 | view.addSubview(statusBarView) 43 | } 44 | } 45 | 46 | @objc private func changeTabBarTintColor() { 47 | tabBar.tintColor = CUSTOM_THEME_COLOR 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /iBBS/IBBSTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSTableViewCell.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 9/2/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | import UIKit 14 | import SwiftyJSON 15 | import Kingfisher 16 | 17 | class IBBSTableViewCell: UITableViewCell { 18 | 19 | @IBOutlet weak var userProfireImage: IBBSAvatarImageView! 20 | @IBOutlet weak var topicLabel: UILabel! 21 | @IBOutlet weak var userName: UILabel! 22 | @IBOutlet weak var nodeName: UILabel! 23 | @IBOutlet weak var postTime: UILabel! 24 | 25 | 26 | override func awakeFromNib() { 27 | super.awakeFromNib() 28 | // selectionStyle = UITableViewCellSelectionStyle.None 29 | 30 | // Initialization code 31 | // backgroundColor = UIColor.clearColor() 32 | 33 | separatorInset = UIEdgeInsetsZero 34 | layoutMargins = UIEdgeInsetsZero 35 | selectionStyle = .None 36 | 37 | } 38 | 39 | override func setSelected(selected: Bool, animated: Bool) { 40 | super.setSelected(selected, animated: animated) 41 | 42 | // Configure the view for the selected state 43 | } 44 | 45 | func loadDataToCell(json: JSON) { 46 | 47 | let model = IBBSTopicListModel(json: json) 48 | 49 | userProfireImage.kf_setImageWithURL(model.avatarUrl, placeholderImage: AVATAR_PLACEHOLDER_IMAGE) 50 | 51 | userProfireImage.user = User(id: model.uid, name: model.username) 52 | 53 | topicLabel.text = model.title 54 | userName.text = model.username 55 | nodeName.text = model.board 56 | postTime.text = model.postTime 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /iBBS/IBBSThemes.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSThemes.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 10/7/15. 6 | // Copyright © 2015 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | let kCurrentTheme = "kCurrentTheme" 13 | var CUSTOM_THEME_COLOR = themeColorArray[2] 14 | var BACKGROUNDER_IMAGE = UIImage(named: "bg_image_yellow") 15 | 16 | public enum IBBSThemes: Int { 17 | case DefaultTheme 18 | case RedTheme 19 | case GreenTheme 20 | case YellowTheme 21 | case PurpleTheme 22 | case PinkTheme 23 | case BlackTheme 24 | 25 | public func setTheme() { 26 | switch self { 27 | case .DefaultTheme: 28 | CUSTOM_THEME_COLOR = themeColorArray[0] 29 | BACKGROUNDER_IMAGE = UIImage(named: "bg_image_blue") 30 | 31 | case .RedTheme: 32 | CUSTOM_THEME_COLOR = themeColorArray[1] 33 | BACKGROUNDER_IMAGE = UIImage(named: "bg_image_red") 34 | 35 | case .GreenTheme: 36 | CUSTOM_THEME_COLOR = themeColorArray[2] 37 | BACKGROUNDER_IMAGE = UIImage(named: "bg_image_green") 38 | 39 | case .YellowTheme: 40 | CUSTOM_THEME_COLOR = themeColorArray[3] 41 | BACKGROUNDER_IMAGE = UIImage(named: "bg_image_yellow") 42 | 43 | case .PurpleTheme: 44 | CUSTOM_THEME_COLOR = themeColorArray[4] 45 | BACKGROUNDER_IMAGE = UIImage(named: "bg_image_purple") 46 | 47 | case .PinkTheme: 48 | CUSTOM_THEME_COLOR = themeColorArray[5] 49 | BACKGROUNDER_IMAGE = UIImage(named: "bg_image_pink") 50 | 51 | case .BlackTheme: 52 | CUSTOM_THEME_COLOR = themeColorArray[6] 53 | BACKGROUNDER_IMAGE = UIImage(named: "bg_image_black") 54 | 55 | } 56 | } 57 | 58 | 59 | } 60 | 61 | public let themeColorArray = [ 62 | UIColor(red:0, green:0.57, blue:1, alpha:1), 63 | UIColor.redColor(), 64 | UIColor(red:0.27, green:0.75, blue:0.76, alpha:1), 65 | UIColor(red:1, green:0.827, blue:0, alpha:1), 66 | UIColor.purpleColor(), 67 | UIColor(red:0.98, green:0.31, blue:0.73, alpha:1), 68 | UIColor(red:0.38, green:0.39, blue:0.4, alpha:1) 69 | ] 70 | 71 | -------------------------------------------------------------------------------- /iBBS/IBBSTopicListModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSTopicListModel.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 4/18/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import SwiftyJSON 10 | 11 | 12 | 13 | struct IBBSTopicListModel { 14 | 15 | var board: String! 16 | var title: String! 17 | var uid: Int! 18 | var username: String! 19 | var postTime: String! 20 | var avatarUrl: NSURL! 21 | 22 | init(json: JSON) { 23 | board = json["board"].stringValue 24 | title = json["title"].stringValue 25 | uid = json["uid"].intValue 26 | username = json["username"].stringValue 27 | postTime = json["post_time"].stringValue 28 | avatarUrl = NSURL(string: json["avatar"].stringValue) 29 | } 30 | } -------------------------------------------------------------------------------- /iBBS/IBBSTopicModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSTopicModel.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 4/18/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import SwiftyJSON 10 | 11 | 12 | struct IBBSTopicModel { 13 | 14 | var id: Int! 15 | var board: String! 16 | var title: String! 17 | var content: String! 18 | var uid: Int! 19 | var username: String! 20 | var postTime: String! 21 | var avatarUrl: NSURL! 22 | 23 | init(json: JSON) { 24 | id = json["id"].intValue 25 | board = json["board"].stringValue 26 | uid = json["uid"].intValue 27 | username = json["username"].stringValue 28 | postTime = json["post_time"].stringValue 29 | avatarUrl = NSURL(string: json["avatar"].stringValue) 30 | title = formatData(json["title"].stringValue) 31 | content = formatData(json["post_content"].stringValue) 32 | } 33 | 34 | private func formatData(str: String) -> String { 35 | return str.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet()) 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /iBBS/IBBSUserTopicModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSUserTopicModel.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 5/4/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import SwiftyJSON 10 | 11 | 12 | struct IBBSUserTopicModel { 13 | 14 | var board: String! 15 | var title: String! 16 | var postTime: String! 17 | 18 | init(json: JSON) { 19 | board = json["board"].stringValue 20 | title = json["title"].stringValue 21 | postTime = json["post_time"].stringValue 22 | } 23 | } -------------------------------------------------------------------------------- /iBBS/IBBSUserTopicTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IBBSUserTopicTableViewCell.swift 3 | // iBBS 4 | // 5 | // Created by Augus on 5/4/16. 6 | // Copyright © 2016 iAugus. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftyJSON 11 | 12 | 13 | class IBBSUserTopicTableViewCell: UITableViewCell { 14 | 15 | @IBOutlet weak var topicLabel: UILabel! 16 | @IBOutlet weak var nodeName: UILabel! 17 | @IBOutlet weak var postTime: UILabel! 18 | 19 | override func awakeFromNib() { 20 | super.awakeFromNib() 21 | // selectionStyle = UITableViewCellSelectionStyle.None 22 | 23 | // Initialization code 24 | // backgroundColor = UIColor.clearColor() 25 | 26 | separatorInset = UIEdgeInsetsZero 27 | layoutMargins = UIEdgeInsetsZero 28 | selectionStyle = .None 29 | 30 | } 31 | 32 | override func setSelected(selected: Bool, animated: Bool) { 33 | super.setSelected(selected, animated: animated) 34 | 35 | // Configure the view for the selected state 36 | } 37 | 38 | func loadDataToCell(json: JSON) { 39 | 40 | let model = IBBSUserTopicModel(json: json) 41 | 42 | topicLabel.text = model.title 43 | nodeName.text = model.board 44 | postTime.text = model.postTime 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /iBBS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSAllowsArbitraryLoads 28 | 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIMainStoryboardFile 33 | Main 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UIRequiresFullScreen 39 | 40 | UISupportedInterfaceOrientations 41 | 42 | UIInterfaceOrientationPortrait 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /iBBS/KolodaView/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/KolodaView/.DS_Store -------------------------------------------------------------------------------- /iBBS/MWFeedParser/GTMNSString+HTML.h: -------------------------------------------------------------------------------- 1 | // 2 | // GTMNSString+HTML.h 3 | // Dealing with NSStrings that contain HTML 4 | // 5 | // Copyright 2006-2008 Google Inc. 6 | // 7 | // Licensed under the Apache License, Version 2.0 (the "License"); you may not 8 | // use this file except in compliance with the License. You may obtain a copy 9 | // of the License at 10 | // 11 | // http://www.apache.org/licenses/LICENSE-2.0 12 | // 13 | // Unless required by applicable law or agreed to in writing, software 14 | // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 15 | // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 16 | // License for the specific language governing permissions and limitations under 17 | // the License. 18 | // 19 | 20 | #import 21 | 22 | /// Utilities for NSStrings containing HTML 23 | @interface NSString (GTMNSStringHTMLAdditions) 24 | 25 | /// Get a string where internal characters that need escaping for HTML are escaped 26 | // 27 | /// For example, '&' become '&'. This will only cover characters from table 28 | /// A.2.2 of http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters 29 | /// which is what you want for a unicode encoded webpage. If you have a ascii 30 | /// or non-encoded webpage, please use stringByEscapingAsciiHTML which will 31 | /// encode all characters. 32 | /// 33 | /// For obvious reasons this call is only safe once. 34 | // 35 | // Returns: 36 | // Autoreleased NSString 37 | // 38 | - (NSString *)gtm_stringByEscapingForHTML; 39 | 40 | /// Get a string where internal characters that need escaping for HTML are escaped 41 | // 42 | /// For example, '&' become '&' 43 | /// All non-mapped characters (unicode that don't have a &keyword; mapping) 44 | /// will be converted to the appropriate &#xxx; value. If your webpage is 45 | /// unicode encoded (UTF16 or UTF8) use stringByEscapingHTML instead as it is 46 | /// faster, and produces less bloated and more readable HTML (as long as you 47 | /// are using a unicode compliant HTML reader). 48 | /// 49 | /// For obvious reasons this call is only safe once. 50 | // 51 | // Returns: 52 | // Autoreleased NSString 53 | // 54 | - (NSString *)gtm_stringByEscapingForAsciiHTML; 55 | 56 | /// Get a string where internal characters that are escaped for HTML are unescaped 57 | // 58 | /// For example, '&' becomes '&' 59 | /// Handles and 2 cases as well 60 | /// 61 | // Returns: 62 | // Autoreleased NSString 63 | // 64 | - (NSString *)gtm_stringByUnescapingFromHTML; 65 | 66 | @end -------------------------------------------------------------------------------- /iBBS/MWFeedParser/NSString+HTML.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+HTML.h 3 | // MWFeedParser 4 | // 5 | // Copyright (c) 2010 Michael Waterfall 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // 1. The above copyright notice and this permission notice shall be included 15 | // in all copies or substantial portions of the Software. 16 | // 17 | // 2. This Software cannot be used to archive or collect data such as (but not 18 | // limited to) that of events, news, experiences and activities, for the 19 | // purpose of any concept relating to diary/journal keeping. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 | // THE SOFTWARE. 28 | // 29 | 30 | #import 31 | 32 | // Dependant upon GTMNSString+HTML 33 | 34 | @interface NSString (HTML) 35 | 36 | // Strips HTML tags & comments, removes extra whitespace and decodes HTML character entities. 37 | - (NSString *)stringByConvertingHTMLToPlainText; 38 | 39 | // Decode all HTML entities using GTM. 40 | - (NSString *)stringByDecodingHTMLEntities; 41 | 42 | // Encode all HTML entities using GTM. 43 | - (NSString *)stringByEncodingHTMLEntities; 44 | 45 | // Minimal unicode encoding will only cover characters from table 46 | // A.2.2 of http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters 47 | // which is what you want for a unicode encoded webpage. 48 | - (NSString *)stringByEncodingHTMLEntities:(BOOL)isUnicode; 49 | 50 | // Replace newlines with
tags. 51 | - (NSString *)stringWithNewLinesAsBRs; 52 | 53 | // Remove newlines and white space from string. 54 | - (NSString *)stringByRemovingNewLinesAndWhitespace; 55 | 56 | // Wrap plain URLs in ... 57 | // - Ignores URLs inside tags (any URL beginning with =") 58 | // - HTTP & HTTPS schemes only 59 | // - Only works in iOS 4+ as we use NSRegularExpression (returns self if not supported so be careful with NSMutableStrings) 60 | // - Expression: (?= lock.configuration.maximumInccorectPasscodeAttempts { 45 | 46 | postNotification() 47 | } 48 | 49 | lock.delegate?.passcodeLockDidFail(lock) 50 | } 51 | } 52 | 53 | private mutating func postNotification() { 54 | 55 | guard !isNotificationSent else { return } 56 | 57 | let center = NSNotificationCenter.defaultCenter() 58 | 59 | center.postNotificationName(PasscodeLockIncorrectPasscodeNotification, object: nil) 60 | 61 | isNotificationSent = true 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/PasscodeLock/PasscodeLock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PasscodeLock.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/28/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import LocalAuthentication 11 | 12 | public class PasscodeLock: PasscodeLockType { 13 | 14 | public weak var delegate: PasscodeLockTypeDelegate? 15 | public let configuration: PasscodeLockConfigurationType 16 | 17 | public var repository: PasscodeRepositoryType { 18 | return configuration.repository 19 | } 20 | 21 | public var state: PasscodeLockStateType { 22 | return lockState 23 | } 24 | 25 | public var isTouchIDAllowed: Bool { 26 | return isTouchIDEnabled() && configuration.isTouchIDAllowed && lockState.isTouchIDAllowed 27 | } 28 | 29 | private var lockState: PasscodeLockStateType 30 | private lazy var passcode = [String]() 31 | 32 | public init(state: PasscodeLockStateType, configuration: PasscodeLockConfigurationType) { 33 | 34 | precondition(configuration.passcodeLength > 0, "Passcode length sould be greather than zero.") 35 | 36 | self.lockState = state 37 | self.configuration = configuration 38 | } 39 | 40 | public func addSign(sign: String) { 41 | 42 | passcode.append(sign) 43 | delegate?.passcodeLock(self, addedSignAtIndex: passcode.count - 1) 44 | 45 | if passcode.count >= configuration.passcodeLength { 46 | 47 | lockState.acceptPasscode(passcode, fromLock: self) 48 | passcode.removeAll(keepCapacity: true) 49 | } 50 | } 51 | 52 | public func removeSign() { 53 | 54 | guard passcode.count > 0 else { return } 55 | 56 | passcode.removeLast() 57 | delegate?.passcodeLock(self, removedSignAtIndex: passcode.count) 58 | } 59 | 60 | public func changeStateTo(state: PasscodeLockStateType) { 61 | 62 | lockState = state 63 | delegate?.passcodeLockDidChangeState(self) 64 | } 65 | 66 | public func authenticateWithBiometrics() { 67 | 68 | guard isTouchIDAllowed else { return } 69 | 70 | let context = LAContext() 71 | let reason = localizedStringFor("PasscodeLockTouchIDReason", comment: "TouchID authentication reason") 72 | 73 | context.localizedFallbackTitle = localizedStringFor("PasscodeLockTouchIDButton", comment: "TouchID authentication fallback button") 74 | 75 | context.evaluatePolicy(.DeviceOwnerAuthenticationWithBiometrics, localizedReason: reason) { 76 | success, error in 77 | 78 | self.handleTouchIDResult(success) 79 | } 80 | } 81 | 82 | private func handleTouchIDResult(success: Bool) { 83 | 84 | dispatch_async(dispatch_get_main_queue()) { 85 | 86 | if success { 87 | 88 | self.delegate?.passcodeLockDidSucceed(self) 89 | } 90 | } 91 | } 92 | 93 | private func isTouchIDEnabled() -> Bool { 94 | 95 | let context = LAContext() 96 | 97 | return context.canEvaluatePolicy(.DeviceOwnerAuthenticationWithBiometrics, error: nil) 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/PasscodeLock/SetPasscodeState.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SetPasscodeState.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/28/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct SetPasscodeState: PasscodeLockStateType { 12 | 13 | let title: String 14 | let description: String 15 | let isCancellableAction = true 16 | var isTouchIDAllowed = false 17 | 18 | init(title: String, description: String) { 19 | 20 | self.title = title 21 | self.description = description 22 | } 23 | 24 | init() { 25 | 26 | title = localizedStringFor("PasscodeLockSetTitle", comment: "Set passcode title") 27 | description = localizedStringFor("PasscodeLockSetDescription", comment: "Set passcode description") 28 | } 29 | 30 | func acceptPasscode(passcode: [String], fromLock lock: PasscodeLockType) { 31 | 32 | let nextState = ConfirmPasscodeState(passcode: passcode) 33 | 34 | lock.changeStateTo(nextState) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/PasscodeLockController/Functions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Functions.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/28/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | func localizedStringFor(key: String, comment: String) -> String { 12 | 13 | let name = "PasscodeLock" 14 | let bundle = bundleForResource(name, ofType: "strings") 15 | 16 | return NSLocalizedString(key, tableName: name, bundle: bundle, comment: comment) 17 | } 18 | 19 | func bundleForResource(name: String, ofType type: String) -> NSBundle { 20 | 21 | if(NSBundle.mainBundle().pathForResource(name, ofType: type) != nil) { 22 | return NSBundle.mainBundle() 23 | } 24 | 25 | return NSBundle(forClass: PasscodeLock.self) 26 | } 27 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/PasscodeLockController/PasscodeLockConfiguration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PasscodeLockConfiguration.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/29/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct PasscodeLockConfiguration: PasscodeLockConfigurationType { 12 | 13 | let repository: PasscodeRepositoryType 14 | let passcodeLength = 4 15 | var isTouchIDAllowed = true 16 | let shouldRequestTouchIDImmediately = true 17 | let maximumInccorectPasscodeAttempts = -1 18 | 19 | init(repository: PasscodeRepositoryType) { 20 | 21 | self.repository = repository 22 | } 23 | 24 | init() { 25 | 26 | self.repository = UserDefaultsPasscodeRepository() 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/PasscodeLockController/UserDefaultsPasscodeRepository.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserDefaultsPasscodeRepository.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/29/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class UserDefaultsPasscodeRepository: PasscodeRepositoryType { 12 | 13 | private let passcodeKey = "passcode.lock.passcode" 14 | 15 | private lazy var defaults: NSUserDefaults = { 16 | 17 | return NSUserDefaults.standardUserDefaults() 18 | }() 19 | 20 | var hasPasscode: Bool { 21 | 22 | if passcode != nil { 23 | return true 24 | } 25 | 26 | return false 27 | } 28 | 29 | var passcode: [String]? { 30 | 31 | return defaults.valueForKey(passcodeKey) as? [String] ?? nil 32 | } 33 | 34 | func savePasscode(passcode: [String]) { 35 | 36 | defaults.setObject(passcode, forKey: passcodeKey) 37 | defaults.synchronize() 38 | } 39 | 40 | func deletePasscode() { 41 | 42 | defaults.removeObjectForKey(passcodeKey) 43 | defaults.synchronize() 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/Protocols/PasscodeLockConfigurationType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PasscodeLockConfigurationType.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/28/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol PasscodeLockConfigurationType { 12 | 13 | var repository: PasscodeRepositoryType {get} 14 | var passcodeLength: Int {get} 15 | var isTouchIDAllowed: Bool {get set} 16 | var shouldRequestTouchIDImmediately: Bool {get} 17 | var maximumInccorectPasscodeAttempts: Int {get} 18 | } 19 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/Protocols/PasscodeLockStateType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PasscodeLockStateType.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/28/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol PasscodeLockStateType { 12 | 13 | var title: String {get} 14 | var description: String {get} 15 | var isCancellableAction: Bool {get} 16 | var isTouchIDAllowed: Bool {get} 17 | 18 | mutating func acceptPasscode(passcode: [String], fromLock lock: PasscodeLockType) 19 | } 20 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/Protocols/PasscodeLockType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PasscodeLockType.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/28/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol PasscodeLockType { 12 | 13 | weak var delegate: PasscodeLockTypeDelegate? {get set} 14 | var configuration: PasscodeLockConfigurationType {get} 15 | var repository: PasscodeRepositoryType {get} 16 | var state: PasscodeLockStateType {get} 17 | var isTouchIDAllowed: Bool {get} 18 | 19 | func addSign(sign: String) 20 | func removeSign() 21 | func changeStateTo(state: PasscodeLockStateType) 22 | func authenticateWithBiometrics() 23 | } 24 | 25 | public protocol PasscodeLockTypeDelegate: class { 26 | 27 | func passcodeLockDidSucceed(lock: PasscodeLockType) 28 | func passcodeLockDidFail(lock: PasscodeLockType) 29 | func passcodeLockDidChangeState(lock: PasscodeLockType) 30 | func passcodeLock(lock: PasscodeLockType, addedSignAtIndex index: Int) 31 | func passcodeLock(lock: PasscodeLockType, removedSignAtIndex index: Int) 32 | } 33 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/Protocols/PasscodeRepositoryType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PasscodeRepositoryType.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/28/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol PasscodeRepositoryType { 12 | 13 | var hasPasscode: Bool {get} 14 | var passcode: [String]? {get} 15 | 16 | func savePasscode(passcode: [String]) 17 | func deletePasscode() 18 | } 19 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/Views/PasscodeSignButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PasscodeSignButton.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/28/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @IBDesignable 12 | public class PasscodeSignButton: UIButton { 13 | 14 | @IBInspectable 15 | public var passcodeSign: String = "1" 16 | 17 | @IBInspectable 18 | public var borderColor: UIColor = UIColor.whiteColor() { 19 | didSet { 20 | setupView() 21 | } 22 | } 23 | 24 | @IBInspectable 25 | public var borderRadius: CGFloat = 30 { 26 | didSet { 27 | setupView() 28 | } 29 | } 30 | 31 | @IBInspectable 32 | public var highlightBackgroundColor: UIColor = UIColor.clearColor() { 33 | didSet { 34 | setupView() 35 | } 36 | } 37 | 38 | public override init(frame: CGRect) { 39 | 40 | super.init(frame: frame) 41 | 42 | setupView() 43 | setupActions() 44 | } 45 | 46 | public required init?(coder aDecoder: NSCoder) { 47 | 48 | super.init(coder: aDecoder) 49 | 50 | setupActions() 51 | } 52 | 53 | public override func intrinsicContentSize() -> CGSize { 54 | 55 | return CGSizeMake(60, 60) 56 | } 57 | 58 | private var defaultBackgroundColor = UIColor.clearColor() 59 | 60 | private func setupView() { 61 | 62 | layer.borderWidth = 1 63 | layer.cornerRadius = borderRadius 64 | layer.borderColor = borderColor.CGColor 65 | 66 | if let backgroundColor = backgroundColor { 67 | 68 | defaultBackgroundColor = backgroundColor 69 | } 70 | } 71 | 72 | private func setupActions() { 73 | 74 | addTarget(self, action: #selector(PasscodeSignButton.handleTouchDown), forControlEvents: .TouchDown) 75 | addTarget(self, action: #selector(PasscodeSignButton.handleTouchUp), forControlEvents: [.TouchUpInside, .TouchDragOutside, .TouchCancel]) 76 | } 77 | 78 | func handleTouchDown() { 79 | 80 | animateBackgroundColor(highlightBackgroundColor) 81 | } 82 | 83 | func handleTouchUp() { 84 | 85 | animateBackgroundColor(defaultBackgroundColor) 86 | } 87 | 88 | private func animateBackgroundColor(color: UIColor) { 89 | 90 | UIView.animateWithDuration( 91 | 0.3, 92 | delay: 0.0, 93 | usingSpringWithDamping: 1, 94 | initialSpringVelocity: 0.0, 95 | options: [.AllowUserInteraction, .BeginFromCurrentState], 96 | animations: { 97 | 98 | self.backgroundColor = color 99 | }, 100 | completion: nil 101 | ) 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/Views/PasscodeSignPlaceholderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PasscodeSignPlaceholderView.swift 3 | // PasscodeLock 4 | // 5 | // Created by Yanko Dimitrov on 8/28/15. 6 | // Copyright © 2015 Yanko Dimitrov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @IBDesignable 12 | public class PasscodeSignPlaceholderView: UIView { 13 | 14 | public enum State { 15 | case Inactive 16 | case Active 17 | case Error 18 | } 19 | 20 | @IBInspectable 21 | public var inactiveColor: UIColor = UIColor.whiteColor() { 22 | didSet { 23 | setupView() 24 | } 25 | } 26 | 27 | @IBInspectable 28 | public var activeColor: UIColor = UIColor.grayColor() { 29 | didSet { 30 | setupView() 31 | } 32 | } 33 | 34 | @IBInspectable 35 | public var errorColor: UIColor = UIColor.redColor() { 36 | didSet { 37 | setupView() 38 | } 39 | } 40 | 41 | public override init(frame: CGRect) { 42 | 43 | super.init(frame: frame) 44 | 45 | setupView() 46 | } 47 | 48 | public required init?(coder aDecoder: NSCoder) { 49 | 50 | super.init(coder: aDecoder) 51 | } 52 | 53 | public override func intrinsicContentSize() -> CGSize { 54 | 55 | return CGSizeMake(16, 16) 56 | } 57 | 58 | private func setupView() { 59 | 60 | layer.cornerRadius = 8 61 | layer.borderWidth = 1 62 | layer.borderColor = activeColor.CGColor 63 | backgroundColor = inactiveColor 64 | } 65 | 66 | private func colorsForState(state: State) -> (backgroundColor: UIColor, borderColor: UIColor) { 67 | 68 | switch state { 69 | case .Inactive: return (inactiveColor, activeColor) 70 | case .Active: return (activeColor, activeColor) 71 | case .Error: return (errorColor, errorColor) 72 | } 73 | } 74 | 75 | public func animateState(state: State) { 76 | 77 | let colors = colorsForState(state) 78 | 79 | UIView.animateWithDuration( 80 | 0.5, 81 | delay: 0, 82 | usingSpringWithDamping: 1, 83 | initialSpringVelocity: 0, 84 | options: [], 85 | animations: { 86 | 87 | self.backgroundColor = colors.backgroundColor 88 | self.layer.borderColor = colors.borderColor.CGColor 89 | 90 | }, 91 | completion: nil 92 | ) 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /iBBS/PasscodeLock/Views/TouchID.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /iBBS/PasscodeLock/Views/TouchID.xcassets/Passcode_Lock_Touch_ID.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "Passcode_Lock_Touch_ID@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "Passcode_Lock_Touch_ID@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /iBBS/PasscodeLock/Views/TouchID.xcassets/Passcode_Lock_Touch_ID.imageset/Passcode_Lock_Touch_ID@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/PasscodeLock/Views/TouchID.xcassets/Passcode_Lock_Touch_ID.imageset/Passcode_Lock_Touch_ID@2x.png -------------------------------------------------------------------------------- /iBBS/PasscodeLock/Views/TouchID.xcassets/Passcode_Lock_Touch_ID.imageset/Passcode_Lock_Touch_ID@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/PasscodeLock/Views/TouchID.xcassets/Passcode_Lock_Touch_ID.imageset/Passcode_Lock_Touch_ID@3x.png -------------------------------------------------------------------------------- /iBBS/PasscodeLock/zh-Hans.lproj/PasscodeLock.strings: -------------------------------------------------------------------------------- 1 | /* 2 | PasscodeLock.strings 3 | PasscodeLock 4 | 5 | Created by Yanko Dimitrov on 8/28/15. 6 | Copyright (c) 2015 Yanko Dimitrov. All rights reserved. 7 | */ 8 | 9 | /* Enter Passcode State */ 10 | "PasscodeLockEnterTitle" = "输入密码"; 11 | "PasscodeLockEnterDescription" = "输入密码才能继续"; 12 | 13 | /* Set Passcode State */ 14 | "PasscodeLockSetTitle" = "输入密码"; 15 | "PasscodeLockSetDescription" = "输入你的新密码"; 16 | 17 | /* Confirm Passcode State */ 18 | "PasscodeLockConfirmTitle" = "确认密码"; 19 | "PasscodeLockConfirmDescription" = "再输入一次密码"; 20 | 21 | /* Change Passcode State */ 22 | "PasscodeLockChangeTitle" = "输入旧密码"; 23 | "PasscodeLockChangeDescription" = "输入你的旧密码"; 24 | 25 | /* Passcode Mismatch State */ 26 | "PasscodeLockMismatchTitle" = "再试一次"; 27 | "PasscodeLockMismatchDescription" = "密码不匹配"; 28 | 29 | /* Touch ID Reason */ 30 | "PasscodeLockTouchIDReason" = "验证后才能继续操作"; 31 | 32 | /* Touch ID Fallback Button */ 33 | "PasscodeLockTouchIDButton" = "输入密码"; 34 | 35 | "PasscodeLockChangePasscode" = "更改密码"; 36 | 37 | 38 | "PasscodeLockCancel" = "取消"; 39 | "PasscodeLockDelete" = "删除"; -------------------------------------------------------------------------------- /iBBS/PasscodeLock/zh-Hant.lproj/PasscodeLock.strings: -------------------------------------------------------------------------------- 1 | /* 2 | PasscodeLock.strings 3 | PasscodeLock 4 | 5 | Created by Yanko Dimitrov on 8/28/15. 6 | Copyright (c) 2015 Yanko Dimitrov. All rights reserved. 7 | */ 8 | 9 | /* Enter Passcode State */ 10 | "PasscodeLockEnterTitle" = "輸入密碼"; 11 | "PasscodeLockEnterDescription" = "輸入密碼才能繼續"; 12 | 13 | /* Set Passcode State */ 14 | "PasscodeLockSetTitle" = "輸入密碼"; 15 | "PasscodeLockSetDescription" = "輸入你的新密碼"; 16 | 17 | /* Confirm Passcode State */ 18 | "PasscodeLockConfirmTitle" = "確認密碼"; 19 | "PasscodeLockConfirmDescription" = "再輸入一次密碼"; 20 | 21 | /* Change Passcode State */ 22 | "PasscodeLockChangeTitle" = "輸入舊密碼"; 23 | "PasscodeLockChangeDescription" = "輸入你的舊密碼"; 24 | 25 | /* Passcode Mismatch State */ 26 | "PasscodeLockMismatchTitle" = "再試一次"; 27 | "PasscodeLockMismatchDescription" = "密碼不匹配"; 28 | 29 | /* Touch ID Reason */ 30 | "PasscodeLockTouchIDReason" = "驗證後才能繼續操作"; 31 | 32 | /* Touch ID Fallback Button */ 33 | "PasscodeLockTouchIDButton" = "輸入密碼"; 34 | 35 | "PasscodeLockChangePasscode" = "更改密碼"; 36 | 37 | 38 | "PasscodeLockCancel" = "取消"; 39 | "PasscodeLockDelete" = "刪除"; -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSbgcolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSbgcolor.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSbgcolor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSbgcolor@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSbold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSbold.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSbold@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSbold@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSScenterjustify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSScenterjustify.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSScenterjustify@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSScenterjustify@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSclearstyle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSclearstyle.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSclearstyle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSclearstyle@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSforcejustify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSforcejustify.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSforcejustify@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSforcejustify@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh1.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh1@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh2.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh2@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh3.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh3@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh4.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh4@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh5.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh5@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh6.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSh6@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSh6@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSShorizontalrule.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSShorizontalrule.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSShorizontalrule@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSShorizontalrule@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSimage.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSimage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSimage@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSindent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSindent.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSindent@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSindent@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSinsertkeyword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSinsertkeyword.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSinsertkeyword@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSinsertkeyword@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSitalic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSitalic.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSitalic@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSitalic@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSkeyboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSkeyboard.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSkeyboard@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSkeyboard@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSleftjustify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSleftjustify.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSleftjustify@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSleftjustify@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSlink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSlink.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSlink@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSlink@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSorderedlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSorderedlist.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSorderedlist@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSorderedlist@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSoutdent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSoutdent.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSoutdent@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSoutdent@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSparagraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSparagraph.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSparagraph@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSparagraph@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSpicker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSpicker.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSpicker@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSpicker@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSquicklink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSquicklink.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSquicklink@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSquicklink@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSredo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSredo.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSredo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSredo@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSrightjustify.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSrightjustify.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSrightjustify@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSrightjustify@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSstrikethrough.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSstrikethrough.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSstrikethrough@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSstrikethrough@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSsubscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSsubscript.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSsubscript@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSsubscript@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSsuperscript.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSsuperscript.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSsuperscript@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSsuperscript@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSStable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSStable.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSStable@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSStable@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSStextcolor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSStextcolor.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSStextcolor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSStextcolor@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSunderline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSunderline.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSunderline@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSunderline@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSundo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSundo.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSundo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSundo@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSunlink.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSunlink.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSunlink@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSunlink@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSunorderedlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSunorderedlist.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSunorderedlist@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSunorderedlist@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSviewsource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSviewsource.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Images/ZSSviewsource@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/ZSSRichTextEditor/Images/ZSSviewsource@2x.png -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/CYRLayoutManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYRLayoutManager.h 3 | // 4 | // Version 0.2.0 5 | // 6 | // Created by Illya Busigin on 01/05/2014. 7 | // Copyright (c) 2014 Cyrillian, Inc. 8 | // 9 | // Distributed under MIT license. 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/illyabusigin/CYRTextView 13 | // Original implementation taken from: https://github.com/alldritt/TextKit_LineNumbers 14 | // 15 | // The MIT License (MIT) 16 | // 17 | // Copyright (c) 2014 Cyrillian, Inc. 18 | // 19 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 20 | // this software and associated documentation files (the "Software"), to deal in 21 | // the Software without restriction, including without limitation the rights to 22 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 23 | // the Software, and to permit persons to whom the Software is furnished to do so, 24 | // subject to the following conditions: 25 | // 26 | // The above copyright notice and this permission notice shall be included in all 27 | // copies or substantial portions of the Software. 28 | // 29 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 31 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 32 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 33 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 34 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 35 | 36 | #import 37 | 38 | @interface CYRLayoutManager : NSLayoutManager 39 | 40 | @property (nonatomic, strong) UIFont *lineNumberFont; 41 | @property (nonatomic, strong) UIColor *lineNumberColor; 42 | 43 | @property (nonatomic, readonly) CGFloat gutterWidth; 44 | @property (nonatomic, assign) NSRange selectedRange; 45 | 46 | - (CGRect)paragraphRectForRange:(NSRange)range; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/CYRTextStorage.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYRTextStorage.h 3 | // 4 | // Version 0.2.0 5 | // 6 | // Created by Illya Busigin on 01/05/2014. 7 | // Copyright (c) 2014 Cyrillian, Inc. 8 | // 9 | // Distributed under MIT license. 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/illyabusigin/CYRTextView 13 | // 14 | // The MIT License (MIT) 15 | // 16 | // Copyright (c) 2014 Cyrillian, Inc. 17 | // 18 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 19 | // this software and associated documentation files (the "Software"), to deal in 20 | // the Software without restriction, including without limitation the rights to 21 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 22 | // the Software, and to permit persons to whom the Software is furnished to do so, 23 | // subject to the following conditions: 24 | // 25 | // The above copyright notice and this permission notice shall be included in all 26 | // copies or substantial portions of the Software. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 30 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 31 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 32 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 33 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 34 | 35 | #import 36 | 37 | @interface CYRTextStorage : NSTextStorage 38 | 39 | @property (nonatomic, strong) NSArray *tokens; 40 | @property (nonatomic, strong) UIFont *defaultFont; 41 | 42 | - (void)update; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/CYRTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYRTextView.h 3 | // 4 | // Version 0.2.0 5 | // 6 | // Created by Illya Busigin on 01/05/2014. 7 | // Copyright (c) 2014 Cyrillian, Inc. 8 | // Copyright (c) 2013 Dominik Hauser 9 | // Copyright (c) 2013 Sam Rijs 10 | // 11 | // Distributed under MIT license. 12 | // Get the latest version from here: 13 | // 14 | // https://github.com/illyabusigin/CYRTextView 15 | // Gestures sourced from: https://github.com/srijs/NLTextView 16 | // 17 | // The MIT License (MIT) 18 | // 19 | // Copyright (c) 2014 Cyrillian, Inc. 20 | // 21 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 22 | // this software and associated documentation files (the "Software"), to deal in 23 | // the Software without restriction, including without limitation the rights to 24 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 25 | // the Software, and to permit persons to whom the Software is furnished to do so, 26 | // subject to the following conditions: 27 | // 28 | // The above copyright notice and this permission notice shall be included in all 29 | // copies or substantial portions of the Software. 30 | // 31 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 33 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 34 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 35 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 36 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 37 | 38 | #import 39 | #import "CYRToken.h" 40 | 41 | @interface CYRTextView : UITextView 42 | 43 | @property (nonatomic, strong) NSArray *tokens; 44 | @property (nonatomic, strong) UIPanGestureRecognizer *singleFingerPanRecognizer; 45 | @property (nonatomic, strong) UIPanGestureRecognizer *doubleFingerPanRecognizer; 46 | 47 | @property UIColor *gutterBackgroundColor; 48 | @property UIColor *gutterLineColor; 49 | 50 | @property (nonatomic, assign) BOOL lineCursorEnabled; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/CYRToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // CYRTextAttribute.h 3 | // 4 | // Version 0.2.0 5 | // 6 | // Created by Illya Busigin on 01/05/2014. 7 | // Copyright (c) 2014 Cyrillian, Inc. 8 | // 9 | // Distributed under MIT license. 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/illyabusigin/CYRTextView 13 | // 14 | // The MIT License (MIT) 15 | // 16 | // Copyright (c) 2014 Cyrillian, Inc. 17 | // 18 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 19 | // this software and associated documentation files (the "Software"), to deal in 20 | // the Software without restriction, including without limitation the rights to 21 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 22 | // the Software, and to permit persons to whom the Software is furnished to do so, 23 | // subject to the following conditions: 24 | // 25 | // The above copyright notice and this permission notice shall be included in all 26 | // copies or substantial portions of the Software. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 30 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 31 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 32 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 33 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 34 | 35 | #import 36 | 37 | @interface CYRToken : NSObject 38 | 39 | @property (nonatomic, strong) NSString *name; 40 | @property (nonatomic, strong) NSString *expression; 41 | @property (nonatomic, strong) NSDictionary *attributes; 42 | 43 | + (instancetype)tokenWithName:(NSString *)name expression:(NSString *)expression attributes:(NSDictionary *)attributes; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/CYRToken.m: -------------------------------------------------------------------------------- 1 | // 2 | // CYRTextAttribute.m 3 | // 4 | // Version 0.2.0 5 | // 6 | // Created by Illya Busigin on 01/05/2014. 7 | // Copyright (c) 2014 Cyrillian, Inc. 8 | // 9 | // Distributed under MIT license. 10 | // Get the latest version from here: 11 | // 12 | // https://github.com/illyabusigin/CYRTextView 13 | // 14 | // The MIT License (MIT) 15 | // 16 | // Copyright (c) 2014 Cyrillian, Inc. 17 | // 18 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 19 | // this software and associated documentation files (the "Software"), to deal in 20 | // the Software without restriction, including without limitation the rights to 21 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 22 | // the Software, and to permit persons to whom the Software is furnished to do so, 23 | // subject to the following conditions: 24 | // 25 | // The above copyright notice and this permission notice shall be included in all 26 | // copies or substantial portions of the Software. 27 | // 28 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 29 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 30 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 31 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 32 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 33 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 34 | 35 | #import "CYRToken.h" 36 | 37 | @implementation CYRToken 38 | 39 | + (instancetype)tokenWithName:(NSString *)name expression:(NSString *)expression attributes:(NSDictionary *)attributes 40 | { 41 | CYRToken *textAttribute = [CYRToken new]; 42 | 43 | textAttribute.name = name; 44 | textAttribute.expression = expression; 45 | textAttribute.attributes = attributes; 46 | 47 | return textAttribute; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/HRBrightnessCursor.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2011 Ryota Hayashi 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | * $FreeBSD$ 26 | */ 27 | 28 | #import 29 | 30 | @interface HRBrightnessCursor : UIView 31 | 32 | - (id)initWithPoint:(CGPoint)point; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/HRCgUtil.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2011 Ryota Hayashi 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | * $FreeBSD$ 26 | */ 27 | 28 | #import "HRColorUtil.h" 29 | 30 | // 角丸のパスをセット 31 | void HRSetRoundedRectanglePath(CGContextRef context,const CGRect rect,CGFloat radius); 32 | // かっこいい角丸の四角を描きます。色付き。 33 | void HRDrawSquareColorBatch(CGContextRef context,CGPoint position,HRRGBColor* color,float size); -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/HRColorCursor.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2011 Ryota Hayashi 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | * $FreeBSD$ 26 | */ 27 | 28 | #import 29 | #import "HRColorUtil.h" 30 | 31 | @interface HRColorCursor : UIView{ 32 | HRRGBColor _currentColor; 33 | } 34 | 35 | 36 | + (CGSize) cursorSize; 37 | + (float) outlineSize; 38 | + (float) shadowSize; 39 | 40 | - (id)initWithPoint:(CGPoint)point; 41 | - (void)setColorRed:(float)red andGreen:(float)green andBlue:(float)blue; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/HRColorCursor.m: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2011 Ryota Hayashi 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | * $FreeBSD$ 26 | */ 27 | 28 | #import "HRColorCursor.h" 29 | #import "HRCgUtil.h" 30 | 31 | @implementation HRColorCursor 32 | 33 | + (CGSize) cursorSize 34 | { 35 | return CGSizeMake(30.0, 30.0f); 36 | } 37 | 38 | + (float) outlineSize 39 | { 40 | return 4.0f; 41 | } 42 | 43 | + (float) shadowSize 44 | { 45 | return 2.0f; 46 | } 47 | 48 | 49 | - (id)initWithPoint:(CGPoint)point 50 | { 51 | CGSize size = [HRColorCursor cursorSize]; 52 | CGRect frame = CGRectMake(point.x, point.y, size.width, size.height); 53 | self = [super initWithFrame:frame]; 54 | if (self) { 55 | [self setBackgroundColor:[UIColor clearColor]]; 56 | [self setUserInteractionEnabled:FALSE]; 57 | _currentColor.r = _currentColor.g = _currentColor.b = 1.0f; 58 | } 59 | return self; 60 | } 61 | 62 | - (void)setColorRed:(float)red andGreen:(float)green andBlue:(float)blue{ 63 | _currentColor.r = red; 64 | _currentColor.g = green; 65 | _currentColor.b = blue; 66 | [self setNeedsDisplay]; 67 | } 68 | 69 | - (void)drawRect:(CGRect)rect 70 | { 71 | CGContextRef context = UIGraphicsGetCurrentContext(); 72 | float outlineSize = [HRColorCursor outlineSize]; 73 | CGSize cursorSize = [HRColorCursor cursorSize]; 74 | float shadowSize = [HRColorCursor shadowSize]; 75 | 76 | CGContextSaveGState(context); 77 | HRSetRoundedRectanglePath(context, CGRectMake(shadowSize, shadowSize, cursorSize.width - shadowSize*2.0f, cursorSize.height - shadowSize*2.0f), 2.0f); 78 | [[UIColor whiteColor] set]; 79 | CGContextSetShadow(context, CGSizeMake(0.0f, 1.0f), shadowSize); 80 | CGContextDrawPath(context, kCGPathFill); 81 | CGContextRestoreGState(context); 82 | 83 | 84 | [[UIColor colorWithRed:_currentColor.r green:_currentColor.g blue:_currentColor.b alpha:1.0f] set]; 85 | CGContextFillRect(context, CGRectMake(outlineSize + shadowSize, outlineSize + shadowSize, cursorSize.width - (outlineSize + shadowSize)*2.0f, cursorSize.height - (outlineSize + shadowSize)*2.0f)); 86 | } 87 | 88 | 89 | @end 90 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/HRColorPickerMacros.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2012 Ryota Hayashi 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | * $FreeBSD$ 26 | */ 27 | 28 | #ifndef HRColorPickerMacros_h 29 | #define HRColorPickerMacros_h 30 | 31 | #if !__has_feature(objc_arc_weak) 32 | #define weak unsafe_unretained 33 | #undef __weak 34 | #define __weak __unsafe_unretained 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/HRColorPickerViewController.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2011 Ryota Hayashi 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | * $FreeBSD$ 26 | */ 27 | 28 | #import 29 | #import "HRColorPickerMacros.h" 30 | 31 | @class HRColorPickerView; 32 | 33 | @protocol HRColorPickerViewControllerDelegate 34 | - (void)setSelectedColor:(UIColor*)color tag:(int)tag; 35 | @end 36 | 37 | #define HRColorPickerDelegate HRColorPickerViewControllerDelegate 38 | // Delegateの名前変えました。すみません。 39 | 40 | typedef enum { 41 | HCPCSaveStyleSaveAlways, 42 | HCPCSaveStyleSaveAndCancel 43 | } HCPCSaveStyle; 44 | 45 | @interface HRColorPickerViewController : UIViewController { 46 | id __weak delegate; 47 | HRColorPickerView* colorPickerView; 48 | 49 | UIColor *_color; 50 | BOOL _fullColor; 51 | HCPCSaveStyle _saveStyle; 52 | 53 | } 54 | 55 | @property (nonatomic) int tag; 56 | 57 | + (HRColorPickerViewController *)colorPickerViewControllerWithColor:(UIColor *)color; 58 | + (HRColorPickerViewController *)cancelableColorPickerViewControllerWithColor:(UIColor *)color; 59 | + (HRColorPickerViewController *)fullColorPickerViewControllerWithColor:(UIColor *)color; 60 | + (HRColorPickerViewController *)cancelableFullColorPickerViewControllerWithColor:(UIColor *)color; 61 | 62 | /** Initialize controller with selected color. 63 | * @param defaultColor selected color 64 | * @param fullColor If YES, browseable full color. If NO color was limited. 65 | * @param saveStyle If it's HCPCSaveStyleSaveAlways, save color when self is closing. If it's HCPCSaveStyleSaveAndCancel, shows Cancel and Save button. 66 | */ 67 | - (id)initWithColor:(UIColor*)defaultColor fullColor:(BOOL)fullColor saveStyle:(HCPCSaveStyle)saveStyle; 68 | 69 | /** @deprecated use -save: instead of this . */ 70 | - (void)saveColor:(id)sender; 71 | 72 | - (void)save; 73 | - (void)save:(id)sender; 74 | - (void)cancel:(id)sender; 75 | 76 | 77 | @property (weak) id delegate; 78 | 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/Third Party/HRColorUtil.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2011 Ryota Hayashi 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | * $FreeBSD$ 26 | */ 27 | 28 | #import 29 | 30 | ///////////////////////////////////////////////////////////////////////////// 31 | // 32 | // 0.0f~1.0fの値をとるRGBの構造体です 33 | // 34 | ///////////////////////////////////////////////////////////////////////////// 35 | 36 | typedef struct{ 37 | float r; 38 | float g; 39 | float b; 40 | } HRRGBColor; 41 | 42 | ///////////////////////////////////////////////////////////////////////////// 43 | // 44 | // 0.0f~1.0fの値をとるHSVの構造体です 45 | // 46 | ///////////////////////////////////////////////////////////////////////////// 47 | 48 | typedef struct{ 49 | float h; 50 | float s; 51 | float v; 52 | } HRHSVColor; 53 | 54 | // 値のチェックしてません。数値として入れさせるなら自前でチェックして下さい。 55 | 56 | ///////////////////////////////////////////////////////////////////////////// 57 | // 58 | // 変換用の関数 59 | // 60 | ///////////////////////////////////////////////////////////////////////////// 61 | 62 | void HSVColorFromRGBColor(const HRRGBColor*,HRHSVColor*); 63 | void RGBColorFromHSVColor(const HRHSVColor*,HRRGBColor*); 64 | void RGBColorFromUIColor(const UIColor*,HRRGBColor*); 65 | 66 | // 16進数のカラーコードを取得 (例:#ffffff) 67 | // NSString* hexColorStr = [NSString stringWithFormat:@"#%06x",HexColorFromUIColor([UIColor redColor])]; で文字列に変換されます 68 | int HexColorFromRGBColor(const HRRGBColor*); 69 | int HexColorFromUIColor(const UIColor*); 70 | 71 | 72 | // 同値チェック 73 | bool HRHSVColorEqualToColor(const HRHSVColor*,const HRHSVColor*); 74 | 75 | 76 | // 0.0f~1.0fに納まるxとy、彩度の下限、輝度からHSVを求める 77 | void HSVColorAt(HRHSVColor* hsv,float x,float y,float saturationLowerLimit,float brightness); 78 | 79 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/ZSSBarButtonItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZSSBarButtonItem.h 3 | // ZSSRichTextEditor 4 | // 5 | // Created by Nicholas Hubbard on 12/3/13. 6 | // Copyright (c) 2013 Zed Said Studio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZSSBarButtonItem : UIBarButtonItem 12 | 13 | @property (nonatomic, strong) NSString *label; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/ZSSBarButtonItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZSSBarButtonItem.m 3 | // ZSSRichTextEditor 4 | // 5 | // Created by Nicholas Hubbard on 12/3/13. 6 | // Copyright (c) 2013 Zed Said Studio. All rights reserved. 7 | // 8 | 9 | #import "ZSSBarButtonItem.h" 10 | 11 | @implementation ZSSBarButtonItem 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /iBBS/ZSSRichTextEditor/ZSSTextView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZSSTextView.h 3 | // ZSSRichTextEditor 4 | // 5 | // Created by Nicholas Hubbard on 1/29/14. 6 | // Copyright (c) 2014 Zed Said Studio. All rights reserved. 7 | // 8 | 9 | #import "CYRTextView.h" 10 | 11 | @interface ZSSTextView : CYRTextView 12 | 13 | @property (nonatomic, strong) UIFont *defaultFont; 14 | @property (nonatomic, strong) UIFont *boldFont; 15 | @property (nonatomic, strong) UIFont *italicFont; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /iBBS/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /iBBS/iBBS-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // iBBS-Bridging-Header.h 3 | // iBBS 4 | // 5 | // Created by Augus on 9/2/15. 6 | // 7 | // http://iAugus.com 8 | // https://github.com/iAugux 9 | // 10 | // Copyright © 2015 iAugus. All rights reserved. 11 | // 12 | 13 | #ifndef iBBS_Bridging_Header_h 14 | #define iBBS_Bridging_Header_h 15 | 16 | #import "ZSSRichTextEditor.h" 17 | #import "NSString+HTML.h" 18 | #import 19 | 20 | 21 | #endif /* iBBS_Bridging_Header_h */ -------------------------------------------------------------------------------- /iBBS/loadmore/RefreshConst.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RefreshConst.swift 3 | // RefreshExample 4 | // 5 | // Created by SunSet on 14-6-23. 6 | // Copyright (c) 2014 zhaokaiyuan. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | let RefreshViewHeight:CFloat = 40.0 12 | let RefreshSlowAnimationDuration:NSTimeInterval = 0.3 13 | 14 | let RefreshContentOffset:NSString = "contentOffset" 15 | let RefreshContentSize:NSString = "contentSize" 16 | 17 | -------------------------------------------------------------------------------- /iBBS/loadmore/UIScrollView+Refresh.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+Refresh.swift 3 | // RefreshExample 4 | // 5 | // Created by SunSet on 14-6-24. 6 | // Copyright (c) 2014 zhaokaiyuan. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | 13 | extension UIScrollView { 14 | 15 | func addFooterWithCallback( callback:(() -> Void)!){ 16 | let footer:RefreshFooterView = RefreshFooterView.footer() 17 | 18 | self.addSubview(footer) 19 | footer.beginRefreshingCallback = callback 20 | 21 | footer.addState(RefreshState.Normal) 22 | } 23 | 24 | 25 | func removeFooter() 26 | { 27 | 28 | for view : AnyObject in self.subviews{ 29 | if view is RefreshFooterView{ 30 | view.removeFromSuperview() 31 | } 32 | } 33 | } 34 | 35 | func footerBeginRefreshing() 36 | { 37 | for object : AnyObject in self.subviews{ 38 | if object is RefreshFooterView{ 39 | object.beginRefreshing() 40 | } 41 | } 42 | 43 | } 44 | 45 | 46 | func footerEndRefreshing() 47 | { 48 | for object : AnyObject in self.subviews{ 49 | if object is RefreshFooterView{ 50 | object.endRefreshing() 51 | } 52 | } 53 | 54 | } 55 | 56 | func setFooterHidden(hidden:Bool) 57 | { 58 | for object : AnyObject in self.subviews{ 59 | if object is RefreshFooterView{ 60 | let view:UIView = object as! UIView 61 | view.hidden = hidden 62 | } 63 | } 64 | 65 | } 66 | 67 | func isFooterHidden() 68 | { 69 | for object : AnyObject in self.subviews{ 70 | if object is RefreshFooterView{ 71 | let view:UIView = object as! UIView 72 | view.hidden = hidden 73 | } 74 | } 75 | 76 | } 77 | 78 | 79 | 80 | 81 | } -------------------------------------------------------------------------------- /iBBS/loadmore/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/iAugux/iBBS-Swift/2c5df04e11d3bb44114ee0f20b68f680d7f21215/iBBS/loadmore/arrow@2x.png --------------------------------------------------------------------------------