侧边菜单栏

查看Github上相关实现,一开始选择的是SlideMenuControllerSwift,后来决定更改为自定义,使用更简洁的方式。

分离

分离之前的SliderMeanController,再添加动画。

1.MainViewControllerremove:

extension MainViewController:SlideMenuControllerDelegate{

func leftWillOpen() {

print("SlideMenuControllerDelegate: leftWillOpen")

OnceOpened = true

}

func leftDidOpen() {

print("SlideMenuControllerDelegate: leftDidOpen")

}

func leftWillClose() {

print("SlideMenuControllerDelegate: leftWillClose")

noteLabel.text = "\(metronome.noteNum)"

metreLabel.text = "\(metronome.metreView.numMetre)"

tempoLabel.text = "\(metronome.tempo)"

tempoItalianName(italianName)

initialHandelPoint()

metronome.metreView.setNeedsDisplay()

print("subview count:")

print(view.subviews.count)

self.ball.setNeedsDisplay()

}

func leftDidClose() {

print("SlideMenuControllerDelegate: leftDidClose")

}

}

LeftViewController

remove:

wiilappear:

initialMenu()

class里面:

weak var delegate: LeftMenuProtocol?

func initialMenu() {

let storyboard = UIStoryboard(name: "Main", bundle: nil)

let nonMenuController = storyboard.instantiateViewControllerWithIdentifier("purchaseViewController") as! PurchaseViewController

nonMenuController.delegate = self

self.nonMenuViewController = UINavigationController(rootViewController: nonMenuController)

}

class 前:

enum LeftMenu: Int {

case Main = 0

}

protocol LeftMenuProtocol : class {

func changeViewController(menu: LeftMenu)

}

class extension:

// MARK: - LeftMenuProtocol

extension LeftViewController: LeftMenuProtocol{

func changeViewController(menu: LeftMenu) {

switch menu {

case .Main:

self.slideMenuController()?.changeMainViewController(self.mainViewController,          close: true)

}

}

}

alert 转场:

self.slideMenuController()?.

changeMainViewController(self.nonMenuViewController, close: true)

App delegate里面:

private func createMenuView() {

// create viewController code...

let storyboard = UIStoryboard(name: "Main", bundle: nil)

let mainViewController = storyboard.instantiateViewControllerWithIdentifier("MainViewController") as! MainViewController

let leftViewController = storyboard.instantiateViewControllerWithIdentifier("LeftViewController") as! LeftViewController

let mvc: UINavigationController = UINavigationController(rootViewController: mainViewController)

UINavigationBar.appearance().tintColor = UIColor(hex: "689F38")

leftViewController.mainViewController = mvc

let slideMenuController = ExSlideMenuController(mainViewController:mvc, leftMenuViewController: leftViewController)

slideMenuController.automaticallyAdjustsScrollViewInsets = true

slideMenuController.delegate = mainViewController

//        self.window?.backgroundColor = UIColor(red: 236.0, green: 238.0, blue: 241.0, alpha: 1.0)

self.window?.rootViewController = slideMenuController

self.window?.makeKeyAndVisible()

}

purchaseViewCont:

class 里面:

weak var delegate: LeftMenuProtocol?

func done() {

delegate?.changeViewController(LeftMenu.Main)

}

override func viewWillAppear(animated: Bool) {

super.viewWillAppear(animated)

self.removeNavigationBarItem()

let doneTitle = NSLocalizedString("doneTitle", comment: "Purchase done title")

let rightButton: UIBarButtonItem = UIBarButtonItem(title: doneTitle, style: .Plain, target: self, action: #selector(done))

navigationItem.rightBarButtonItem = rightButton

动画Spring Animation

我使用的是MengTo的Spring动画库。

内购

技术参考:

https://developer.apple.com/in-app-purchase/

https://www.raywenderlich.com/122144/in-app-purchase-tutorial

https://www.raywenderlich.com/121218/video-tutorial-in-app-purchase-series-introduction

https://github.com/mattt/Ono

https://github.com/awseeley/Swift-In-App-Purchase-Tutorial

页面实现:

How to make a beautiful page for the purchase?

使用Collection View,使用卡片展示。

声音

Where to find the good sound?

推荐网站:

  • https://www.freesound.org/people/toiletrolltube/sounds/345691/

  • http://www.findsounds.com/ISAPI/search.dll?keywords=drum+solo

声音下载之后需要自己进行一些细化处理,推荐Sound Studio,它小而简洁,进行简单的处理足够了。

 

 

后台播放

参考书籍:iOS8 Programming

Appledelegate:

func application(application: UIApplication,didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool  {

// paly on the background

_ = try? AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryAmbient, withOptions: [])

// others

}

func applicationWillResignActive(application: UIApplication) {

_ = try? AVAudioSession.sharedInstance().setActive(true, withOptions: [])

}

func applicationDidBecomeActive(application: UIApplication) {

_ = try? AVAudioSession.sharedInstance().setActive(true, withOptions: [])

}

细节问题

问题:

为什么nav颜色无法更改,感觉蒙上了一层影?

解决:

参考:

Swift: https://github.com/DanisFabric/RainbowNavigation

p.p1 {margin: 0.0px 0.0px 0.0px 60.0px; font: 16.0px ‘Helvetica Neue’; color: #999999}p.p2 {margin: 0.0px 0.0px 0.0px 60.0px; font: 16.0px ‘Helvetica Neue’; color: #999999; min-height: 18.0px}span.s1 {font: 16.0px ‘PingFang SC’}span.Apple-tab-span {white-space:pre}

Swift: https://github.com/DanisFabric/RainbowNavigation

sBarMask?.autoresizingMask = [.FlexibleWidth,.FlexibleHeight]

if let tempBackgroundView = backgroundView {

insertSubview(statusBarMask!, aboveSubview: tempBackgroundView)

}else {

insertSubview(statusBarMask!, atIndex: 0)

}

}

statusBarMask?.backgroundColor = color

}

public func df_setBackgroundColor(color: UIColor) {

if backgroundView == nil {

setBackgroundImage(UIImage(), forBarMetrics: UIBarMetrics.Default)

shadowImage = UIImage()

backgroundView = UIView(frame: CGRect(x: 0, y: -20, width: UIScreen.mainScreen().bounds.width, height: 64))

backgroundView?.userInteractionEnabled = false

backgroundView?.autoresizingMask = [.FlexibleHeight,.FlexibleWidth]

insertSubview(backgroundView!, atIndex: 0)

}

backgroundView?.backgroundColor = color

}

public func df_reset() {

setBackgroundImage(nil, forBarMetrics: .Default)

shadowImage = nil

backgroundView?.removeFromSuperview()

backgroundView = nil

}

// MARK: Properties

private var backgroundView:UIView? {

get {

return objc_getAssociatedObject(self, &kBackgroundViewKey) as? UIView

}

set {

objc_setAssociatedObject(self, &kBackgroundViewKey, newValue, .OBJC_ASSOCIATION_RETAIN)

}

}

private var statusBarMask:UIView? {

get {

return objc_getAssociatedObject(self, &kStatusBarMaskKey) as? UIView

}

set {

objc_setAssociatedObject(self, &kStatusBarMaskKey, newValue, .OBJC_ASSOCIATION_RETAIN)

}

}

}

在MainViewController中添加:

self.navigationController?.navigationBar.df_setBackgroundColor(UIColor.clearColor())

 

为什么点击按钮之后,图片位置会改变?

改变UIButton的image之后,它的位置也会改变,需要将之前的先存储,改变图片之后再赋给它。

CGPoint currentLoc = self.imageButton.center;

[self.imageButton setImage:[UIImage imageNamed:@”face”] forState:UIControlStateNormal];

self.imageButton.center = currentLoc;

好像不是这个问题。我把外面的View去掉一层就OK了。

UIScrollerView

UIScrollerView的contentSize是取决于其子视图的,所以一定要通过子视图来限制其大小。

UIScrollerView需要探索的地方还很多,比如像相册这样的应用,是两个scrollerView,一个用来zoom,一个用来左右切换。

测试

TestFlight测试 (外部测试需审核)

其他第三方测试 (无需审核)

发布

  • 如何取好App名字?

  • 如何写好App介绍?

  • 制作App简短视频?

网站

因为也做过一些网站,用Bootstrap写过前端,PHP写过后台。基本的HTML/CSS,JS都会些,所以做网站对我来说没什么问题。不过,你不需要那么多知识,你可以在直接使用模板,再进行修改即可。

  • 选择模板

  • 准备内容素材(图片、文字、链接)

最终效果:http://azureyu.com/pulse

截图

素材:

  • 在设备上运行,同时按home+电源键进行截图

  • 或者使用模拟器运行之后按Command+S,即可保持截图

AppStore介绍截图制作:

  • 使用Sketch

  • 推荐模板:https://github.com/LaunchKit/SketchToAppStore

  • 思考介绍内容,编辑,修改,再修改,再修改

  • 导出

视频

录制步骤:

  1. 连接设备

  2. 打开QuickTime Player

  3. 进行文件影片录制

  4. 使用iMovie进行剪辑,iMove中可直接新建应用商店预览视频。

Tips:

  1. 视频上传需使用Safair浏览器,最好用iMovie中直接选择导出为应用商店预览视频。这样不会出现视屏帧数太多等问题。

  2. 如何旋转视频?使用QuickTime Player打开,然后在菜单中选择编辑,向左选择即可。

最好将所有素材放在同一个文件夹中,按照一定的命名方式进行整理。

上传

https://developer.apple.com/app-store/cn/

https://itunespartner.apple.com/cn/apps/videos

https://app.grammarly.com/ 避免英语文法错误

介绍

English:

Pulse is a clean and beautiful Metronome. It helps you better your music feeling and skill. With Pulse, your play time will be much more joyful.

Features:

  • Colorful Themes. There are ten attractive themes that you can choose: night, tree, coffee, pink, azure, blue, purple…… make your play time more colorful.

  • Nice Sounds. You can hear the different kinds of sounds: wood, ping, claves, triangle, shaker, blocks……choice the one suit your ear.

  • Save setlist. You can save the setlist that you often play, it’s easy to use.

  • Swing. You can visualize the time passing, see the movements. In Pulse, there are 7 swing types: none, small, medium, large, ball, square, diamond. It always has the one you want.

Others:

  • Play on the lock mood and background.

  • Universal app, available on you iPod touch、iPhone and iPad.

Support :

中文:

律动是一款简洁而美观的节拍器。它能够帮助你提升乐感和技能。缤纷的主题,悦耳的音色,可视化时间流逝的钟摆都能让你的练习更为多彩。

特点:

  • 十种主题缤纷主题任你选择:碳黑、咖啡、森林、粉红、蔚蓝、紫藤、翠绿等。

  • 十余种悦耳音色舒适双耳:实木、沙铃、三角铁、铃环、木鱼、鼓、钢琴、铁、铛等。

  • 一键保存演出列表:一键保持你的演出列表,节约你的时间,方便你的练习。

  • 7种钟摆模式:无, 小, 中, 长, 球, 方, 菱。可视化时间流逝的最佳选择。

其他:

  • 支持锁屏播放和后台播放

  • 支持屏幕常量

  • 支持所有iPod Touch、iPhone和iPad设备

反馈:

被拒5-24

版本上传错误。

再次被拒

Apple审核团队说App会在iPad Air下点击菜单按钮会crash,可是测试了很多次之后,我都没能重现crash,和他们沟通无果。等了两天,我在代码原封不动的情况下,重新build了一个版本,再上传,就通过了。

审核通过 6-1

Market

  • 产品推荐网站 :例如36NEXT,MindStore之类。

  • Weibo Twitter BBS

用户会去哪些地方?

iOS 独立开发记录(下)的更多相关文章

  1. iOS 独立开发记录(上)

    个月前,完成了个人App的2.0版本,也在普天同庆的六一儿童节这天上架了.因为是个人开发,很多实现都是边探索边做.现在完成之后再回顾,发现自己走了些弯路.所以写了这篇总结,概览了从想法.设计.开发到最 ...

  2. iOS-开发记录-UIView属性

    UIView属性 1.alpha 设置视图的透明度.默认为1. // 完全透明 view.alpha = ; // 不透明 view.alpha = ; 2.clipsToBounds // 默认是N ...

  3. 新手IOS tweak越狱app开发记录

    需要改变原先程序功能流程的话,是要用到Logos Tweak 开发.另外,.在苹果商城下载到的app,不能直接拿来分析.需要先做一定的前期准备.网上有很多相关的写第一个越狱插件的文章,这里就不在赘言了 ...

  4. iOS系统提供开发环境下命令行编译工具:xcodebuild

    iOS系统提供开发环境下命令行编译工具:xcodebuild[3] xcodebuild 在介绍xcodebuild之前,需要先弄清楚一些在XCode环境下的一些概念[4]: Workspace:简单 ...

  5. iOS 蓝牙开发资料记录

    一.蓝牙基础认识:   1.iOS蓝牙开发:  iOS蓝牙开发:蓝牙连接和数据读写   iOS蓝牙后台运行  iOS关于app连接已配对设备的问题(ancs协议的锅)          iOS蓝牙空中 ...

  6. CozyRSS开发记录19-窗口标题栏交互

    CozyRSS开发记录19-窗口标题栏交互 1.谈谈对mvvm解耦的看法 在使用mvvm时,如何操作窗口,这是一个问题.这个问题的关键点是:mvvm是把view和viewmodel解耦了的,很多写法一 ...

  7. iOS多线程开发

    概览 大家都知道,在开发过程中应该尽可能减少用户等待时间,让程序尽可能快的完成运算.可是无论是哪种语言开发的程序最终往往转换成汇编语言进而解释成机器码来执行.但是机器码是按顺序执行的,一个复杂的多步操 ...

  8. iOS企业级开发初级课程-表视图(13集)

    首先了解了表视图的组成.表视图类的构成.表视图的分类以及表视图的两个重要协议(委托协议和数据源协议),对表视图有了一个整体上的认识.接下来我们掌握了如何实现简单表视图和分节表视图,以及表视图中索引.搜 ...

  9. 李洪强iOS经典面试题下

    李洪强iOS经典面试题下 21. 下面的代码输出什么? @implementation Son : Father - (id)init { self = [super init]; if (self) ...

随机推荐

  1. Ubuntu14.02 Sublimte2安装

    $sudo add-apt-repository ppa:webupd8team/sublime-text-2 $sudo apt-get update $sudo apt-get install s ...

  2. Leetcode: Reverse Integer 正确的思路下-要考虑代码简化

    题目: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 Have ...

  3. Oracle数据库基础知识_字符串操作相关2

    6.LPAD,RPAD 作用:左/右边的字符串填充一些特定的字符语法: LPAD(string , n, [pad_String])          string:可是字符或者参数          ...

  4. House Of Hello恶搞包为什么如此受热捧!

    凤凰时尚    在大多数人的心中,奢侈品都是昂贵的,摆在精美的橱窗中,动辄上万的价格,高贵而冷艳,也让很多人望而却步.然而,最近在很多时尚年轻一族中却流传着这样一句话“昂贵不等于奢侈,奢侈是一种生活态 ...

  5. myeclipse spket spket-1.6.23.jar 破解安装教程

    一年前安装文档就写过了,今天写破解文档,本来开发js/ext是想用aptana的,但是安装包100多M,我还是用spket吧(才11M),这个需要破解一下license,否则用不了. 一 安装教程如下 ...

  6. Instagram的技术架构

    http://blogread.cn/it/article/5497 Instagram 被 Facebook 以10亿美金收购.团队规模:13 人.而在被Facebook收购前的一个月,整个团队才7 ...

  7. RMQ with Shifts

    uva12299:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_prob ...

  8. JAVA NIO 简介(转)

    1.   基本 概念 IO 是主存和外部设备 ( 硬盘.终端和网络等 ) 拷贝数据的过程. IO 是操作系统的底层功能实现,底层通过 I/O 指令进行完成. 所有语言运行时系统提供执行 I/O 较高级 ...

  9. 数据结构,可并堆(左偏树):COGS [APIO2012] 派遣

    796. [APIO2012] 派遣 在一个忍者的帮派里,一些忍者们被选中派遣给顾客,然后依据自己的工作获取报偿.  在这个帮派里,有一名忍者被称之为Master.除了Master以外,每名忍者都有且 ...

  10. sql server 查询日期中的常用语句, 例如本周第一天, 年内的第几周,有用

    --本周第一天    SELECT DATEADD(Day,1-(DATEPART(Weekday,getdate())+@@DATEFIRST-1)%7,getdate())   --or    s ...